Fix: estimates geo v2

This commit is contained in:
Arsen
2026-02-04 00:11:19 +05:00
commit 3f0086f88e
22567 changed files with 4348823 additions and 0 deletions

20
backend/node_modules/object.assign/.editorconfig generated vendored Executable file
View File

@@ -0,0 +1,20 @@
root = true
[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 150
[CHANGELOG.md]
indent_style = space
indent_size = 2
[*.json]
max_line_length = off
[Makefile]
max_line_length = off

28
backend/node_modules/object.assign/.eslintrc generated vendored Executable file
View File

@@ -0,0 +1,28 @@
{
"root": true,
"extends": "@ljharb",
"ignorePatterns": ["dist/"],
"rules": {
"eqeqeq": [2, "allow-null"],
"id-length": [2, { "min": 1, "max": 30 }],
"max-statements": [2, 33],
"max-statements-per-line": [2, { "max": 2 }],
"no-magic-numbers": [1, { "ignore": [0] }],
"no-restricted-syntax": [2, "BreakStatement", "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"],
},
"overrides": [
{
"files": "test/**",
"rules": {
"no-invalid-this": 1,
"max-lines-per-function": 0,
"max-statements-per-line": [2, { "max": 3 }],
"no-magic-numbers": 0,
},
},
],
}

12
backend/node_modules/object.assign/.github/FUNDING.yml generated vendored Executable file
View File

@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/object.assign
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

9
backend/node_modules/object.assign/.nycrc generated vendored Executable file
View File

@@ -0,0 +1,9 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"exclude": [
"coverage",
"test"
]
}

246
backend/node_modules/object.assign/CHANGELOG.md generated vendored Executable file
View File

