Spaces:
Sleeping
Sleeping
pythonic-rag-FastAPIReact / frontend /node_modules /adjust-sourcemap-loader /lib /process /to-reg-exp.js
Download frontend/node_modules/adjust-sourcemap-loader/lib/process/to-reg-exp.js from sepidnes/pythonic-rag-FastAPIReact: direct link, hf CLI and curl.
- Browser
- Download file 701 Bytes
-
https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/94e32638a275d46bc1ba62feac204fcaaf313da4/frontend/node_modules/adjust-sourcemap-loader/lib/process/to-reg-exp.js
- Command line
-
hf download hf://spaces/sepidnes/pythonic-rag-FastAPIReact@94e32638a275d46bc1ba62feac204fcaaf313da4/frontend/node_modules/adjust-sourcemap-loader/lib/process/to-reg-exp.js
-
curl -L -o to-reg-exp.js https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/94e32638a275d46bc1ba62feac204fcaaf313da4/frontend/node_modules/adjust-sourcemap-loader/lib/process/to-reg-exp.js
701 Bytes
| ; | |
| var regexParser = require('regex-parser'); | |
| var REGEXP = /(\/?)(.+)\1([a-z]*)/i; | |
| /** | |
| * Parse the give value as a regular expression or give a pass-none expression where it is invalid | |
| * @param {RegExp|string|*} value An existing expression, or its string representation, or degenerate value | |
| * @returns {RegExp} The given expression or one matching the RegExp string else a pass-none expression | |
| */ | |
| function toRegExp(value) { | |
| return ((typeof value === 'object') && (typeof value.test === 'function') && value) || | |
| ((typeof value === 'string') && REGEXP.test(value) && regexParser(value)) || | |
| (/^true$|^$/.test(value) && /.*/) || | |
| /matchnone^/; | |
| } | |
| module.exports = toRegExp; |