Download web/node_modules/graceful-fs/clone.js from Amitkumar001/Law_Slm: direct link, hf CLI and curl.
- Browser
- Download file 496 Bytes
-
https://huggingface.co/Amitkumar001/Law_Slm/resolve/main/web/node_modules/graceful-fs/clone.js
- Command line
-
hf download hf://Amitkumar001/Law_Slm/web/node_modules/graceful-fs/clone.js
-
curl -L -o clone.js https://huggingface.co/Amitkumar001/Law_Slm/resolve/main/web/node_modules/graceful-fs/clone.js
496 Bytes
| module.exports = clone | |
| var getPrototypeOf = Object.getPrototypeOf || function (obj) { | |
| return obj.__proto__ | |
| } | |
| function clone (obj) { | |
| if (obj === null || typeof obj !== 'object') | |
| return obj | |
| if (obj instanceof Object) | |
| var copy = { __proto__: getPrototypeOf(obj) } | |
| else | |
| var copy = Object.create(null) | |
| Object.getOwnPropertyNames(obj).forEach(function (key) { | |
| Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) | |
| }) | |
| return copy | |
| } | |