@@ -0,0 +1,246 @@
4.1.7 / 2024-12-18
==================
* [Deps] add missing `es-object-atoms` (#86)
4.1.6 / 2024-12-18
==================
* [Refactor] use `call-bound` directly; use `es-object-atoms`
* [Deps] update `call-bind`, `has-symbols`
* [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `hasown`, `mock-property`, `ses`, `tape`
* [actions] split out node 10-20, and 20+
* [actions] remove redundant finisher
* [Tests] replace `aud` with `npm audit`
4.1.5 / 2023-11-30
==================
* [meta] republish without testing HTML file (#85)
* [Deps] update `call-bind`, `define-properties`
* [Dev Deps] use `hasown` instead of `has`
* [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `aud`, `npmignore`, `mock-property`, `tape`
* [actions] update rebase action
4.1.4 / 2022-08-16
==================
* [meta] fix `npmignore` integration (#83)
4.1.3 / 2022-08-05
==================
* [Refactor] make steps closer to actual spec
* [Refactor] simplify object coercible check
* [readme] remove defunct badges, add coverage and actions badges
* [eslint] ignore coverage output
* [meta] use `npmignore` to autogenerate an npmignore file
* [meta] remove audit-level
* [Deps] update `call-bind`, `define-properties`, `has-symbols`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `aud`, `functions-have-names`, `safe-publish-latest`, `ses`, `tape`
* [actions] use `node/install` instead of `node/run`; use `codecov` action
* [actions] reuse common workflows
* [actions] update codecov uploader
* [Tests] add implementation tests
* [Tests] use `mock-property`
* [Tests] disable posttest pending `aud` handling `file:` deps
* [Tests] migrate remaining tests to Github Actions (#81)
* [Tests] gitignore coverage output
* [Tests] test node v1-v9 on Github Actions instead of travis; resume testing all minors (#80)
4.1.2 / 2020-10-30
==================
* [Refactor] use extracted `call-bind` instead of full `es-abstract`
* [Dev Deps] update `eslint`, `ses`, `browserify`
* [Tests] run tests in SES
* [Tests] ses-compat: show error stacks
4.1.1 / 2020-09-11
==================
* [Fix] avoid mutating `Object.assign` in modern engines
* [Refactor] use `callBind` from `es-abstract` instead of `function-bind`
* [Deps] update `has-symbols`, `object-keys`, `define-properties`
* [meta] add `funding` field, FUNDING.yml
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `browserify`, `covert`, `for-each`, `is`, `tape`, `functions-have-names`; add `aud`, `safe-publish-latest`; remove `jscs`
* [actions] add Require Allow Edits workflow
* [actions] add automatic rebasing / merge commit blocking
* [Tests] ses-compat - add test to ensure package initializes correctly after ses lockdown (#77)
* [Tests] Add passing test for a source of `window.location` (#68)
* [Tests] use shared travis-ci config
* [Tests] use `npx aud` instead of `npm audit` with hoops or `nsp`
* [Tests] use `functions-have-names`
4.1.0 / 2017-12-21
==================
* [New] add `auto` entry point (#52)
* [Refactor] Use `has-symbols` module
* [Deps] update `function-bind`, `object-keys`
* [Dev Deps] update `@es-shims/api`, `browserify`, `nsp`, `eslint`, `@ljharb/eslint-config`, `is`
* [Tests] up to `node` `v9.3`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTS
4.0.4 / 2016-07-04
==================
* [Fix] Cache original `getOwnPropertySymbols`, and use that when `Object.getOwnPropertySymbols` is unavailable
* [Deps] update `object-keys`
* [Dev Deps] update `eslint`, `get-own-property-symbols`, `core-js`, `jscs`, `nsp`, `browserify`, `@ljharb/eslint-config`, `tape`, `@es-shims/api`
* [Tests] up to `node` `v6.2`, `v5.10`, `v4.4`
* [Tests] run sham tests on node 0.10
* [Tests] use pretest/posttest for linting/security
4.0.3 / 2015-10-21
==================
* [Fix] Support core-js's Symbol sham (#17)
* [Fix] Ensure that properties removed or made non-enumerable during enumeration are not assigned (#16)
* [Fix] Avoid looking up keys and values more than once
* [Tests] Avoid using `reduce` so `npm run test:shams:corejs` passes in `node` `v0.8` ([core-js#122](https://github.com/zloirock/core-js/issues/122))
* [Tests] Refactor to use my conventional structure that separates shimmed, implementation, and common tests
* [Tests] Create `npm run test:shams` and better organize tests for symbol shams
* [Tests] Remove `nsp` in favor of `requiresafe`
4.0.2 / 2015-10-20
==================
* [Fix] Ensure correct property enumeration order, particularly in v8 (#15)
* [Deps] update `object-keys`, `define-properties`
* [Dev Deps] update `browserify`, `is`, `tape`, `jscs`, `eslint`, `@ljharb/eslint-config`
* [Tests] up to `io.js` `v3.3`, `node` `v4.2`
4.0.1 / 2015-08-16
==================
* [Docs] Add `Symbol` note to readme
4.0.0 / 2015-08-15
==================
* [Breaking] Implement the [es-shim API](es-shims/api).
* [Robustness] Make implementation robust against later modification of environment methods.
* [Refactor] Move implementation to `implementation.js`
* [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG
* [Deps] update `object-keys`, `define-properties`
* [Dev Deps] update `browserify`, `tape`, `eslint`, `jscs`, `browserify`
* [Tests] Add `npm run tests-only`
* [Tests] use my personal shared `eslint` config.
* [Tests] up to `io.js` `v3.0`
3.0.1 / 2015-06-28
==================
* Cache `Object` and `Array#push` to make the shim more robust.
* [Fix] Remove use of `Array#filter`, which isn't in ES3.
* [Deps] Update `object-keys`, `define-properties`
* [Dev Deps] Update `get-own-property-symbols`, `browserify`, `eslint`, `nsp`
* [Tests] Test up to `io.js` `v2.3`
* [Tests] Adding `Object.assign` tests for non-object targets, per https://github.com/paulmillr/es6-shim/issues/348
3.0.0 / 2015-05-20
==================
* Attempt to feature-detect Symbols, even if `typeof Symbol() !== 'symbol'` (#12)
* Make a separate `hasSymbols` internal module
* Update `browserify`, `eslint`
2.0.3 / 2015-06-28
==================
* Cache `Object` and `Array#push` to make the shim more robust.
* [Fix] Remove use of `Array#filter`, which isn't in ES3
* [Deps] Update `object-keys`, `define-properties`
* [Dev Deps] Update `browserify`, `nsp`, `eslint`
* [Tests] Test up to `io.js` `v2.3`
2.0.2 / 2015-05-20
==================
* Make sure `.shim` is non-enumerable.
* Refactor `.shim` implementation to use `define-properties` predicates, rather than `delete`ing the original.
* Update docs to match spec/implementation. (#11)
* Add `npm run eslint`
* Test up to `io.js` `v2.0`
* Update `jscs`, `browserify`, `covert`
2.0.1 / 2015-04-12
==================
* Make sure non-enumerable Symbols are excluded.
2.0.0 / 2015-04-12
==================
* Make sure the shim function overwrites a broken implementation with pending exceptions.
* Ensure shim is not enumerable using `define-properties`
* Ensure `Object.assign` includes symbols.
* All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`.
* Run `travis-ci` tests on `iojs` and `node` v0.12; speed up builds; allow 0.8 failures.
* Add `npm run security` via `nsp`
* Update `browserify`, `jscs`, `tape`, `object-keys`, `is`
1.1.1 / 2014-12-14
==================
* Actually include the browser build in `npm`
1.1.0 / 2014-12-14
==================
* Add `npm run build`, and build an automatic-shimming browser distribution as part of the npm publish process.
* Update `is`, `jscs`
1.0.3 / 2014-11-29
==================
* Revert "optimize --production installs"
1.0.2 / 2014-11-27
==================
* Update `jscs`, `is`, `object-keys`, `tape`
* Add badges to README
* Name URLs in README
* Lock `covert` to `v1.0.0`
* Optimize --production installs
1.0.1 / 2014-08-26
==================
* Update `is`, `covert`
1.0.0 / 2014-08-07
==================
* Update `object-keys`, `tape`
0.5.0 / 2014-07-31
==================
* Object.assign no longer throws on null or undefined sources, per https://bugs.ecmascript.org/show_bug.cgi?id=3096
0.4.3 / 2014-07-30
==================
* Dont modify vars in the function signature, since it deoptimizes v8
0.4.2 / 2014-07-30
==================
* Fixing the version number: v0.4.2
0.4.1 / 2014-07-19
==================
* Revert "Use the native Object.keys if its available."
0.4.0 / 2014-07-19
==================
* Use the native Object.keys if its available.
* Fixes [#2](https://github.com/ljharb/object.assign/issues/2).
* Adding failing tests for [#2](https://github.com/ljharb/object.assign/issues/2).
* Fix indentation.
* Adding `npm run lint`
* Update `tape`, `covert`
* README: Use SVG badge for Travis [#1](https://github.com/ljharb/object.assign/issues/1) from mathiasbynens/patch-1
0.3.1 / 2014-04-10
==================
* Object.assign does partially modify objects if it throws, per https://twitter.com/awbjs/status/454320863093862400
0.3.0 / 2014-04-10
==================
* Update with newest ES6 behavior - Object.assign now takes a variable number of source objects.
* Update `tape`
* Make sure old and unstable nodes dont fail Travis
0.2.1 / 2014-03-16
==================
* Let object-keys handle the fallback
* Update dependency badges
* Adding bower.json
0.2.0 / 2014-03-16
==================
* Use a for loop, because ES3 browsers dont have "reduce"
0.1.1 / 2014-03-14
==================
* Updating readme
0.1.0 / 2014-03-14
==================
* Initial release.

21
backend/node_modules/object.assign/LICENSE generated vendored Executable file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 Jordan Harband
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

136
backend/node_modules/object.assign/README.md generated vendored Executable file
View File

@@ -0,0 +1,136 @@
# object.assign <sup>[![Version Badge][npm-version-svg]][npm-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][npm-url]
An Object.assign shim. Invoke its "shim" method to shim Object.assign if it is unavailable.
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](http://www.ecma-international.org/ecma-262/6.0/#sec-object.assign). In an ES6 environment, it will also work properly with `Symbol`s.
Takes a minimum of 2 arguments: `target` and `source`.
Takes a variable sized list of source arguments - at least 1, as many as you want.
Throws a TypeError if the `target` argument is `null` or `undefined`.
Most common usage:
```js
var assign = require('object.assign').getPolyfill(); // returns native method if compliant
/* or */
var assign = require('object.assign/polyfill')(); // returns native method if compliant
```
## Example
```js
var assert = require('assert');
// Multiple sources!
var target = { a: true };
var source1 = { b: true };
var source2 = { c: true };
var sourceN = { n: true };
var expected = {
a: true,
b: true,
c: true,
n: true
};
assign(target, source1, source2, sourceN);
assert.deepEqual(target, expected); // AWESOME!
```
```js
var target = {
a: true,
b: true,
c: true
};
var source1 = {
c: false,
d: false
};
var sourceN = {
e: false
};
var assigned = assign(target, source1, sourceN);
assert.equal(target, assigned); // returns the target object
assert.deepEqual(assigned, {
a: true,
b: true,
c: false,
d: false,
e: false
});
```
```js
/* when Object.assign is not present */
delete Object.assign;
var shimmedAssign = require('object.assign').shim();
/* or */
var shimmedAssign = require('object.assign/shim')();
assert.equal(shimmedAssign, assign);
var target = {
a: true,
b: true,
c: true
};
var source = {
c: false,
d: false,
e: false
};
var assigned = assign(target, source);
assert.deepEqual(Object.assign(target, source), assign(target, source));
```
```js
/* when Object.assign is present */
var shimmedAssign = require('object.assign').shim();
assert.equal(shimmedAssign, Object.assign);
var target = {
a: true,
b: true,
c: true
};
var source = {
c: false,
d: false,
e: false
};
assert.deepEqual(Object.assign(target, source), assign(target, source));
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[npm-url]: https://npmjs.org/package/object.assign
[npm-version-svg]: http://versionbadg.es/ljharb/object.assign.svg
[travis-svg]: https://travis-ci.org/ljharb/object.assign.svg
[travis-url]: https://travis-ci.org/ljharb/object.assign
[deps-svg]: https://david-dm.org/ljharb/object.assign.svg?theme=shields.io
[deps-url]: https://david-dm.org/ljharb/object.assign
[dev-deps-svg]: https://david-dm.org/ljharb/object.assign/dev-status.svg?theme=shields.io
[dev-deps-url]: https://david-dm.org/ljharb/object.assign#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/object.assign.png?downloads=true&stars=true
[license-image]: http://img.shields.io/npm/l/object.assign.svg
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/object.assign.svg
[downloads-url]: http://npm-stat.com/charts.html?package=object.assign
[codecov-image]: https://codecov.io/gh/ljharb/object.assign/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/object.assign/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/object.assign
[actions-url]: https://github.com/ljharb/object.assign/actions

3
backend/node_modules/object.assign/auto.js generated vendored Executable file
View File

@@ -0,0 +1,3 @@
'use strict';
require('./shim')();

1304
backend/node_modules/object.assign/dist/browser.js generated vendored Executable file

File diff suppressed because it is too large Load Diff

43
backend/node_modules/object.assign/hasSymbols.js generated vendored Executable file
View File

@@ -0,0 +1,43 @@
'use strict';
var keys = require('object-keys');
module.exports = function hasSymbols() {
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
if (typeof Symbol.iterator === 'symbol') { return true; }
var obj = {};
var sym = Symbol('test');
var symObj = Object(sym);
if (typeof sym === 'string') { return false; }
if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
/*
* temp disabled per https://github.com/ljharb/object.assign/issues/17
* if (sym instanceof Symbol) { return false; }
* temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
* if (!(symObj instanceof Symbol)) { return false; }
*/
var symVal = 42;
obj[sym] = symVal;
for (sym in obj) { return false; } // eslint-disable-line no-unreachable-loop
if (keys(obj).length !== 0) { return false; }
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
var syms = Object.getOwnPropertySymbols(obj);
if (syms.length !== 1 || syms[0] !== sym) { return false; }
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
if (typeof Object.getOwnPropertyDescriptor === 'function') {
var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
}
return true;
};

46
backend/node_modules/object.assign/implementation.js generated vendored Executable file
View File

@@ -0,0 +1,46 @@
'use strict';
// modified from https://github.com/es-shims/es6-shim
var objectKeys = require('object-keys');
var hasSymbols = require('has-symbols/shams')();
var callBound = require('call-bound');
var $Object = require('es-object-atoms');
var $push = callBound('Array.prototype.push');
var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');
var originalGetSymbols = hasSymbols ? $Object.getOwnPropertySymbols : null;
// eslint-disable-next-line no-unused-vars
module.exports = function assign(target, source1) {
if (target == null) { throw new TypeError('target must be an object'); }
var to = $Object(target); // step 1
if (arguments.length === 1) {
return to; // step 2
}
for (var s = 1; s < arguments.length; ++s) {
var from = $Object(arguments[s]); // step 3.a.i
// step 3.a.ii:
var keys = objectKeys(from);
var getSymbols = hasSymbols && ($Object.getOwnPropertySymbols || originalGetSymbols);
if (getSymbols) {
var syms = getSymbols(from);
for (var j = 0; j < syms.length; ++j) {
var key = syms[j];
if ($propIsEnumerable(from, key)) {
$push(keys, key);
}
}
}
// step 3.a.iii:
for (var i = 0; i < keys.length; ++i) {
var nextKey = keys[i];
if ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2
var propValue = from[nextKey]; // step 3.a.iii.2.a
to[nextKey] = propValue; // step 3.a.iii.2.b
}
}
}
return to; // step 4
};

22
backend/node_modules/object.assign/index.js generated vendored Executable file
View File

@@ -0,0 +1,22 @@
'use strict';
var defineProperties = require('define-properties');
var callBind = require('call-bind');
var implementation = require('./implementation');
var getPolyfill = require('./polyfill');
var shim = require('./shim');
var polyfill = callBind.apply(getPolyfill());
// eslint-disable-next-line no-unused-vars
var bound = function assign(target, source1) {
return polyfill(Object, arguments);
};
defineProperties(bound, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = bound;

View File

@@ -0,0 +1,11 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"max-statements-per-line": [2, { "max": 2 }],
"no-magic-numbers": 0,
"multiline-comment-style": 0,
}
}

View File

@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/has-symbols
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -0,0 +1,9 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"exclude": [
"coverage",
"test"
]
}

View File

@@ -0,0 +1,91 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.1.0](https://github.com/inspect-js/has-symbols/compare/v1.0.3...v1.1.0) - 2024-12-02
### Commits
- [actions] update workflows [`548c0bf`](https://github.com/inspect-js/has-symbols/commit/548c0bf8c9b1235458df7a1c0490b0064647a282)
- [actions] further shard; update action deps [`bec56bb`](https://github.com/inspect-js/has-symbols/commit/bec56bb0fb44b43a786686b944875a3175cf3ff3)
- [meta] use `npmignore` to autogenerate an npmignore file [`ac81032`](https://github.com/inspect-js/has-symbols/commit/ac81032809157e0a079e5264e9ce9b6f1275777e)
- [New] add types [`6469cbf`](https://github.com/inspect-js/has-symbols/commit/6469cbff1866cfe367b2b3d181d9296ec14b2a3d)
- [actions] update rebase action to use reusable workflow [`9c9d4d0`](https://github.com/inspect-js/has-symbols/commit/9c9d4d0d8938e4b267acdf8e421f4e92d1716d72)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`adb5887`](https://github.com/inspect-js/has-symbols/commit/adb5887ca9444849b08beb5caaa9e1d42320cdfb)
- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`13ec198`](https://github.com/inspect-js/has-symbols/commit/13ec198ec80f1993a87710af1606a1970b22c7cb)
- [Dev Deps] update `auto-changelog`, `core-js`, `tape` [`941be52`](https://github.com/inspect-js/has-symbols/commit/941be5248387cab1da72509b22acf3fdb223f057)
- [Tests] replace `aud` with `npm audit` [`74f49e9`](https://github.com/inspect-js/has-symbols/commit/74f49e9a9d17a443020784234a1c53ce765b3559)
- [Dev Deps] update `npmignore` [`9c0ac04`](https://github.com/inspect-js/has-symbols/commit/9c0ac0452a834f4c2a4b54044f2d6a89f17e9a70)
- [Dev Deps] add missing peer dep [`52337a5`](https://github.com/inspect-js/has-symbols/commit/52337a5621cced61f846f2afdab7707a8132cc12)
## [v1.0.3](https://github.com/inspect-js/has-symbols/compare/v1.0.2...v1.0.3) - 2022-03-01
### Commits
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`518b28f`](https://github.com/inspect-js/has-symbols/commit/518b28f6c5a516cbccae30794e40aa9f738b1693)
- [meta] add `bugs` and `homepage` fields; reorder package.json [`c480b13`](https://github.com/inspect-js/has-symbols/commit/c480b13fd6802b557e1cef9749872cb5fdeef744)
- [actions] reuse common workflows [`01d0ee0`](https://github.com/inspect-js/has-symbols/commit/01d0ee0a8d97c0947f5edb73eb722027a77b2b07)
- [actions] update codecov uploader [`6424ebe`](https://github.com/inspect-js/has-symbols/commit/6424ebe86b2c9c7c3d2e9bd4413a4e4f168cb275)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`dfa7e7f`](https://github.com/inspect-js/has-symbols/commit/dfa7e7ff38b594645d8c8222aab895157fa7e282)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`0c8d436`](https://github.com/inspect-js/has-symbols/commit/0c8d43685c45189cea9018191d4fd7eca91c9d02)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`9026554`](https://github.com/inspect-js/has-symbols/commit/902655442a1bf88e72b42345494ef0c60f5d36ab)
- [readme] add actions and codecov badges [`eaa9682`](https://github.com/inspect-js/has-symbols/commit/eaa9682f990f481d3acf7a1c7600bec36f7b3adc)
- [Dev Deps] update `eslint`, `tape` [`bc7a3ba`](https://github.com/inspect-js/has-symbols/commit/bc7a3ba46f27b7743f8a2579732d59d1b9ac791e)
- [Dev Deps] update `eslint`, `auto-changelog` [`0ace00a`](https://github.com/inspect-js/has-symbols/commit/0ace00af08a88cdd1e6ce0d60357d941c60c2d9f)
- [meta] use `prepublishOnly` script for npm 7+ [`093f72b`](https://github.com/inspect-js/has-symbols/commit/093f72bc2b0ed00c781f444922a5034257bf561d)
- [Tests] test on all 16 minors [`9b80d3d`](https://github.com/inspect-js/has-symbols/commit/9b80d3d9102529f04c20ec5b1fcc6e38426c6b03)
## [v1.0.2](https://github.com/inspect-js/has-symbols/compare/v1.0.1...v1.0.2) - 2021-02-27
### Fixed
- [Fix] use a universal way to get the original Symbol [`#11`](https://github.com/inspect-js/has-symbols/issues/11)
### Commits
- [Tests] migrate tests to Github Actions [`90ae798`](https://github.com/inspect-js/has-symbols/commit/90ae79820bdfe7bc703d67f5f3c5e205f98556d3)
- [meta] do not publish github action workflow files [`29e60a1`](https://github.com/inspect-js/has-symbols/commit/29e60a1b7c25c7f1acf7acff4a9320d0d10c49b4)
- [Tests] run `nyc` on all tests [`8476b91`](https://github.com/inspect-js/has-symbols/commit/8476b915650d360915abe2522505abf4b0e8f0ae)
- [readme] fix repo URLs, remove defunct badges [`126288e`](https://github.com/inspect-js/has-symbols/commit/126288ecc1797c0a40247a6b78bcb2e0bc5d7036)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `core-js`, `get-own-property-symbols` [`d84bdfa`](https://github.com/inspect-js/has-symbols/commit/d84bdfa48ac5188abbb4904b42614cd6c030940a)
- [Tests] fix linting errors [`0df3070`](https://github.com/inspect-js/has-symbols/commit/0df3070b981b6c9f2ee530c09189a7f5c6def839)
- [actions] add "Allow Edits" workflow [`1e6bc29`](https://github.com/inspect-js/has-symbols/commit/1e6bc29b188f32b9648657b07eda08504be5aa9c)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`36cea2a`](https://github.com/inspect-js/has-symbols/commit/36cea2addd4e6ec435f35a2656b4e9ef82498e9b)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`1278338`](https://github.com/inspect-js/has-symbols/commit/127833801865fbc2cc8979beb9ca869c7bfe8222)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`1493254`](https://github.com/inspect-js/has-symbols/commit/1493254eda13db5fb8fc5e4a3e8324b3d196029d)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js` [`b090bf2`](https://github.com/inspect-js/has-symbols/commit/b090bf214d3679a30edc1e2d729d466ab5183e1d)
- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`4addb7a`](https://github.com/inspect-js/has-symbols/commit/4addb7ab4dc73f927ae99928d68817554fc21dc0)
- [Dev Deps] update `auto-changelog`, `tape` [`81d0baf`](https://github.com/inspect-js/has-symbols/commit/81d0baf3816096a89a8558e8043895f7a7d10d8b)
- [Dev Deps] update `auto-changelog`; add `aud` [`1a4e561`](https://github.com/inspect-js/has-symbols/commit/1a4e5612c25d91c3a03d509721d02630bc4fe3da)
- [readme] remove unused testling URLs [`3000941`](https://github.com/inspect-js/has-symbols/commit/3000941f958046e923ed8152edb1ef4a599e6fcc)
- [Tests] only audit prod deps [`692e974`](https://github.com/inspect-js/has-symbols/commit/692e9743c912410e9440207631a643a34b4741a1)
- [Dev Deps] update `@ljharb/eslint-config` [`51c946c`](https://github.com/inspect-js/has-symbols/commit/51c946c7f6baa793ec5390bb5a45cdce16b4ba76)
## [v1.0.1](https://github.com/inspect-js/has-symbols/compare/v1.0.0...v1.0.1) - 2019-11-16
### Commits
- [Tests] use shared travis-ci configs [`ce396c9`](https://github.com/inspect-js/has-symbols/commit/ce396c9419ff11c43d0da5d05cdbb79f7fb42229)
- [Tests] up to `node` `v12.4`, `v11.15`, `v10.15`, `v9.11`, `v8.15`, `v7.10`, `v6.17`, `v4.9`; use `nvm install-latest-npm` [`0690732`](https://github.com/inspect-js/has-symbols/commit/0690732801f47ab429f39ba1962f522d5c462d6b)
- [meta] add `auto-changelog` [`2163d0b`](https://github.com/inspect-js/has-symbols/commit/2163d0b7f36343076b8f947cd1667dd1750f26fc)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `safe-publish-latest`, `tape` [`8e0951f`](https://github.com/inspect-js/has-symbols/commit/8e0951f1a7a2e52068222b7bb73511761e6e4d9c)
- [actions] add automatic rebasing / merge commit blocking [`b09cdb7`](https://github.com/inspect-js/has-symbols/commit/b09cdb7cd7ee39e7a769878f56e2d6066f5ccd1d)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `core-js`, `get-own-property-symbols`, `tape` [`1dd42cd`](https://github.com/inspect-js/has-symbols/commit/1dd42cd86183ed0c50f99b1062345c458babca91)
- [meta] create FUNDING.yml [`aa57a17`](https://github.com/inspect-js/has-symbols/commit/aa57a17b19708906d1927f821ea8e73394d84ca4)
- Only apps should have lockfiles [`a2d8bea`](https://github.com/inspect-js/has-symbols/commit/a2d8bea23a97d15c09eaf60f5b107fcf9a4d57aa)
- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`9e96cb7`](https://github.com/inspect-js/has-symbols/commit/9e96cb783746cbed0c10ef78e599a8eaa7ebe193)
- [meta] add `funding` field [`a0b32cf`](https://github.com/inspect-js/has-symbols/commit/a0b32cf68e803f963c1639b6d47b0a9d6440bab0)
- [Dev Deps] update `safe-publish-latest` [`cb9f0a5`](https://github.com/inspect-js/has-symbols/commit/cb9f0a521a3a1790f1064d437edd33bb6c3d6af0)
## v1.0.0 - 2016-09-19
### Commits
- Tests. [`ecb6eb9`](https://github.com/inspect-js/has-symbols/commit/ecb6eb934e4883137f3f93b965ba5e0a98df430d)
- package.json [`88a337c`](https://github.com/inspect-js/has-symbols/commit/88a337cee0864a0da35f5d19e69ff0ef0150e46a)
- Initial commit [`42e1e55`](https://github.com/inspect-js/has-symbols/commit/42e1e5502536a2b8ac529c9443984acd14836b1c)
- Initial implementation. [`33f5cc6`](https://github.com/inspect-js/has-symbols/commit/33f5cc6cdff86e2194b081ee842bfdc63caf43fb)
- read me [`01f1170`](https://github.com/inspect-js/has-symbols/commit/01f1170188ff7cb1558aa297f6ba5b516c6d7b0c)

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016 Jordan Harband
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,46 @@
# has-symbols <sup>[![Version Badge][2]][1]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][5]][6]
[![dev dependency status][7]][8]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][11]][1]
Determine if the JS environment has Symbol support. Supports spec, or shams.
## Example
```js
var hasSymbols = require('has-symbols');
hasSymbols() === true; // if the environment has native Symbol support. Not polyfillable, not forgeable.
var hasSymbolsKinda = require('has-symbols/shams');
hasSymbolsKinda() === true; // if the environment has a Symbol sham that mostly follows the spec.
```
## Supported Symbol shams
- get-own-property-symbols [npm](https://www.npmjs.com/package/get-own-property-symbols) | [github](https://github.com/WebReflection/get-own-property-symbols)
- core-js [npm](https://www.npmjs.com/package/core-js) | [github](https://github.com/zloirock/core-js)
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[1]: https://npmjs.org/package/has-symbols
[2]: https://versionbadg.es/inspect-js/has-symbols.svg
[5]: https://david-dm.org/inspect-js/has-symbols.svg
[6]: https://david-dm.org/inspect-js/has-symbols
[7]: https://david-dm.org/inspect-js/has-symbols/dev-status.svg
[8]: https://david-dm.org/inspect-js/has-symbols#info=devDependencies
[11]: https://nodei.co/npm/has-symbols.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/has-symbols.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/has-symbols.svg
[downloads-url]: https://npm-stat.com/charts.html?package=has-symbols
[codecov-image]: https://codecov.io/gh/inspect-js/has-symbols/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/has-symbols/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-symbols
[actions-url]: https://github.com/inspect-js/has-symbols/actions

View File

@@ -0,0 +1,3 @@
declare function hasNativeSymbols(): boolean;
export = hasNativeSymbols;

View File

@@ -0,0 +1,14 @@
'use strict';
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
var hasSymbolSham = require('./shams');
/** @type {import('.')} */
module.exports = function hasNativeSymbols() {
if (typeof origSymbol !== 'function') { return false; }
if (typeof Symbol !== 'function') { return false; }
if (typeof origSymbol('foo') !== 'symbol') { return false; }
if (typeof Symbol('bar') !== 'symbol') { return false; }
return hasSymbolSham();
};

View File

@@ -0,0 +1,111 @@
{
"name": "has-symbols",
"version": "1.1.0",
"description": "Determine if the JS environment has Symbol support. Supports spec, or shams.",
"main": "index.js",
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"pretest": "npm run --silent lint",
"test": "npm run tests-only",
"posttest": "npx npm@'>=10.2' audit --production",
"tests-only": "npm run test:stock && npm run test:shams",
"test:stock": "nyc node test",
"test:staging": "nyc node --harmony --es-staging test",
"test:shams": "npm run --silent test:shams:getownpropertysymbols && npm run --silent test:shams:corejs",
"test:shams:corejs": "nyc node test/shams/core-js.js",
"test:shams:getownpropertysymbols": "nyc node test/shams/get-own-property-symbols.js",
"lint": "eslint --ext=js,mjs .",
"postlint": "tsc -p . && attw -P",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git://github.com/inspect-js/has-symbols.git"
},
"keywords": [
"Symbol",
"symbols",
"typeof",
"sham",
"polyfill",
"native",
"core-js",
"ES6"
],
"author": {
"name": "Jordan Harband",
"email": "ljharb@gmail.com",
"url": "http://ljharb.codes"
},
"contributors": [
{
"name": "Jordan Harband",
"email": "ljharb@gmail.com",
"url": "http://ljharb.codes"
}
],
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/ljharb/has-symbols/issues"
},
"homepage": "https://github.com/ljharb/has-symbols#readme",
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.0",
"@ljharb/eslint-config": "^21.1.1",
"@ljharb/tsconfig": "^0.2.0",
"@types/core-js": "^2.5.8",
"@types/tape": "^5.6.5",
"auto-changelog": "^2.5.0",
"core-js": "^2.6.12",
"encoding": "^0.1.13",
"eslint": "=8.8.0",
"get-own-property-symbols": "^0.9.5",
"in-publish": "^2.0.1",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"tape": "^5.9.0",
"typescript": "next"
},
"testling": {
"files": "test/index.js",
"browsers": [
"iexplore/6.0..latest",
"firefox/3.0..6.0",
"firefox/15.0..latest",
"firefox/nightly",
"chrome/4.0..10.0",
"chrome/20.0..latest",
"chrome/canary",
"opera/10.0..latest",
"opera/next",
"safari/4.0..latest",
"ipad/6.0..latest",
"iphone/6.0..latest",
"android-browser/4.2"
]
},
"engines": {
"node": ">= 0.4"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows",
"types"
]
}
}

View File

@@ -0,0 +1,3 @@
declare function hasSymbolShams(): boolean;
export = hasSymbolShams;

View File

@@ -0,0 +1,45 @@
'use strict';
/** @type {import('./shams')} */
/* eslint complexity: [2, 18], max-statements: [2, 33] */
module.exports = function hasSymbols() {
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
if (typeof Symbol.iterator === 'symbol') { return true; }
/** @type {{ [k in symbol]?: unknown }} */
var obj = {};
var sym = Symbol('test');
var symObj = Object(sym);
if (typeof sym === 'string') { return false; }
if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
// temp disabled per https://github.com/ljharb/object.assign/issues/17
// if (sym instanceof Symbol) { return false; }
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
// if (!(symObj instanceof Symbol)) { return false; }
// if (typeof Symbol.prototype.toString !== 'function') { return false; }
// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
var symVal = 42;
obj[sym] = symVal;
for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
var syms = Object.getOwnPropertySymbols(obj);
if (syms.length !== 1 || syms[0] !== sym) { return false; }
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
if (typeof Object.getOwnPropertyDescriptor === 'function') {
// eslint-disable-next-line no-extra-parens
var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));
if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
}
return true;
};

View File

@@ -0,0 +1,22 @@
'use strict';
var test = require('tape');
var hasSymbols = require('../');
var runSymbolTests = require('./tests');
test('interface', function (t) {
t.equal(typeof hasSymbols, 'function', 'is a function');
t.equal(typeof hasSymbols(), 'boolean', 'returns a boolean');
t.end();
});
test('Symbols are supported', { skip: !hasSymbols() }, function (t) {
runSymbolTests(t);
t.end();
});
test('Symbols are not supported', { skip: hasSymbols() }, function (t) {
t.equal(typeof Symbol, 'undefined', 'global Symbol is undefined');
t.equal(typeof Object.getOwnPropertySymbols, 'undefined', 'Object.getOwnPropertySymbols does not exist');
t.end();
});

View File

@@ -0,0 +1,29 @@
'use strict';
var test = require('tape');
if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') {
test('has native Symbol support', function (t) {
t.equal(typeof Symbol, 'function');
t.equal(typeof Symbol(), 'symbol');
t.end();
});
// @ts-expect-error TS is stupid and doesn't know about top level return
return;
}
var hasSymbols = require('../../shams');
test('polyfilled Symbols', function (t) {
/* eslint-disable global-require */
t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling');
require('core-js/fn/symbol');
require('core-js/fn/symbol/to-string-tag');
require('../tests')(t);
var hasSymbolsAfter = hasSymbols();
t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling');
/* eslint-enable global-require */
t.end();
});

View File

@@ -0,0 +1,29 @@
'use strict';
var test = require('tape');
if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') {
test('has native Symbol support', function (t) {
t.equal(typeof Symbol, 'function');
t.equal(typeof Symbol(), 'symbol');
t.end();
});
// @ts-expect-error TS is stupid and doesn't know about top level return
return;
}
var hasSymbols = require('../../shams');
test('polyfilled Symbols', function (t) {
/* eslint-disable global-require */
t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling');
require('get-own-property-symbols');
require('../tests')(t);
var hasSymbolsAfter = hasSymbols();
t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling');
/* eslint-enable global-require */
t.end();
});

View File

@@ -0,0 +1,58 @@
'use strict';
/** @type {(t: import('tape').Test) => false | void} */
// eslint-disable-next-line consistent-return
module.exports = function runSymbolTests(t) {
t.equal(typeof Symbol, 'function', 'global Symbol is a function');
if (typeof Symbol !== 'function') { return false; }
t.notEqual(Symbol(), Symbol(), 'two symbols are not equal');
/*
t.equal(
Symbol.prototype.toString.call(Symbol('foo')),
Symbol.prototype.toString.call(Symbol('foo')),
'two symbols with the same description stringify the same'
);
*/
/*
var foo = Symbol('foo');
t.notEqual(
String(foo),
String(Symbol('bar')),
'two symbols with different descriptions do not stringify the same'
);
*/
t.equal(typeof Symbol.prototype.toString, 'function', 'Symbol#toString is a function');
// t.equal(String(foo), Symbol.prototype.toString.call(foo), 'Symbol#toString equals String of the same symbol');
t.equal(typeof Object.getOwnPropertySymbols, 'function', 'Object.getOwnPropertySymbols is a function');
/** @type {{ [k in symbol]?: unknown }} */
var obj = {};
var sym = Symbol('test');
var symObj = Object(sym);
t.notEqual(typeof sym, 'string', 'Symbol is not a string');
t.equal(Object.prototype.toString.call(sym), '[object Symbol]', 'symbol primitive Object#toStrings properly');
t.equal(Object.prototype.toString.call(symObj), '[object Symbol]', 'symbol primitive Object#toStrings properly');
var symVal = 42;
obj[sym] = symVal;
// eslint-disable-next-line no-restricted-syntax, no-unused-vars
for (var _ in obj) { t.fail('symbol property key was found in for..in of object'); }
t.deepEqual(Object.keys(obj), [], 'no enumerable own keys on symbol-valued object');
t.deepEqual(Object.getOwnPropertyNames(obj), [], 'no own names on symbol-valued object');
t.deepEqual(Object.getOwnPropertySymbols(obj), [sym], 'one own symbol on symbol-valued object');
t.equal(Object.prototype.propertyIsEnumerable.call(obj, sym), true, 'symbol is enumerable');
t.deepEqual(Object.getOwnPropertyDescriptor(obj, sym), {
configurable: true,
enumerable: true,
value: 42,
writable: true
}, 'property descriptor is correct');
};

View File

@@ -0,0 +1,10 @@
{
"extends": "@ljharb/tsconfig",
"compilerOptions": {
"target": "ES2021",
"maxNodeModuleJsDepth": 0,
},
"exclude": [
"coverage"
]
}

96
backend/node_modules/object.assign/package.json generated vendored Executable file
View File

@@ -0,0 +1,96 @@
{
"name": "object.assign",
"version": "4.1.7",
"author": "Jordan Harband",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"description": "ES6 spec-compliant Object.assign shim. From https://github.com/es-shims/es6-shim",
"license": "MIT",
"main": "index.js",
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"pretest": "npm run lint && es-shim-api --bound",
"test": "npm run tests-only && npm run test:ses",
"posttest": "npx npm@'>=10.2' audit --production",
"tests-only": "npm run test:implementation && npm run test:shim",
"test:native": "nyc node test/native",
"test:shim": "nyc node test/shimmed",
"test:implementation": "nyc node test",
"test:ses": "node test/ses-compat",
"lint": "eslint .",
"build": "mkdir -p dist && browserify browserShim.js > dist/browser.js",
"prepublishOnly": "safe-publish-latest && npm run build",
"prepublish": "not-in-publish || npm run prepublishOnly"
},
"repository": {
"type": "git",
"url": "git://github.com/ljharb/object.assign.git"
},
"keywords": [
"Object.assign",
"assign",
"ES6",
"extend",
"$.extend",
"jQuery",
"_.extend",
"Underscore",
"es-shim API",
"polyfill",
"shim"
],
"dependencies": {
"call-bind": "^1.0.8",
"call-bound": "^1.0.3",
"define-properties": "^1.2.1",
"es-object-atoms": "^1.0.0",
"has-symbols": "^1.1.0",
"object-keys": "^1.1.1"
},
"devDependencies": {
"@es-shims/api": "^2.5.1",
"@ljharb/eslint-config": "^21.1.1",
"browserify": "^16.5.2",
"eslint": "=8.8.0",
"for-each": "^0.3.3",
"functions-have-names": "^1.2.3",
"has-strict-mode": "^1.0.1",
"hasown": "^2.0.2",
"mock-property": "^1.1.0",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"ses": "^1.10.0",
"tape": "^5.9.0"
},
"testling": {
"files": "test/index.js",
"browsers": [
"iexplore/6.0..latest",
"firefox/3.0..6.0",
"firefox/15.0..latest",
"firefox/nightly",
"chrome/4.0..10.0",
"chrome/20.0..latest",
"chrome/canary",
"opera/10.0..latest",
"opera/next",
"safari/4.0..latest",
"ipad/6.0..latest",
"iphone/6.0..latest",
"android-browser/4.2"
]
},
"engines": {
"node": ">= 0.4"
},
"publishConfig": {
"ignore": [
".github/workflows",
"bower.json",
"browserShim.js",
"!dist/"
]
}
}

55
backend/node_modules/object.assign/polyfill.js generated vendored Executable file
View File

@@ -0,0 +1,55 @@
'use strict';
var implementation = require('./implementation');
var lacksProperEnumerationOrder = function () {
if (!Object.assign) {
return false;
}
/*
* v8, specifically in node 4.x, has a bug with incorrect property enumeration order
* note: this does not detect the bug unless there's 20 characters
*/
var str = 'abcdefghijklmnopqrst';
var letters = str.split('');
var map = {};
for (var i = 0; i < letters.length; ++i) {
map[letters[i]] = letters[i];
}
var obj = Object.assign({}, map);
var actual = '';
for (var k in obj) {
actual += k;
}
return str !== actual;
};
var assignHasPendingExceptions = function () {
if (!Object.assign || !Object.preventExtensions) {
return false;
}
/*
* Firefox 37 still has "pending exception" logic in its Object.assign implementation,
* which is 72% slower than our shim, and Firefox 40's native implementation.
*/
var thrower = Object.preventExtensions({ 1: 2 });
try {
Object.assign(thrower, 'xy');
} catch (e) {
return thrower[1] === 'y';
}
return false;
};
module.exports = function getPolyfill() {
if (!Object.assign) {
return implementation;
}
if (lacksProperEnumerationOrder()) {
return implementation;
}
if (assignHasPendingExceptions()) {
return implementation;
}
return Object.assign;
};

14
backend/node_modules/object.assign/shim.js generated vendored Executable file
View File

@@ -0,0 +1,14 @@
'use strict';
var define = require('define-properties');
var getPolyfill = require('./polyfill');
module.exports = function shimAssign() {
var polyfill = getPolyfill();
define(
Object,
{ assign: polyfill },
{ assign: function () { return Object.assign !== polyfill; } }
);
return polyfill;
};

19
backend/node_modules/object.assign/test/implementation.js generated vendored Executable file
View File

@@ -0,0 +1,19 @@
'use strict';
var implementation = require('../implementation');
var callBind = require('call-bind');
var test = require('tape');
var hasStrictMode = require('has-strict-mode')();
var runTests = require('./tests');
test('as a function', function (t) {
t.test('bad first arg/receiver', { skip: !hasStrictMode }, function (st) {
st['throws'](function () { implementation(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { implementation(null); }, TypeError, 'null is not an object');
st.end();
});
runTests(callBind(implementation, Object), t);
t.end();
});

17
backend/node_modules/object.assign/test/index.js generated vendored Executable file
View File

@@ -0,0 +1,17 @@
'use strict';
var assign = require('../');
var test = require('tape');
var runTests = require('./tests');
test('as a function', function (t) {
t.test('bad array/this value', function (st) {
st['throws'](function () { assign(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { assign(null); }, TypeError, 'null is not an object');
st.end();
});
runTests(assign, t);
t.end();
});

49
backend/node_modules/object.assign/test/native.js generated vendored Executable file
View File

@@ -0,0 +1,49 @@
'use strict';
var test = require('tape');
var defineProperties = require('define-properties');
var isEnumerable = Object.prototype.propertyIsEnumerable;
var functionsHaveNames = require('functions-have-names')();
var runTests = require('./tests');
test('native', function (t) {
t.equal(Object.assign.length, 2, 'Object.assign has a length of 2');
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(Object.assign.name, 'assign', 'Object.assign has name "assign"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(Object, 'assign'), 'Object.assign is not enumerable');
et.end();
});
var supportsStrictMode = (function () { return typeof this === 'undefined'; }());
t.test('bad object value', { skip: !supportsStrictMode }, function (st) {
st['throws'](function () { return Object.assign(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { return Object.assign(null); }, TypeError, 'null is not an object');
st.end();
});
// v8 in node 0.8 and 0.10 have non-enumerable string properties
var stringCharsAreEnumerable = isEnumerable.call('xy', 0);
t.test('when Object.assign is present and has pending exceptions', { skip: !stringCharsAreEnumerable || !Object.preventExtensions }, function (st) {
/*
* Firefox 37 still has "pending exception" logic in its Object.assign implementation,
* which is 72% slower than our shim, and Firefox 40's native implementation.
*/
var thrower = Object.preventExtensions({ 1: '2' });
var error;
try { Object.assign(thrower, 'xy'); } catch (e) { error = e; }
st.equal(error instanceof TypeError, true, 'error is TypeError');
st.equal(thrower[1], '2', 'thrower[1] === "2"');
st.end();
});
runTests(Object.assign, t);
t.end();
});

12
backend/node_modules/object.assign/test/ses-compat.js generated vendored Executable file
View File

@@ -0,0 +1,12 @@
'use strict';
/* globals lockdown */
// requiring ses exposes "lockdown" on the global
require('ses');
// lockdown freezes the primordials
lockdown({ errorTaming: 'unsafe' });
// initialize the module
require('./');

52
backend/node_modules/object.assign/test/shimmed.js generated vendored Executable file
View File

@@ -0,0 +1,52 @@
'use strict';
var assign = require('../');
assign.shim();
var test = require('tape');
var defineProperties = require('define-properties');
var isEnumerable = Object.prototype.propertyIsEnumerable;
var functionsHaveNames = require('functions-have-names')();
var runTests = require('./tests');
test('shimmed', function (t) {
t.equal(Object.assign.length, 2, 'Object.assign has a length of 2');
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(Object.assign.name, 'assign', 'Object.assign has name "assign"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(Object, 'assign'), 'Object.assign is not enumerable');
et.end();
});
var supportsStrictMode = (function () { return typeof this === 'undefined'; }());
t.test('bad object value', { skip: !supportsStrictMode }, function (st) {
st['throws'](function () { return Object.assign(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { return Object.assign(null); }, TypeError, 'null is not an object');
st.end();
});
// v8 in node 0.8 and 0.10 have non-enumerable string properties
var stringCharsAreEnumerable = isEnumerable.call('xy', 0);
t.test('when Object.assign is present and has pending exceptions', { skip: !stringCharsAreEnumerable || !Object.preventExtensions }, function (st) {
/*
* Firefox 37 still has "pending exception" logic in its Object.assign implementation,
* which is 72% slower than our shim, and Firefox 40's native implementation.
*/
var thrower = Object.preventExtensions({ 1: '2' });
var error;
try { Object.assign(thrower, 'xy'); } catch (e) { error = e; }
st.equal(error instanceof TypeError, true, 'error is TypeError');
st.equal(thrower[1], '2', 'thrower[1] === "2"');
st.end();
});
runTests(Object.assign, t);
t.end();
});

232
backend/node_modules/object.assign/test/tests.js generated vendored Executable file
View File

@@ -0,0 +1,232 @@
'use strict';
var hasSymbols = require('has-symbols/shams')();
var forEach = require('for-each');
var hasOwn = require('hasown');
var mockProperty = require('mock-property');
module.exports = function (assign, t) {
t.test('error cases', function (st) {
st['throws'](function () { assign(null); }, TypeError, 'target must be an object');
st['throws'](function () { assign(undefined); }, TypeError, 'target must be an object');
st['throws'](function () { assign(null, {}); }, TypeError, 'target must be an object');
st['throws'](function () { assign(undefined, {}); }, TypeError, 'target must be an object');
st.end();
});
t.test('non-object target, no sources', function (st) {
var bool = assign(true);
st.equal(typeof bool, 'object', 'bool is object');
st.equal(Boolean.prototype.valueOf.call(bool), true, 'bool coerces to `true`');
var number = assign(1);
st.equal(typeof number, 'object', 'number is object');
st.equal(Number.prototype.valueOf.call(number), 1, 'number coerces to `1`');
var string = assign('1');
st.equal(typeof string, 'object', 'number is object');
st.equal(String.prototype.valueOf.call(string), '1', 'number coerces to `"1"`');
st.end();
});
t.test('non-object target, with sources', function (st) {
var signal = {};
st.test('boolean', function (st2) {
var bool = assign(true, { a: signal });
st2.equal(typeof bool, 'object', 'bool is object');
st2.equal(Boolean.prototype.valueOf.call(bool), true, 'bool coerces to `true`');
st2.equal(bool.a, signal, 'source properties copied');
st2.end();
});
st.test('number', function (st2) {
var number = assign(1, { a: signal });
st2.equal(typeof number, 'object', 'number is object');
st2.equal(Number.prototype.valueOf.call(number), 1, 'number coerces to `1`');
st2.equal(number.a, signal, 'source properties copied');
st2.end();
});
st.test('string', function (st2) {
var string = assign('1', { a: signal });
st2.equal(typeof string, 'object', 'number is object');
st2.equal(String.prototype.valueOf.call(string), '1', 'number coerces to `"1"`');
st2.equal(string.a, signal, 'source properties copied');
st2.end();
});
st.end();
});
t.test('non-object sources', function (st) {
st.deepEqual(assign({ a: 1 }, null, { b: 2 }), { a: 1, b: 2 }, 'ignores null source');
st.deepEqual(assign({ a: 1 }, { b: 2 }, undefined), { a: 1, b: 2 }, 'ignores undefined source');
st.end();
});
t.test('returns the modified target object', function (st) {
var target = {};
var returned = assign(target, { a: 1 });
st.equal(returned, target, 'returned object is the same reference as the target object');
st.end();
});
t.test('has the right length', function (st) {
st.equal(assign.length, 2, 'length is 2 => 2 required arguments');
st.end();
});
t.test('merge two objects', function (st) {
var target = { a: 1 };
var returned = assign(target, { b: 2 });
st.deepEqual(returned, { a: 1, b: 2 }, 'returned object has properties from both');
st.end();
});
t.test('works with functions', function (st) {
var target = function () {};
target.a = 1;
var returned = assign(target, { b: 2 });
st.equal(target, returned, 'returned object is target');
st.equal(returned.a, 1);
st.equal(returned.b, 2);
st.end();
});
t.test('works with primitives', function (st) {
var target = 2;
var source = { b: 42 };
var returned = assign(target, source);
st.equal(Object.prototype.toString.call(returned), '[object Number]', 'returned is object form of number primitive');
st.equal(Number(returned), target, 'returned and target have same valueOf');
st.equal(returned.b, source.b);
st.end();
});
/* globals window */
t.test('works with window.location', { skip: typeof window === 'undefined' }, function (st) {
var target = {};
assign(target, window.location);
for (var prop in window.location) {
if (hasOwn(window.location, prop)) {
st.deepEqual(target[prop], window.location[prop], prop + ' is copied');
}
}
st.end();
});
t.test('merge N objects', function (st) {
var target = { a: 1 };
var source1 = { b: 2 };
var source2 = { c: 3 };
var returned = assign(target, source1, source2);
st.deepEqual(returned, { a: 1, b: 2, c: 3 }, 'returned object has properties from all sources');
st.end();
});
t.test('only iterates over own keys', function (st) {
var Foo = function () {};
Foo.prototype.bar = true;
var foo = new Foo();
foo.baz = true;
var target = { a: 1 };
var returned = assign(target, foo);
st.equal(returned, target, 'returned object is the same reference as the target object');
st.deepEqual(target, { a: 1, baz: true }, 'returned object has only own properties from both');
st.end();
});
t.test('includes enumerable symbols, after keys', { skip: !hasSymbols }, function (st) {
var visited = [];
var obj = {};
Object.defineProperty(obj, 'a', { enumerable: true, get: function () { visited.push('a'); return 42; } });
var symbol = Symbol('enumerable');
Object.defineProperty(obj, symbol, {
enumerable: true,
get: function () { visited.push(symbol); return Infinity; }
});
var nonEnumSymbol = Symbol('non-enumerable');
Object.defineProperty(obj, nonEnumSymbol, {
enumerable: false,
get: function () { visited.push(nonEnumSymbol); return -Infinity; }
});
var target = assign({}, obj);
st.deepEqual(visited, ['a', symbol], 'key is visited first, then symbol');
st.equal(target.a, 42, 'target.a is 42');
st.equal(target[symbol], Infinity, 'target[symbol] is Infinity');
st.notEqual(target[nonEnumSymbol], -Infinity, 'target[nonEnumSymbol] is not -Infinity');
st.end();
});
t.test('does not fail when symbols are not present', { skip: !Object.isFrozen || Object.isFrozen(Object) }, function (st) {
st.teardown(mockProperty(Object, 'getOwnPropertySymbols', { 'delete': true }));
var visited = [];
var obj = {};
Object.defineProperty(obj, 'a', { enumerable: true, get: function () { visited.push('a'); return 42; } });
var keys = ['a'];
if (hasSymbols) {
var symbol = Symbol('sym');
Object.defineProperty(obj, symbol, {
enumerable: true,
get: function () { visited.push(symbol); return Infinity; }
});
keys.push(symbol);
}
var target = assign({}, obj);
st.deepEqual(visited, keys, 'assign visits expected keys');
st.equal(target.a, 42, 'target.a is 42');
if (hasSymbols) {
st.equal(target[symbol], Infinity);
}
st.end();
});
t.test('preserves correct property enumeration order', function (st) {
var str = 'abcdefghijklmnopqrst';
var letters = {};
forEach(str.split(''), function (letter) {
letters[letter] = letter;
});
var n = 5;
st.comment('run the next test ' + n + ' times');
var object = assign({}, letters);
var actual = '';
for (var k in object) {
actual += k;
}
for (var i = 0; i < n; ++i) {
st.equal(actual, str, 'property enumeration order should be followed');
}
st.end();
});
t.test('checks enumerability and existence, in case of modification during [[Get]]', { skip: !Object.defineProperty }, function (st) {
var targetBvalue = {};
var targetCvalue = {};
var target = { b: targetBvalue, c: targetCvalue };
var source = {};
Object.defineProperty(source, 'a', {
enumerable: true,
get: function () {
delete this.b;
Object.defineProperty(this, 'c', { enumerable: false });
return 'a';
}
});
var sourceBvalue = {};
var sourceCvalue = {};
source.b = sourceBvalue;
source.c = sourceCvalue;
var result = assign(target, source);
st.equal(result, target, 'sanity check: result is === target');
st.equal(result.b, targetBvalue, 'target key not overwritten by deleted source key');
st.equal(result.c, targetCvalue, 'target key not overwritten by non-enumerable source key');
st.end();
});
};