Download Fore_End/cpcn2/node_modules/has-property-descriptors/index.js from zxy0307/JavaWeb: direct link, hf CLI and curl.
- Browser
- Download file 817 Bytes
-
https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/has-property-descriptors/index.js
- Command line
-
hf download hf://zxy0307/JavaWeb/Fore_End/cpcn2/node_modules/has-property-descriptors/index.js
-
curl -L -o index.js https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/has-property-descriptors/index.js
817 Bytes
| ; | |
| var GetIntrinsic = require('get-intrinsic'); | |
| var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); | |
| var hasPropertyDescriptors = function hasPropertyDescriptors() { | |
| if ($defineProperty) { | |
| try { | |
| $defineProperty({}, 'a', { value: 1 }); | |
| return true; | |
| } catch (e) { | |
| // IE 8 has a broken defineProperty | |
| return false; | |
| } | |
| } | |
| return false; | |
| }; | |
| hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { | |
| // node v0.6 has a bug where array lengths can be Set but not Defined | |
| if (!hasPropertyDescriptors()) { | |
| return null; | |
| } | |
| try { | |
| return $defineProperty([], 'length', { value: 1 }).length !== 1; | |
| } catch (e) { | |
| // In Firefox 4-22, defining length on an array throws an exception. | |
| return true; | |
| } | |
| }; | |
| module.exports = hasPropertyDescriptors; | |