Spaces:
Runtime error
Runtime error
Download static/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js from kaab4321/NarrativeFlow: direct link, hf CLI and curl.
- Browser
- Download file 331 Bytes
-
https://huggingface.co/spaces/kaab4321/NarrativeFlow/resolve/main/static/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js
- Command line
-
hf download hf://spaces/kaab4321/NarrativeFlow/static/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js
-
curl -L -o cleanPositionalOperators.js https://huggingface.co/spaces/kaab4321/NarrativeFlow/resolve/main/static/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js
331 Bytes
| ; | |
| /** | |
| * For consistency's sake, we replace positional operator `$` and array filters | |
| * `$[]` and `$[foo]` with `0` when looking up schema paths. | |
| */ | |
| module.exports = function cleanPositionalOperators(path) { | |
| return path. | |
| replace(/\.\$(\[[^\]]*\])?(?=\.)/g, '.0'). | |
| replace(/\.\$(\[[^\]]*\])?$/g, '.0'); | |
| }; | |