Spaces:
Paused
Paused
Download node_modules/@plotly/mapbox-gl/src/style-spec/util/deep_equal.js from Leon4gr45/UserSyncFrontend: direct link, hf CLI and curl.
- Browser
- Download file 749 Bytes
-
https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/mapbox-gl/src/style-spec/util/deep_equal.js
- Command line
-
hf download hf://spaces/Leon4gr45/UserSyncFrontend/node_modules/@plotly/mapbox-gl/src/style-spec/util/deep_equal.js
-
curl -L -o deep_equal.js https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/mapbox-gl/src/style-spec/util/deep_equal.js
749 Bytes
| // @flow | |
| /** | |
| * Deeply compares two object literals. | |
| * | |
| * @private | |
| */ | |
| function deepEqual(a: ?mixed, b: ?mixed): boolean { | |
| if (Array.isArray(a)) { | |
| if (!Array.isArray(b) || a.length !== b.length) return false; | |
| for (let i = 0; i < a.length; i++) { | |
| if (!deepEqual(a[i], b[i])) return false; | |
| } | |
| return true; | |
| } | |
| if (typeof a === 'object' && a !== null && b !== null) { | |
| if (!(typeof b === 'object')) return false; | |
| const keys = Object.keys(a); | |
| if (keys.length !== Object.keys(b).length) return false; | |
| for (const key in a) { | |
| if (!deepEqual(a[key], b[key])) return false; | |
| } | |
| return true; | |
| } | |
| return a === b; | |
| } | |
| export default deepEqual; | |