summaryrefslogtreecommitdiff
path: root/src/node_modules/object.assign
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2021-12-21 16:52:28 +0100
committerMinteck <contact@minteck.org>2021-12-21 16:52:28 +0100
commit46e43f4bde4a35785b4997b81e86cd19f046b69b (patch)
treec53c2f826f777f9d6b2d249dab556feb72a6c3a6 /src/node_modules/object.assign
downloadlangdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.tar.gz
langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.tar.bz2
langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.zip
Commit
Diffstat (limited to 'src/node_modules/object.assign')
-rw-r--r--src/node_modules/object.assign/.editorconfig20
-rw-r--r--src/node_modules/object.assign/.eslintignore1
-rw-r--r--src/node_modules/object.assign/.eslintrc26
-rw-r--r--src/node_modules/object.assign/.github/FUNDING.yml12
-rw-r--r--src/node_modules/object.assign/.github/workflows/rebase.yml15
-rw-r--r--src/node_modules/object.assign/.github/workflows/require-allow-edits.yml14
-rw-r--r--src/node_modules/object.assign/.nycrc14
-rw-r--r--src/node_modules/object.assign/CHANGELOG.md201
-rw-r--r--src/node_modules/object.assign/LICENSE21
-rw-r--r--src/node_modules/object.assign/README.md135
-rw-r--r--src/node_modules/object.assign/auto.js3
-rw-r--r--src/node_modules/object.assign/dist/browser.js865
-rw-r--r--src/node_modules/object.assign/hasSymbols.js43
-rw-r--r--src/node_modules/object.assign/implementation.js42
-rw-r--r--src/node_modules/object.assign/index.js22
-rw-r--r--src/node_modules/object.assign/package.json83
-rw-r--r--src/node_modules/object.assign/polyfill.js55
-rw-r--r--src/node_modules/object.assign/shim.js14
-rw-r--r--src/node_modules/object.assign/test/index.js17
-rw-r--r--src/node_modules/object.assign/test/native.js49
-rw-r--r--src/node_modules/object.assign/test/ses-compat.js12
-rw-r--r--src/node_modules/object.assign/test/shimmed.js52
-rw-r--r--src/node_modules/object.assign/test/tests.js237
23 files changed, 1953 insertions, 0 deletions
diff --git a/src/node_modules/object.assign/.editorconfig b/src/node_modules/object.assign/.editorconfig
new file mode 100644
index 0000000..bc228f8
--- /dev/null
+++ b/src/node_modules/object.assign/.editorconfig
@@ -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
diff --git a/src/node_modules/object.assign/.eslintignore b/src/node_modules/object.assign/.eslintignore
new file mode 100644
index 0000000..849ddff
--- /dev/null
+++ b/src/node_modules/object.assign/.eslintignore
@@ -0,0 +1 @@
+dist/
diff --git a/src/node_modules/object.assign/.eslintrc b/src/node_modules/object.assign/.eslintrc
new file mode 100644
index 0000000..6d4cafd
--- /dev/null
+++ b/src/node_modules/object.assign/.eslintrc
@@ -0,0 +1,26 @@
+{
+ "root": true,
+
+ "extends": "@ljharb",
+
+ "rules": {
+ "complexity": [2, 19],
+ "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,
+ },
+ },
+ ],
+}
diff --git a/src/node_modules/object.assign/.github/FUNDING.yml b/src/node_modules/object.assign/.github/FUNDING.yml
new file mode 100644
index 0000000..ef7fdbf
--- /dev/null
+++ b/src/node_modules/object.assign/.github/FUNDING.yml
@@ -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']
diff --git a/src/node_modules/object.assign/.github/workflows/rebase.yml b/src/node_modules/object.assign/.github/workflows/rebase.yml
new file mode 100644
index 0000000..0c2ad39
--- /dev/null
+++ b/src/node_modules/object.assign/.github/workflows/rebase.yml
@@ -0,0 +1,15 @@
+name: Automatic Rebase
+
+on: [pull_request_target]
+
+jobs:
+ _:
+ name: "Automatic Rebase"
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v1
+ - uses: ljharb/rebase@master
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/src/node_modules/object.assign/.github/workflows/require-allow-edits.yml b/src/node_modules/object.assign/.github/workflows/require-allow-edits.yml
new file mode 100644
index 0000000..aac42d3
--- /dev/null
+++ b/src/node_modules/object.assign/.github/workflows/require-allow-edits.yml
@@ -0,0 +1,14 @@
+name: Require “Allow Edits”
+
+on: [pull_request_target]
+
+jobs:
+ _:
+ name: "Require “Allow Edits”"
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: ljharb/require-allow-edits@main
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/src/node_modules/object.assign/.nycrc b/src/node_modules/object.assign/.nycrc
new file mode 100644
index 0000000..d316b4d
--- /dev/null
+++ b/src/node_modules/object.assign/.nycrc
@@ -0,0 +1,14 @@
+{
+ "all": true,
+ "check-coverage": false,
+ "reporter": ["text-summary", "text", "html", "json"],
+ "lines": 86,
+ "statements": 85.93,
+ "functions": 82.43,
+ "branches": 76.06,
+ "exclude": [
+ "coverage",
+ "operations",
+ "test"
+ ]
+}
diff --git a/src/node_modules/object.assign/CHANGELOG.md b/src/node_modules/object.assign/CHANGELOG.md
new file mode 100644
index 0000000..ac543d5
--- /dev/null
+++ b/src/node_modules/object.assign/CHANGELOG.md
@@ -0,0 +1,201 @@
+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
+==================
+ * Don’t 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 it’s available."
+
+0.4.0 / 2014-07-19
+==================
+ * Use the native Object.keys if it’s 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 don’t 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 don’t have "reduce"
+
+0.1.1 / 2014-03-14
+==================
+ * Updating readme
+
+0.1.0 / 2014-03-14
+==================
+ * Initial release.
+
diff --git a/src/node_modules/object.assign/LICENSE b/src/node_modules/object.assign/LICENSE
new file mode 100644
index 0000000..ab29cbd
--- /dev/null
+++ b/src/node_modules/object.assign/LICENSE
@@ -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. \ No newline at end of file
diff --git a/src/node_modules/object.assign/README.md b/src/node_modules/object.assign/README.md
new file mode 100644
index 0000000..70b6ac4
--- /dev/null
+++ b/src/node_modules/object.assign/README.md
@@ -0,0 +1,135 @@
+#object.assign <sup>[![Version Badge][npm-version-svg]][npm-url]</sup>
+
+[![Build Status][travis-svg]][travis-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]
+
+[![browser support][testling-png]][testling-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
+[testling-png]: https://ci.testling.com/ljharb/object.assign.png
+[testling-url]: https://ci.testling.com/ljharb/object.assign
+[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
diff --git a/src/node_modules/object.assign/auto.js b/src/node_modules/object.assign/auto.js
new file mode 100644
index 0000000..8ebf606
--- /dev/null
+++ b/src/node_modules/object.assign/auto.js
@@ -0,0 +1,3 @@
+'use strict';
+
+require('./shim')();
diff --git a/src/node_modules/object.assign/dist/browser.js b/src/node_modules/object.assign/dist/browser.js
new file mode 100644
index 0000000..15f0e20
--- /dev/null
+++ b/src/node_modules/object.assign/dist/browser.js
@@ -0,0 +1,865 @@
+(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
+'use strict';
+
+var keys = require('object-keys').shim();
+delete keys.shim;
+
+var assign = require('./');
+
+module.exports = assign.shim();
+
+delete assign.shim;
+
+},{"./":3,"object-keys":14}],2:[function(require,module,exports){
+'use strict';
+
+// modified from https://github.com/es-shims/es6-shim
+var keys = require('object-keys');
+var canBeObject = function (obj) {
+ return typeof obj !== 'undefined' && obj !== null;
+};
+var hasSymbols = require('has-symbols/shams')();
+var callBound = require('call-bind/callBound');
+var toObject = Object;
+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 (!canBeObject(target)) { throw new TypeError('target must be an object'); }
+ var objTarget = toObject(target);
+ var s, source, i, props, syms, value, key;
+ for (s = 1; s < arguments.length; ++s) {
+ source = toObject(arguments[s]);
+ props = keys(source);
+ var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);
+ if (getSymbols) {
+ syms = getSymbols(source);
+ for (i = 0; i < syms.length; ++i) {
+ key = syms[i];
+ if ($propIsEnumerable(source, key)) {
+ $push(props, key);
+ }
+ }
+ }
+ for (i = 0; i < props.length; ++i) {
+ key = props[i];
+ value = source[key];
+ if ($propIsEnumerable(source, key)) {
+ objTarget[key] = value;
+ }
+ }
+ }
+ return objTarget;
+};
+
+},{"call-bind/callBound":4,"has-symbols/shams":11,"object-keys":14}],3:[function(require,module,exports){
+'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;
+
+},{"./implementation":2,"./polyfill":16,"./shim":17,"call-bind":5,"define-properties":6}],4:[function(require,module,exports){
+'use strict';
+
+var GetIntrinsic = require('get-intrinsic');
+
+var callBind = require('./');
+
+var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
+
+module.exports = function callBoundIntrinsic(name, allowMissing) {
+ var intrinsic = GetIntrinsic(name, !!allowMissing);
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
+ return callBind(intrinsic);
+ }
+ return intrinsic;
+};
+
+},{"./":5,"get-intrinsic":9}],5:[function(require,module,exports){
+'use strict';
+
+var bind = require('function-bind');
+var GetIntrinsic = require('get-intrinsic');
+
+var $apply = GetIntrinsic('%Function.prototype.apply%');
+var $call = GetIntrinsic('%Function.prototype.call%');
+var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
+
+var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
+
+if ($defineProperty) {
+ try {
+ $defineProperty({}, 'a', { value: 1 });
+ } catch (e) {
+ // IE 8 has a broken defineProperty
+ $defineProperty = null;
+ }
+}
+
+module.exports = function callBind() {
+ return $reflectApply(bind, $call, arguments);
+};
+
+var applyBind = function applyBind() {
+ return $reflectApply(bind, $apply, arguments);
+};
+
+if ($defineProperty) {
+ $defineProperty(module.exports, 'apply', { value: applyBind });
+} else {
+ module.exports.apply = applyBind;
+}
+
+},{"function-bind":8,"get-intrinsic":9}],6:[function(require,module,exports){
+'use strict';
+
+var keys = require('object-keys');
+var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
+
+var toStr = Object.prototype.toString;
+var concat = Array.prototype.concat;
+var origDefineProperty = Object.defineProperty;
+
+var isFunction = function (fn) {
+ return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
+};
+
+var arePropertyDescriptorsSupported = function () {
+ var obj = {};
+ try {
+ origDefineProperty(obj, 'x', { enumerable: false, value: obj });
+ // eslint-disable-next-line no-unused-vars, no-restricted-syntax
+ for (var _ in obj) { // jscs:ignore disallowUnusedVariables
+ return false;
+ }
+ return obj.x === obj;
+ } catch (e) { /* this is IE 8. */
+ return false;
+ }
+};
+var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
+
+var defineProperty = function (object, name, value, predicate) {
+ if (name in object && (!isFunction(predicate) || !predicate())) {
+ return;
+ }
+ if (supportsDescriptors) {
+ origDefineProperty(object, name, {
+ configurable: true,
+ enumerable: false,
+ value: value,
+ writable: true
+ });
+ } else {
+ object[name] = value;
+ }
+};
+
+var defineProperties = function (object, map) {
+ var predicates = arguments.length > 2 ? arguments[2] : {};
+ var props = keys(map);
+ if (hasSymbols) {
+ props = concat.call(props, Object.getOwnPropertySymbols(map));
+ }
+ for (var i = 0; i < props.length; i += 1) {
+ defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
+ }
+};
+
+defineProperties.supportsDescriptors = !!supportsDescriptors;
+
+module.exports = defineProperties;
+
+},{"object-keys":14}],7:[function(require,module,exports){
+'use strict';
+
+/* eslint no-invalid-this: 1 */
+
+var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
+var slice = Array.prototype.slice;
+var toStr = Object.prototype.toString;
+var funcType = '[object Function]';
+
+module.exports = function bind(that) {
+ var target = this;
+ if (typeof target !== 'function' || toStr.call(target) !== funcType) {
+ throw new TypeError(ERROR_MESSAGE + target);
+ }
+ var args = slice.call(arguments, 1);
+
+ var bound;
+ var binder = function () {
+ if (this instanceof bound) {
+ var result = target.apply(
+ this,
+ args.concat(slice.call(arguments))
+ );
+ if (Object(result) === result) {
+ return result;
+ }
+ return this;
+ } else {
+ return target.apply(
+ that,
+ args.concat(slice.call(arguments))
+ );
+ }
+ };
+
+ var boundLength = Math.max(0, target.length - args.length);
+ var boundArgs = [];
+ for (var i = 0; i < boundLength; i++) {
+ boundArgs.push('$' + i);
+ }
+
+ bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
+
+ if (target.prototype) {
+ var Empty = function Empty() {};
+ Empty.prototype = target.prototype;
+ bound.prototype = new Empty();
+ Empty.prototype = null;
+ }
+
+ return bound;
+};
+
+},{}],8:[function(require,module,exports){
+'use strict';
+
+var implementation = require('./implementation');
+
+module.exports = Function.prototype.bind || implementation;
+
+},{"./implementation":7}],9:[function(require,module,exports){
+'use strict';
+
+/* globals
+ AggregateError,
+ Atomics,
+ FinalizationRegistry,
+ SharedArrayBuffer,
+ WeakRef,
+*/
+
+var undefined;
+
+var $SyntaxError = SyntaxError;
+var $Function = Function;
+var $TypeError = TypeError;
+
+// eslint-disable-next-line consistent-return
+var getEvalledConstructor = function (expressionSyntax) {
+ try {
+ // eslint-disable-next-line no-new-func
+ return Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
+ } catch (e) {}
+};
+
+var $gOPD = Object.getOwnPropertyDescriptor;
+if ($gOPD) {
+ try {
+ $gOPD({}, '');
+ } catch (e) {
+ $gOPD = null; // this is IE 8, which has a broken gOPD
+ }
+}
+
+var throwTypeError = function () {
+ throw new $TypeError();
+};
+var ThrowTypeError = $gOPD
+ ? (function () {
+ try {
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
+ arguments.callee; // IE 8 does not throw here
+ return throwTypeError;
+ } catch (calleeThrows) {
+ try {
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
+ return $gOPD(arguments, 'callee').get;
+ } catch (gOPDthrows) {
+ return throwTypeError;
+ }
+ }
+ }())
+ : throwTypeError;
+
+var hasSymbols = require('has-symbols')();
+
+var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
+
+var asyncGenFunction = getEvalledConstructor('async function* () {}');
+var asyncGenFunctionPrototype = asyncGenFunction ? asyncGenFunction.prototype : undefined;
+var asyncGenPrototype = asyncGenFunctionPrototype ? asyncGenFunctionPrototype.prototype : undefined;
+
+var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
+
+var INTRINSICS = {
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
+ '%Array%': Array,
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
+ '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
+ '%AsyncFromSyncIteratorPrototype%': undefined,
+ '%AsyncFunction%': getEvalledConstructor('async function () {}'),
+ '%AsyncGenerator%': asyncGenFunctionPrototype,
+ '%AsyncGeneratorFunction%': asyncGenFunction,
+ '%AsyncIteratorPrototype%': asyncGenPrototype ? getProto(asyncGenPrototype) : undefined,
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
+ '%Boolean%': Boolean,
+ '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
+ '%Date%': Date,
+ '%decodeURI%': decodeURI,
+ '%decodeURIComponent%': decodeURIComponent,
+ '%encodeURI%': encodeURI,
+ '%encodeURIComponent%': encodeURIComponent,
+ '%Error%': Error,
+ '%eval%': eval, // eslint-disable-line no-eval
+ '%EvalError%': EvalError,
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
+ '%Function%': $Function,
+ '%GeneratorFunction%': getEvalledConstructor('function* () {}'),
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
+ '%isFinite%': isFinite,
+ '%isNaN%': isNaN,
+ '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined,
+ '%Map%': typeof Map === 'undefined' ? undefined : Map,
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
+ '%Math%': Math,
+ '%Number%': Number,
+ '%Object%': Object,
+ '%parseFloat%': parseFloat,
+ '%parseInt%': parseInt,
+ '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
+ '%RangeError%': RangeError,
+ '%ReferenceError%': ReferenceError,
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
+ '%RegExp%': RegExp,
+ '%Set%': typeof Set === 'undefined' ? undefined : Set,
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
+ '%String%': String,
+ '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
+ '%Symbol%': hasSymbols ? Symbol : undefined,
+ '%SyntaxError%': $SyntaxError,
+ '%ThrowTypeError%': ThrowTypeError,
+ '%TypedArray%': TypedArray,
+ '%TypeError%': $TypeError,
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
+ '%URIError%': URIError,
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
+};
+
+var LEGACY_ALIASES = {
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
+ '%ArrayPrototype%': ['Array', 'prototype'],
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
+ '%DataViewPrototype%': ['DataView', 'prototype'],
+ '%DatePrototype%': ['Date', 'prototype'],
+ '%ErrorPrototype%': ['Error', 'prototype'],
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
+ '%FunctionPrototype%': ['Function', 'prototype'],
+ '%Generator%': ['GeneratorFunction', 'prototype'],
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
+ '%JSONParse%': ['JSON', 'parse'],
+ '%JSONStringify%': ['JSON', 'stringify'],
+ '%MapPrototype%': ['Map', 'prototype'],
+ '%NumberPrototype%': ['Number', 'prototype'],
+ '%ObjectPrototype%': ['Object', 'prototype'],
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
+ '%PromisePrototype%': ['Promise', 'prototype'],
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
+ '%Promise_all%': ['Promise', 'all'],
+ '%Promise_reject%': ['Promise', 'reject'],
+ '%Promise_resolve%': ['Promise', 'resolve'],
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
+ '%SetPrototype%': ['Set', 'prototype'],
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
+ '%StringPrototype%': ['String', 'prototype'],
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
+};
+
+var bind = require('function-bind');
+var hasOwn = require('has');
+var $concat = bind.call(Function.call, Array.prototype.concat);
+var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
+var $replace = bind.call(Function.call, String.prototype.replace);
+
+/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
+var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
+var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
+var stringToPath = function stringToPath(string) {
+ var result = [];
+ $replace(string, rePropName, function (match, number, quote, subString) {
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
+ });
+ return result;
+};
+/* end adaptation */
+
+var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
+ var intrinsicName = name;
+ var alias;
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
+ alias = LEGACY_ALIASES[intrinsicName];
+ intrinsicName = '%' + alias[0] + '%';
+ }
+
+ if (hasOwn(INTRINSICS, intrinsicName)) {
+ var value = INTRINSICS[intrinsicName];
+ if (typeof value === 'undefined' && !allowMissing) {
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
+ }
+
+ return {
+ alias: alias,
+ name: intrinsicName,
+ value: value
+ };
+ }
+
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
+};
+
+module.exports = function GetIntrinsic(name, allowMissing) {
+ if (typeof name !== 'string' || name.length === 0) {
+ throw new $TypeError('intrinsic name must be a non-empty string');
+ }
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
+ throw new $TypeError('"allowMissing" argument must be a boolean');
+ }
+
+ var parts = stringToPath(name);
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
+
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
+ var intrinsicRealName = intrinsic.name;
+ var value = intrinsic.value;
+ var skipFurtherCaching = false;
+
+ var alias = intrinsic.alias;
+ if (alias) {
+ intrinsicBaseName = alias[0];
+ $spliceApply(parts, $concat([0, 1], alias));
+ }
+
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
+ var part = parts[i];
+ if (part === 'constructor' || !isOwn) {
+ skipFurtherCaching = true;
+ }
+
+ intrinsicBaseName += '.' + part;
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
+
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
+ value = INTRINSICS[intrinsicRealName];
+ } else if (value != null) {
+ if ($gOPD && (i + 1) >= parts.length) {
+ var desc = $gOPD(value, part);
+ isOwn = !!desc;
+
+ if (!allowMissing && !(part in value)) {
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
+ }
+ // By convention, when a data property is converted to an accessor
+ // property to emulate a data property that does not suffer from
+ // the override mistake, that accessor's getter is marked with
+ // an `originalValue` property. Here, when we detect this, we
+ // uphold the illusion by pretending to see that original data
+ // property, i.e., returning the value rather than the getter
+ // itself.
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
+ value = desc.get;
+ } else {
+ value = value[part];
+ }
+ } else {
+ isOwn = hasOwn(value, part);
+ value = value[part];
+ }
+
+ if (isOwn && !skipFurtherCaching) {
+ INTRINSICS[intrinsicRealName] = value;
+ }
+ }
+ }
+ return value;
+};
+
+},{"function-bind":8,"has":12,"has-symbols":10}],10:[function(require,module,exports){
+(function (global){(function (){
+'use strict';
+
+var origSymbol = global.Symbol;
+var hasSymbolSham = require('./shams');
+
+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();
+};
+
+}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+},{"./shams":11}],11:[function(require,module,exports){
+'use strict';
+
+/* 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; }
+
+ 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 (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
+ 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;
+};
+
+},{}],12:[function(require,module,exports){
+'use strict';
+
+var bind = require('function-bind');
+
+module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
+
+},{"function-bind":8}],13:[function(require,module,exports){
+'use strict';
+
+var keysShim;
+if (!Object.keys) {
+ // modified from https://github.com/es-shims/es5-shim
+ var has = Object.prototype.hasOwnProperty;
+ var toStr = Object.prototype.toString;
+ var isArgs = require('./isArguments'); // eslint-disable-line global-require
+ var isEnumerable = Object.prototype.propertyIsEnumerable;
+ var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
+ var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
+ var dontEnums = [
+ 'toString',
+ 'toLocaleString',
+ 'valueOf',
+ 'hasOwnProperty',
+ 'isPrototypeOf',
+ 'propertyIsEnumerable',
+ 'constructor'
+ ];
+ var equalsConstructorPrototype = function (o) {
+ var ctor = o.constructor;
+ return ctor && ctor.prototype === o;
+ };
+ var excludedKeys = {
+ $applicationCache: true,
+ $console: true,
+ $external: true,
+ $frame: true,
+ $frameElement: true,
+ $frames: true,
+ $innerHeight: true,
+ $innerWidth: true,
+ $onmozfullscreenchange: true,
+ $onmozfullscreenerror: true,
+ $outerHeight: true,
+ $outerWidth: true,
+ $pageXOffset: true,
+ $pageYOffset: true,
+ $parent: true,
+ $scrollLeft: true,
+ $scrollTop: true,
+ $scrollX: true,
+ $scrollY: true,
+ $self: true,
+ $webkitIndexedDB: true,
+ $webkitStorageInfo: true,
+ $window: true
+ };
+ var hasAutomationEqualityBug = (function () {
+ /* global window */
+ if (typeof window === 'undefined') { return false; }
+ for (var k in window) {
+ try {
+ if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
+ try {
+ equalsConstructorPrototype(window[k]);
+ } catch (e) {
+ return true;
+ }
+ }
+ } catch (e) {
+ return true;
+ }
+ }
+ return false;
+ }());
+ var equalsConstructorPrototypeIfNotBuggy = function (o) {
+ /* global window */
+ if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
+ return equalsConstructorPrototype(o);
+ }
+ try {
+ return equalsConstructorPrototype(o);
+ } catch (e) {
+ return false;
+ }
+ };
+
+ keysShim = function keys(object) {
+ var isObject = object !== null && typeof object === 'object';
+ var isFunction = toStr.call(object) === '[object Function]';
+ var isArguments = isArgs(object);
+ var isString = isObject && toStr.call(object) === '[object String]';
+ var theKeys = [];
+
+ if (!isObject && !isFunction && !isArguments) {
+ throw new TypeError('Object.keys called on a non-object');
+ }
+
+ var skipProto = hasProtoEnumBug && isFunction;
+ if (isString && object.length > 0 && !has.call(object, 0)) {
+ for (var i = 0; i < object.length; ++i) {
+ theKeys.push(String(i));
+ }
+ }
+
+ if (isArguments && object.length > 0) {
+ for (var j = 0; j < object.length; ++j) {
+ theKeys.push(String(j));
+ }
+ } else {
+ for (var name in object) {
+ if (!(skipProto && name === 'prototype') && has.call(object, name)) {
+ theKeys.push(String(name));
+ }
+ }
+ }
+
+ if (hasDontEnumBug) {
+ var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
+
+ for (var k = 0; k < dontEnums.length; ++k) {
+ if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
+ theKeys.push(dontEnums[k]);
+ }
+ }
+ }
+ return theKeys;
+ };
+}
+module.exports = keysShim;
+
+},{"./isArguments":15}],14:[function(require,module,exports){
+'use strict';
+
+var slice = Array.prototype.slice;
+var isArgs = require('./isArguments');
+
+var origKeys = Object.keys;
+var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');
+
+var originalKeys = Object.keys;
+
+keysShim.shim = function shimObjectKeys() {
+ if (Object.keys) {
+ var keysWorksWithArguments = (function () {
+ // Safari 5.0 bug
+ var args = Object.keys(arguments);
+ return args && args.length === arguments.length;
+ }(1, 2));
+ if (!keysWorksWithArguments) {
+ Object.keys = function keys(object) { // eslint-disable-line func-name-matching
+ if (isArgs(object)) {
+ return originalKeys(slice.call(object));
+ }
+ return originalKeys(object);
+ };
+ }
+ } else {
+ Object.keys = keysShim;
+ }
+ return Object.keys || keysShim;
+};
+
+module.exports = keysShim;
+
+},{"./implementation":13,"./isArguments":15}],15:[function(require,module,exports){
+'use strict';
+
+var toStr = Object.prototype.toString;
+
+module.exports = function isArguments(value) {
+ var str = toStr.call(value);
+ var isArgs = str === '[object Arguments]';
+ if (!isArgs) {
+ isArgs = str !== '[object Array]' &&
+ value !== null &&
+ typeof value === 'object' &&
+ typeof value.length === 'number' &&
+ value.length >= 0 &&
+ toStr.call(value.callee) === '[object Function]';
+ }
+ return isArgs;
+};
+
+},{}],16:[function(require,module,exports){
+'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;
+};
+
+},{"./implementation":2}],17:[function(require,module,exports){
+'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;
+};
+
+},{"./polyfill":16,"define-properties":6}]},{},[1]);
diff --git a/src/node_modules/object.assign/hasSymbols.js b/src/node_modules/object.assign/hasSymbols.js
new file mode 100644
index 0000000..34841e0
--- /dev/null
+++ b/src/node_modules/object.assign/hasSymbols.js
@@ -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;
+};
diff --git a/src/node_modules/object.assign/implementation.js b/src/node_modules/object.assign/implementation.js
new file mode 100644
index 0000000..567efe9
--- /dev/null
+++ b/src/node_modules/object.assign/implementation.js
@@ -0,0 +1,42 @@
+'use strict';
+
+// modified from https://github.com/es-shims/es6-shim
+var keys = require('object-keys');
+var canBeObject = function (obj) {
+ return typeof obj !== 'undefined' && obj !== null;
+};
+var hasSymbols = require('has-symbols/shams')();
+var callBound = require('call-bind/callBound');
+var toObject = Object;
+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 (!canBeObject(target)) { throw new TypeError('target must be an object'); }
+ var objTarget = toObject(target);
+ var s, source, i, props, syms, value, key;
+ for (s = 1; s < arguments.length; ++s) {
+ source = toObject(arguments[s]);
+ props = keys(source);
+ var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);
+ if (getSymbols) {
+ syms = getSymbols(source);
+ for (i = 0; i < syms.length; ++i) {
+ key = syms[i];
+ if ($propIsEnumerable(source, key)) {
+ $push(props, key);
+ }
+ }
+ }
+ for (i = 0; i < props.length; ++i) {
+ key = props[i];
+ value = source[key];
+ if ($propIsEnumerable(source, key)) {
+ objTarget[key] = value;
+ }
+ }
+ }
+ return objTarget;
+};
diff --git a/src/node_modules/object.assign/index.js b/src/node_modules/object.assign/index.js
new file mode 100644
index 0000000..9b50603
--- /dev/null
+++ b/src/node_modules/object.assign/index.js
@@ -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;
diff --git a/src/node_modules/object.assign/package.json b/src/node_modules/object.assign/package.json
new file mode 100644
index 0000000..25247a8
--- /dev/null
+++ b/src/node_modules/object.assign/package.json
@@ -0,0 +1,83 @@
+{
+ "name": "object.assign",
+ "version": "4.1.2",
+ "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": {
+ "pretest": "npm run lint && es-shim-api --bound",
+ "test": "npm run tests-only && npm run test:ses",
+ "posttest": "aud --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",
+ "prepublish": "safe-publish-latest && npm run build"
+ },
+ "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.0",
+ "define-properties": "^1.1.3",
+ "has-symbols": "^1.0.1",
+ "object-keys": "^1.1.1"
+ },
+ "devDependencies": {
+ "@es-shims/api": "^2.1.2",
+ "@ljharb/eslint-config": "^17.2.0",
+ "aud": "^1.1.2",
+ "browserify": "^16.5.2",
+ "eslint": "^7.12.1",
+ "for-each": "^0.3.3",
+ "functions-have-names": "^1.2.1",
+ "has": "^1.0.3",
+ "is": "^3.3.0",
+ "nyc": "^10.3.2",
+ "safe-publish-latest": "^1.1.4",
+ "ses": "^0.10.4",
+ "tape": "^5.0.1"
+ },
+ "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"
+ }
+}
diff --git a/src/node_modules/object.assign/polyfill.js b/src/node_modules/object.assign/polyfill.js
new file mode 100644
index 0000000..ca94aea
--- /dev/null
+++ b/src/node_modules/object.assign/polyfill.js
@@ -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;
+};
diff --git a/src/node_modules/object.assign/shim.js b/src/node_modules/object.assign/shim.js
new file mode 100644
index 0000000..9f896ae
--- /dev/null
+++ b/src/node_modules/object.assign/shim.js
@@ -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;
+};
diff --git a/src/node_modules/object.assign/test/index.js b/src/node_modules/object.assign/test/index.js
new file mode 100644
index 0000000..776b2b3
--- /dev/null
+++ b/src/node_modules/object.assign/test/index.js
@@ -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();
+});
diff --git a/src/node_modules/object.assign/test/native.js b/src/node_modules/object.assign/test/native.js
new file mode 100644
index 0000000..49a70f7
--- /dev/null
+++ b/src/node_modules/object.assign/test/native.js
@@ -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();
+});
diff --git a/src/node_modules/object.assign/test/ses-compat.js b/src/node_modules/object.assign/test/ses-compat.js
new file mode 100644
index 0000000..9669eb9
--- /dev/null
+++ b/src/node_modules/object.assign/test/ses-compat.js
@@ -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('./');
diff --git a/src/node_modules/object.assign/test/shimmed.js b/src/node_modules/object.assign/test/shimmed.js
new file mode 100644
index 0000000..ee57758
--- /dev/null
+++ b/src/node_modules/object.assign/test/shimmed.js
@@ -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();
+});
diff --git a/src/node_modules/object.assign/test/tests.js b/src/node_modules/object.assign/test/tests.js
new file mode 100644
index 0000000..81b1326
--- /dev/null
+++ b/src/node_modules/object.assign/test/tests.js
@@ -0,0 +1,237 @@
+'use strict';
+
+var hasSymbols = require('has-symbols/shams')();
+var forEach = require('for-each');
+var has = require('has');
+
+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 (has(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) {
+ var getSyms;
+ if (hasSymbols) {
+ getSyms = Object.getOwnPropertySymbols;
+ delete Object.getOwnPropertySymbols;
+ }
+
+ 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);
+
+ Object.getOwnPropertySymbols = getSyms;
+ }
+ 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();
+ });
+};