Spaces:
Sleeping
Sleeping
Download frontend/node_modules/@sinonjs/commons/lib/every.js from sepidnes/pythonic-rag-FastAPIReact: direct link, hf CLI and curl.
- Browser
- Download file 666 Bytes
-
https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/c9f908872ebbec3c4fa1392419c0f6cd3750ddb3/frontend/node_modules/%40sinonjs/commons/lib/every.js
- Command line
-
hf download hf://spaces/sepidnes/pythonic-rag-FastAPIReact@c9f908872ebbec3c4fa1392419c0f6cd3750ddb3/frontend/node_modules/@sinonjs/commons/lib/every.js
-
curl -L -o every.js https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/c9f908872ebbec3c4fa1392419c0f6cd3750ddb3/frontend/node_modules/%40sinonjs/commons/lib/every.js
666 Bytes
| ; | |
| /** | |
| * Returns true when fn returns true for all members of obj. | |
| * This is an every implementation that works for all iterables | |
| * | |
| * @param {object} obj | |
| * @param {Function} fn | |
| * @returns {boolean} | |
| */ | |
| module.exports = function every(obj, fn) { | |
| var pass = true; | |
| try { | |
| // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods | |
| obj.forEach(function () { | |
| if (!fn.apply(this, arguments)) { | |
| // Throwing an error is the only way to break `forEach` | |
| throw new Error(); | |
| } | |
| }); | |
| } catch (e) { | |
| pass = false; | |
| } | |
| return pass; | |
| }; | |