aboutsummaryrefslogtreecommitdiff
path: root/node_modules/es5-ext
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/es5-ext')
-rw-r--r--node_modules/es5-ext/.lint43
-rw-r--r--node_modules/es5-ext/.lintignore9
-rw-r--r--node_modules/es5-ext/.npmignore15
-rw-r--r--node_modules/es5-ext/CHANGELOG.md100
-rw-r--r--node_modules/es5-ext/LICENSE30
-rw-r--r--node_modules/es5-ext/README.md285
-rw-r--r--node_modules/es5-ext/date/is-date.js5
-rw-r--r--node_modules/es5-ext/date/valid-date.js2
-rw-r--r--node_modules/es5-ext/function/#/index.js1
-rw-r--r--node_modules/es5-ext/index.js1
-rw-r--r--node_modules/es5-ext/math/index.js3
-rw-r--r--node_modules/es5-ext/object/assign-deep.js29
-rw-r--r--node_modules/es5-ext/object/ensure-natural-number-value.js9
-rw-r--r--node_modules/es5-ext/object/ensure-natural-number.js5
-rw-r--r--node_modules/es5-ext/object/ensure-promise.js2
-rw-r--r--node_modules/es5-ext/object/index.js8
-rw-r--r--node_modules/es5-ext/object/is-promise.js8
-rw-r--r--node_modules/es5-ext/object/keys/implement.js8
-rw-r--r--node_modules/es5-ext/object/keys/index.js4
-rw-r--r--node_modules/es5-ext/object/keys/is-implemented.js4
-rw-r--r--node_modules/es5-ext/object/keys/shim.js4
-rw-r--r--node_modules/es5-ext/package.json13
-rw-r--r--node_modules/es5-ext/safe-to-string.js2
-rw-r--r--node_modules/es5-ext/test/object/assign-deep.js12
-rw-r--r--node_modules/es5-ext/test/object/keys/implement.js4
-rw-r--r--node_modules/es5-ext/test/object/keys/is-implemented.js4
-rw-r--r--node_modules/es5-ext/test/object/keys/shim.js8
-rw-r--r--node_modules/es5-ext/test/reg-exp/#/match/shim.js4
-rw-r--r--node_modules/es5-ext/test/safe-to-string.js11
-rw-r--r--node_modules/es5-ext/test/string/format-method.js14
-rw-r--r--node_modules/es5-ext/test/to-short-string-representation.js11
31 files changed, 357 insertions, 301 deletions
diff --git a/node_modules/es5-ext/.lint b/node_modules/es5-ext/.lint
deleted file mode 100644
index ded0b5321..000000000
--- a/node_modules/es5-ext/.lint
+++ /dev/null
@@ -1,43 +0,0 @@
-@root
-
-module
-
-indent 2
-maxlen 100
-tabs
-
-ass
-continue
-forin
-nomen
-plusplus
-vars
-sub
-
-./global.js
-./function/_define-length.js
-./function/#/copy.js
-./object/unserialize.js
-./test/function/valid-function.js
-./test/function/#/to-string-tokens.js
-evil
-
-./math/_pack-ieee754.js
-./math/_unpack-ieee754.js
-./math/clz32/shim.js
-./math/imul/shim.js
-./number/to-uint32.js
-./string/#/at.js
-bitwise
-
-./math/fround/shim.js
-predef+ Float32Array
-
-./object/first-key.js
-forin
-
-./test
-predef+ Symbol
-
-./test/reg-exp/#/index.js
-predef+ __dirname
diff --git a/node_modules/es5-ext/.lintignore b/node_modules/es5-ext/.lintignore
deleted file mode 100644
index eece4ff3c..000000000
--- a/node_modules/es5-ext/.lintignore
+++ /dev/null
@@ -1,9 +0,0 @@
-/string/#/normalize/_data.js
-/test/boolean/is-boolean.js
-/test/date/is-date.js
-/test/number/is-number.js
-/test/object/is-copy.js
-/test/object/is-number-value.js
-/test/object/is-object.js
-/test/reg-exp/is-reg-exp.js
-/test/string/is-string.js
diff --git a/node_modules/es5-ext/.npmignore b/node_modules/es5-ext/.npmignore
deleted file mode 100644
index ee45d6a44..000000000
--- a/node_modules/es5-ext/.npmignore
+++ /dev/null
@@ -1,15 +0,0 @@
-.DS_Store
-Thumbs.db
-/.idea
-/.vscode
-npm-debug.log
-/wallaby.js
-.DS_Store
-/node_modules
-/.lintcache
-/npm-debug.log
-/.travis.yml
-/.gitignore
-/.circle.yml
-/.circleci
-/appveyor.yml
diff --git a/node_modules/es5-ext/CHANGELOG.md b/node_modules/es5-ext/CHANGELOG.md
index 15024e6b8..efc0767f6 100644
--- a/node_modules/es5-ext/CHANGELOG.md
+++ b/node_modules/es5-ext/CHANGELOG.md
@@ -2,6 +2,106 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+<a name="0.10.46"></a>
+## [0.10.46](https://github.com/medikoo/es5-ext/compare/v0.10.45...v0.10.46) (2018-08-13)
+
+
+### Bug Fixes
+
+* assign-deep to not modify following arguments ([bf43d57](https://github.com/medikoo/es5-ext/commit/bf43d57))
+
+
+
+<a name="0.10.45"></a>
+## [0.10.45](https://github.com/medikoo/es5-ext/compare/v0.10.44...v0.10.45) (2018-06-01)
+
+
+### Bug Fixes
+
+* improve error message readbility ([adc91b9](https://github.com/medikoo/es5-ext/commit/adc91b9))
+
+
+
+<a name="0.10.44"></a>
+## [0.10.44](https://github.com/medikoo/es5-ext/compare/v0.10.43...v0.10.44) (2018-05-30)
+
+
+### Features
+
+* add Object.entries ([51d2f43](https://github.com/medikoo/es5-ext/commit/51d2f43))
+
+
+
+<a name="0.10.43"></a>
+## [0.10.43](https://github.com/medikoo/es5-ext/compare/v0.10.42...v0.10.43) (2018-05-28)
+
+
+### Features
+
+* improve patch string ([6a25b10](https://github.com/medikoo/es5-ext/commit/6a25b10))
+
+
+
+<a name="0.10.42"></a>
+## [0.10.42](https://github.com/medikoo/es5-ext/compare/v0.10.41...v0.10.42) (2018-03-28)
+
+
+### Bug Fixes
+
+* Date.isDate to exclude NaN dates ([3b61bc6](https://github.com/medikoo/es5-ext/commit/3b61bc6))
+
+
+### Features
+
+* improve non-coercible string representation ([20bfb78](https://github.com/medikoo/es5-ext/commit/20bfb78))
+* improve non-stringifiable string representation ([2e4512d](https://github.com/medikoo/es5-ext/commit/2e4512d))
+
+
+
+<a name="0.10.41"></a>
+## [0.10.41](https://github.com/medikoo/es5-ext/compare/v0.10.40...v0.10.41) (2018-03-16)
+
+
+### Features
+
+* Add function.microtaskDelay method ([66481c0](https://github.com/medikoo/es5-ext/commit/66481c0))
+* Add Object.isThenable ([8d5a45c](https://github.com/medikoo/es5-ext/commit/8d5a45c))
+* Add promise.asCallback method ([dcc1451](https://github.com/medikoo/es5-ext/commit/dcc1451))
+* Object.ensurePlainFunction ([2682be6](https://github.com/medikoo/es5-ext/commit/2682be6))
+
+
+
+<a name="0.10.40"></a>
+## [0.10.40](https://github.com/medikoo/es5-ext/compare/v0.10.39...v0.10.40) (2018-03-09)
+
+
+### Features
+
+* **math:** decimal round, floor and ceil ([39290c6](https://github.com/medikoo/es5-ext/commit/39290c6))
+* **object:** isInteger and ensureInteger ([a5f7d04](https://github.com/medikoo/es5-ext/commit/a5f7d04))
+
+
+
+<a name="0.10.39"></a>
+## [0.10.39](https://github.com/medikoo/es5-ext/compare/v0.10.38...v0.10.39) (2018-02-16)
+
+
+### Features
+
+* Promise.lazy ([7a30a78](https://github.com/medikoo/es5-ext/commit/7a30a78))
+
+
+
+<a name="0.10.38"></a>
+## [0.10.38](https://github.com/medikoo/es5-ext/compare/v0.10.37...v0.10.38) (2018-01-16)
+
+
+### Features
+
+* Object.isNaturalNumber an Object.isNaturalNumberValue ([66a40af](https://github.com/medikoo/es5-ext/commit/66a40af))
+
+
+
<a name="0.10.37"></a>
## [0.10.37](https://github.com/medikoo/es5-ext/compare/v0.10.36...v0.10.37) (2017-11-23)
diff --git a/node_modules/es5-ext/LICENSE b/node_modules/es5-ext/LICENSE
index f82047ef9..c54cfb17c 100644
--- a/node_modules/es5-ext/LICENSE
+++ b/node_modules/es5-ext/LICENSE
@@ -1,21 +1,15 @@
-The MIT License (MIT)
+ISC License
-Copyright (C) 2011-2017 Mariusz Nowak (www.medikoo.com)
+Copyright (c) 2011-2018, Mariusz Nowak, @medikoo, medikoo.com
-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:
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
-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.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/es5-ext/README.md b/node_modules/es5-ext/README.md
index 594b48ed8..0a33d7d3f 100644
--- a/node_modules/es5-ext/README.md
+++ b/node_modules/es5-ext/README.md
@@ -1,5 +1,12 @@
+[![Build status][nix-build-image]][nix-build-url]
+[![Windows status][win-build-image]][win-build-url]
+![Transpilation status][transpilation-image]
+[![npm version][npm-image]][npm-url]
+
# es5-ext
+
## ECMAScript 5 extensions
+
### (with respect to ECMAScript 6 standard)
Shims for upcoming ES6 standard and other goodies implemented strictly with ECMAScript conventions in mind.
@@ -10,8 +17,8 @@ When used in ECMAScript 6 environment, native implementation (if valid) takes pr
### Installation
- $ npm install es5-ext
-
+ $ npm install es5-ext
+
To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
### Usage
@@ -21,118 +28,128 @@ To port it to Browser or any other (non CJS) environment, use your favorite CJS
You can force ES6 features to be implemented in your environment, e.g. following will assign `from` function to `Array` (only if it's not implemented already).
```javascript
-require('es5-ext/array/from/implement');
-Array.from('foo'); // ['f', 'o', 'o']
+require("es5-ext/array/from/implement");
+Array.from("foo"); // ['f', 'o', 'o']
```
You can also access shims directly, without fixing native objects. Following will return native `Array.from` if it's available and fallback to shim if it's not.
```javascript
-var aFrom = require('es5-ext/array/from');
-aFrom('foo'); // ['f', 'o', 'o']
+var aFrom = require("es5-ext/array/from");
+aFrom("foo"); // ['f', 'o', 'o']
```
If you want to use shim unconditionally (even if native implementation exists) do:
```javascript
-var aFrom = require('es5-ext/array/from/shim');
-aFrom('foo'); // ['f', 'o', 'o']
+var aFrom = require("es5-ext/array/from/shim");
+aFrom("foo"); // ['f', 'o', 'o']
```
##### List of ES6 shims
It's about properties introduced with ES6 and those that have been updated in new spec.
-- `Array.from` -> `require('es5-ext/array/from')`
-- `Array.of` -> `require('es5-ext/array/of')`
-- `Array.prototype.concat` -> `require('es5-ext/array/#/concat')`
-- `Array.prototype.copyWithin` -> `require('es5-ext/array/#/copy-within')`
-- `Array.prototype.entries` -> `require('es5-ext/array/#/entries')`
-- `Array.prototype.fill` -> `require('es5-ext/array/#/fill')`
-- `Array.prototype.filter` -> `require('es5-ext/array/#/filter')`
-- `Array.prototype.find` -> `require('es5-ext/array/#/find')`
-- `Array.prototype.findIndex` -> `require('es5-ext/array/#/find-index')`
-- `Array.prototype.keys` -> `require('es5-ext/array/#/keys')`
-- `Array.prototype.map` -> `require('es5-ext/array/#/map')`
-- `Array.prototype.slice` -> `require('es5-ext/array/#/slice')`
-- `Array.prototype.splice` -> `require('es5-ext/array/#/splice')`
-- `Array.prototype.values` -> `require('es5-ext/array/#/values')`
-- `Array.prototype[@@iterator]` -> `require('es5-ext/array/#/@@iterator')`
-- `Math.acosh` -> `require('es5-ext/math/acosh')`
-- `Math.asinh` -> `require('es5-ext/math/asinh')`
-- `Math.atanh` -> `require('es5-ext/math/atanh')`
-- `Math.cbrt` -> `require('es5-ext/math/cbrt')`
-- `Math.clz32` -> `require('es5-ext/math/clz32')`
-- `Math.cosh` -> `require('es5-ext/math/cosh')`
-- `Math.exmp1` -> `require('es5-ext/math/expm1')`
-- `Math.fround` -> `require('es5-ext/math/fround')`
-- `Math.hypot` -> `require('es5-ext/math/hypot')`
-- `Math.imul` -> `require('es5-ext/math/imul')`
-- `Math.log1p` -> `require('es5-ext/math/log1p')`
-- `Math.log2` -> `require('es5-ext/math/log2')`
-- `Math.log10` -> `require('es5-ext/math/log10')`
-- `Math.sign` -> `require('es5-ext/math/sign')`
-- `Math.signh` -> `require('es5-ext/math/signh')`
-- `Math.tanh` -> `require('es5-ext/math/tanh')`
-- `Math.trunc` -> `require('es5-ext/math/trunc')`
-- `Number.EPSILON` -> `require('es5-ext/number/epsilon')`
-- `Number.MAX_SAFE_INTEGER` -> `require('es5-ext/number/max-safe-integer')`
-- `Number.MIN_SAFE_INTEGER` -> `require('es5-ext/number/min-safe-integer')`
-- `Number.isFinite` -> `require('es5-ext/number/is-finite')`
-- `Number.isInteger` -> `require('es5-ext/number/is-integer')`
-- `Number.isNaN` -> `require('es5-ext/number/is-nan')`
-- `Number.isSafeInteger` -> `require('es5-ext/number/is-safe-integer')`
-- `Object.assign` -> `require('es5-ext/object/assign')`
-- `Object.keys` -> `require('es5-ext/object/keys')`
-- `Object.setPrototypeOf` -> `require('es5-ext/object/set-prototype-of')`
-- `RegExp.prototype.match` -> `require('es5-ext/reg-exp/#/match')`
-- `RegExp.prototype.replace` -> `require('es5-ext/reg-exp/#/replace')`
-- `RegExp.prototype.search` -> `require('es5-ext/reg-exp/#/search')`
-- `RegExp.prototype.split` -> `require('es5-ext/reg-exp/#/split')`
-- `RegExp.prototype.sticky` -> Implement with `require('es5-ext/reg-exp/#/sticky/implement')`, use as function with `require('es5-ext/reg-exp/#/is-sticky')`
-- `RegExp.prototype.unicode` -> Implement with `require('es5-ext/reg-exp/#/unicode/implement')`, use as function with `require('es5-ext/reg-exp/#/is-unicode')`
-- `String.fromCodePoint` -> `require('es5-ext/string/from-code-point')`
-- `String.raw` -> `require('es5-ext/string/raw')`
-- `String.prototype.codePointAt` -> `require('es5-ext/string/#/code-point-at')`
-- `String.prototype.contains` -> `require('es5-ext/string/#/contains')`
-- `String.prototype.endsWith` -> `require('es5-ext/string/#/ends-with')`
-- `String.prototype.normalize` -> `require('es5-ext/string/#/normalize')`
-- `String.prototype.repeat` -> `require('es5-ext/string/#/repeat')`
-- `String.prototype.startsWith` -> `require('es5-ext/string/#/starts-with')`
-- `String.prototype[@@iterator]` -> `require('es5-ext/string/#/@@iterator')`
+* `Array.from` -> `require('es5-ext/array/from')`
+* `Array.of` -> `require('es5-ext/array/of')`
+* `Array.prototype.concat` -> `require('es5-ext/array/#/concat')`
+* `Array.prototype.copyWithin` -> `require('es5-ext/array/#/copy-within')`
+* `Array.prototype.entries` -> `require('es5-ext/array/#/entries')`
+* `Array.prototype.fill` -> `require('es5-ext/array/#/fill')`
+* `Array.prototype.filter` -> `require('es5-ext/array/#/filter')`
+* `Array.prototype.find` -> `require('es5-ext/array/#/find')`
+* `Array.prototype.findIndex` -> `require('es5-ext/array/#/find-index')`
+* `Array.prototype.keys` -> `require('es5-ext/array/#/keys')`
+* `Array.prototype.map` -> `require('es5-ext/array/#/map')`
+* `Array.prototype.slice` -> `require('es5-ext/array/#/slice')`
+* `Array.prototype.splice` -> `require('es5-ext/array/#/splice')`
+* `Array.prototype.values` -> `require('es5-ext/array/#/values')`
+* `Array.prototype[@@iterator]` -> `require('es5-ext/array/#/@@iterator')`
+* `Math.acosh` -> `require('es5-ext/math/acosh')`
+* `Math.asinh` -> `require('es5-ext/math/asinh')`
+* `Math.atanh` -> `require('es5-ext/math/atanh')`
+* `Math.cbrt` -> `require('es5-ext/math/cbrt')`
+* `Math.clz32` -> `require('es5-ext/math/clz32')`
+* `Math.cosh` -> `require('es5-ext/math/cosh')`
+* `Math.exmp1` -> `require('es5-ext/math/expm1')`
+* `Math.fround` -> `require('es5-ext/math/fround')`
+* `Math.hypot` -> `require('es5-ext/math/hypot')`
+* `Math.imul` -> `require('es5-ext/math/imul')`
+* `Math.log1p` -> `require('es5-ext/math/log1p')`
+* `Math.log2` -> `require('es5-ext/math/log2')`
+* `Math.log10` -> `require('es5-ext/math/log10')`
+* `Math.sign` -> `require('es5-ext/math/sign')`
+* `Math.signh` -> `require('es5-ext/math/signh')`
+* `Math.tanh` -> `require('es5-ext/math/tanh')`
+* `Math.trunc` -> `require('es5-ext/math/trunc')`
+* `Number.EPSILON` -> `require('es5-ext/number/epsilon')`
+* `Number.MAX_SAFE_INTEGER` -> `require('es5-ext/number/max-safe-integer')`
+* `Number.MIN_SAFE_INTEGER` -> `require('es5-ext/number/min-safe-integer')`
+* `Number.isFinite` -> `require('es5-ext/number/is-finite')`
+* `Number.isInteger` -> `require('es5-ext/number/is-integer')`
+* `Number.isNaN` -> `require('es5-ext/number/is-nan')`
+* `Number.isSafeInteger` -> `require('es5-ext/number/is-safe-integer')`
+* `Object.assign` -> `require('es5-ext/object/assign')`
+* `Object.keys` -> `require('es5-ext/object/keys')`
+* `Object.setPrototypeOf` -> `require('es5-ext/object/set-prototype-of')`
+* `RegExp.prototype.match` -> `require('es5-ext/reg-exp/#/match')`
+* `RegExp.prototype.replace` -> `require('es5-ext/reg-exp/#/replace')`
+* `RegExp.prototype.search` -> `require('es5-ext/reg-exp/#/search')`
+* `RegExp.prototype.split` -> `require('es5-ext/reg-exp/#/split')`
+* `RegExp.prototype.sticky` -> Implement with `require('es5-ext/reg-exp/#/sticky/implement')`, use as function with `require('es5-ext/reg-exp/#/is-sticky')`
+* `RegExp.prototype.unicode` -> Implement with `require('es5-ext/reg-exp/#/unicode/implement')`, use as function with `require('es5-ext/reg-exp/#/is-unicode')`
+* `String.fromCodePoint` -> `require('es5-ext/string/from-code-point')`
+* `String.raw` -> `require('es5-ext/string/raw')`
+* `String.prototype.codePointAt` -> `require('es5-ext/string/#/code-point-at')`
+* `String.prototype.contains` -> `require('es5-ext/string/#/contains')`
+* `String.prototype.endsWith` -> `require('es5-ext/string/#/ends-with')`
+* `String.prototype.normalize` -> `require('es5-ext/string/#/normalize')`
+* `String.prototype.repeat` -> `require('es5-ext/string/#/repeat')`
+* `String.prototype.startsWith` -> `require('es5-ext/string/#/starts-with')`
+* `String.prototype[@@iterator]` -> `require('es5-ext/string/#/@@iterator')`
#### Non ECMAScript standard features
-__es5-ext__ provides also other utils, and implements them as if they were proposed for a standard. It mostly offers methods (not functions) which can directly be assigned to native prototypes:
+**es5-ext** provides also other utils, and implements them as if they were proposed for a standard. It mostly offers methods (not functions) which can directly be assigned to native prototypes:
```javascript
-Object.defineProperty(Function.prototype, 'partial', { value: require('es5-ext/function/#/partial'),
- configurable: true, enumerable: false, writable: true });
-Object.defineProperty(Array.prototype, 'flatten', { value: require('es5-ext/array/#/flatten'),
- configurable: true, enumerable: false, writable: true });
-Object.defineProperty(String.prototype, 'capitalize', { value: require('es5-ext/string/#/capitalize'),
- configurable: true, enumerable: false, writable: true });
+Object.defineProperty(Function.prototype, "partial", {
+ value: require("es5-ext/function/#/partial"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+});
+Object.defineProperty(Array.prototype, "flatten", {
+ value: require("es5-ext/array/#/flatten"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+});
+Object.defineProperty(String.prototype, "capitalize", {
+ value: require("es5-ext/string/#/capitalize"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+});
```
-See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you.
+See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you.
-__Important:__ Remember to __not__ extend natives in scope of generic reusable packages (e.g. ones you intend to publish to npm). Extending natives is fine __only__ if you're the _owner_ of the global scope, so e.g. in final project you lead development of.
+**Important:** Remember to **not** extend natives in scope of generic reusable packages (e.g. ones you intend to publish to npm). Extending natives is fine **only** if you're the _owner_ of the global scope, so e.g. in final project you lead development of.
When you're in situation when native extensions are not good idea, then you should use methods indirectly:
-
```javascript
-var flatten = require('es5-ext/array/#/flatten');
+var flatten = require("es5-ext/array/#/flatten");
flatten.call([1, [2, [3, 4]]]); // [1, 2, 3, 4]
```
for better convenience you can turn methods into functions:
-
```javascript
-var call = Function.prototype.call
-var flatten = call.bind(require('es5-ext/array/#/flatten'));
+var call = Function.prototype.call;
+var flatten = call.bind(require("es5-ext/array/#/flatten"));
flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4]
```
@@ -141,9 +158,9 @@ You can configure custom toolkit (like [underscorejs](http://underscorejs.org/))
```javascript
var util = {};
-util.partial = call.bind(require('es5-ext/function/#/partial'));
-util.flatten = call.bind(require('es5-ext/array/#/flatten'));
-util.startsWith = call.bind(require('es5-ext/string/#/starts-with'));
+util.partial = call.bind(require("es5-ext/function/#/partial"));
+util.flatten = call.bind(require("es5-ext/array/#/flatten"));
+util.startsWith = call.bind(require("es5-ext/string/#/starts-with"));
util.flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4]
```
@@ -190,7 +207,7 @@ Returns `obj` if it's an array, otherwise throws `TypeError`
#### arr.binarySearch(compareFn) _(es5-ext/array/#/binary-search)_
-In __sorted__ list search for index of item for which _compareFn_ returns value closest to _0_.
+In **sorted** list search for index of item for which _compareFn_ returns value closest to _0_.
It's variant of binary search algorithm
#### arr.clear() _(es5-ext/array/#/clear)_
@@ -212,7 +229,7 @@ Whether list contains the given value.
#### arr.copyWithin(target, start[, end]) _(es5-ext/array/#/copy-within)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.copywithin).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.copywithin).
#### arr.diff(other) _(es5-ext/array/#/diff)_
@@ -237,7 +254,7 @@ Returns the array of elements that are found only in one of the lists (either co
#### arr.fill(value[, start, end]) _(es5-ext/array/#/fill)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.fill).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.fill).
#### arr.filter(callback[, thisArg]) _(es5-ext/array/#/filter)_
@@ -397,13 +414,13 @@ Formats date up to given string. Supported patterns:
### Error Constructor extensions
-#### custom(message/*, code, ext*/) _(es5-ext/error/custom)_
+#### custom(message/_, code, ext_/) _(es5-ext/error/custom)_
-Creates custom error object, optinally extended with `code` and other extension properties (provided with `ext` object)
+Creates custom error object, optinally extended with `code` and other extension properties (provided with `ext` object)
#### isError(x) _(es5-ext/error/is-error)_
-Whether value is an error (instance of `Error`).
+Whether value is an error (instance of `Error`).
#### validError(x) _(es5-ext/error/valid-error)_
@@ -423,13 +440,13 @@ Some of the functions were inspired by [Functional JavaScript](http://osteele.co
Returns a constant function that returns pregiven argument
-_k(x)(y) =def x_
+_k(x)(y) =def x_
#### identity(x) _(es5-ext/function/identity)_
Identity function. Returns first argument
-_i(x) =def x_
+_i(x) =def x_
#### invoke(name[, …args]) _(es5-ext/function/invoke)_
@@ -437,7 +454,7 @@ Returns a function that takes an object as an argument, and applies object's
_name_ method to arguments.
_name_ can be name of the method or method itself.
-_invoke(name, …args)(object, …args2) =def object\[name\]\(…args, …args2\)_
+_invoke(name, …args)(object, …args2) =def object\[name\]\(…args, …args2\)_
#### isArguments(x) _(es5-ext/function/is-arguments)_
@@ -456,7 +473,7 @@ No operation function
Returns a function that takes an object, and returns the value of its _name_
property
-_pluck(name)(obj) =def obj[name]_
+_pluck(name)(obj) =def obj[name]_
#### validFunction(arg) _(es5-ext/function/valid-function)_
@@ -470,7 +487,7 @@ Some of the methods were inspired by [Functional JavaScript](http://osteele.com/
Applies the functions in reverse argument-list order.
-_f1.compose(f2, f3, f4)(…args) =def f1(f2(f3(f4(…arg))))_
+_f1.compose(f2, f3, f4)(…args) =def f1(f2(f3(f4(…arg))))_
#### fn.copy() _(es5-ext/function/#/copy)_
@@ -481,13 +498,13 @@ Produces copy of given function
Invoking the function returned by this function only _n_ arguments are passed to the underlying function. If the underlying function is not saturated, the result is a function that passes all its arguments to the underlying function.
If _n_ is not provided then it defaults to context function length
-_f.curry(4)(arg1, arg2)(arg3)(arg4) =def f(arg1, args2, arg3, arg4)_
+_f.curry(4)(arg1, arg2)(arg3)(arg4) =def f(arg1, args2, arg3, arg4)_
#### fn.lock([…args]) _(es5-ext/function/#/lock)_
Returns a function that applies the underlying function to _args_, and ignores its own arguments.
-_f.lock(…args)(…args2) =def f(…args)_
+_f.lock(…args)(…args2) =def f(…args)_
_Named after it's counterpart in Google Closure_
@@ -495,19 +512,19 @@ _Named after it's counterpart in Google Closure_
Returns a function that returns boolean negation of value returned by underlying function.
-_f.not()(…args) =def !f(…args)_
+_f.not()(…args) =def !f(…args)_
#### fn.partial([…args]) _(es5-ext/function/#/partial)_
Returns a function that when called will behave like context function called with initially passed arguments. If more arguments are suplilied, they are appended to initial args.
-_f.partial(…args1)(…args2) =def f(…args1, …args2)_
+_f.partial(…args1)(…args2) =def f(…args1, …args2)_
#### fn.spread() _(es5-ext/function/#/spread)_
Returns a function that applies underlying function with first list argument
-_f.match()(args) =def f.apply(null, args)_
+_f.match()(args) =def f.apply(null, args)_
#### fn.toStringTokens() _(es5-ext/function/#/to-string-tokens)_
@@ -517,77 +534,77 @@ Serializes function into two (arguments and body) string tokens. Result is plain
#### acosh(x) _(es5-ext/math/acosh)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.acosh).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.acosh).
#### asinh(x) _(es5-ext/math/asinh)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.asinh).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.asinh).
#### atanh(x) _(es5-ext/math/atanh)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.atanh).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.atanh).
#### cbrt(x) _(es5-ext/math/cbrt)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cbrt).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cbrt).
#### clz32(x) _(es5-ext/math/clz32)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.clz32).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.clz32).
#### cosh(x) _(es5-ext/math/cosh)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cosh).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cosh).
#### expm1(x) _(es5-ext/math/expm1)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.expm1).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.expm1).
#### fround(x) _(es5-ext/math/fround)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.fround).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.fround).
#### hypot([…values]) _(es5-ext/math/hypot)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot).
#### imul(x, y) _(es5-ext/math/imul)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.imul).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.imul).
#### log1p(x) _(es5-ext/math/log1p)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log1p).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log1p).
#### log2(x) _(es5-ext/math/log2)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log2).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log2).
#### log10(x) _(es5-ext/math/log10)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log10).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log10).
#### sign(x) _(es5-ext/math/sign)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sign).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sign).
#### sinh(x) _(es5-ext/math/sinh)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sinh).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sinh).
#### tanh(x) _(es5-ext/math/tanh)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.tanh).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.tanh).
#### trunc(x) _(es5-ext/math/trunc)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.trunc).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.trunc).
### Number Constructor extensions
#### EPSILON _(es5-ext/number/epsilon)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.epsilon).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.epsilon).
The difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately 2.2204460492503130808472633361816 x 10-16.
@@ -612,14 +629,14 @@ Whether given value is number
#### isSafeInteger(x) _(es5-ext/number/is-safe-integer)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.issafeinteger).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.issafeinteger).
-#### MAX_SAFE_INTEGER _(es5-ext/number/max-safe-integer)_
+#### MAX*SAFE_INTEGER *(es5-ext/number/max-safe-integer)\_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.maxsafeinteger).
The value of Number.MAX_SAFE_INTEGER is 9007199254740991.
-#### MIN_SAFE_INTEGER _(es5-ext/number/min-safe-integer)_
+#### MIN*SAFE_INTEGER *(es5-ext/number/min-safe-integer)\_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.minsafeinteger).
The value of Number.MIN_SAFE_INTEGER is -9007199254740991 (253-1).
@@ -705,7 +722,7 @@ Returns first enumerable key of the object, as keys are unordered by specificati
Returns new object, with flatten properties of input object
-_flatten({ a: { b: 1 }, c: { d: 1 } }) =def { b: 1, d: 1 }_
+_flatten({ a: { b: 1 }, c: { d: 1 } }) =def { b: 1, d: 1 }_
#### forEach(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/for-each)_
@@ -773,13 +790,13 @@ Useful as an alternative for `setPrototypeOf` in environments in which it cannot
#### normalizeOptions(options) _(es5-ext/object/normalize-options)_
-Normalizes options object into flat plain object.
+Normalizes options object into flat plain object.
Useful for functions in which we either need to keep options object for future reference or need to modify it for internal use.
-- It never returns input `options` object back (always a copy is created)
-- `options` can be undefined in such case empty plain object is returned.
-- Copies all enumerable properties found down prototype chain.
+* It never returns input `options` object back (always a copy is created)
+* `options` can be undefined in such case empty plain object is returned.
+* Copies all enumerable properties found down prototype chain.
#### primitiveSet([…names]) _(es5-ext/object/primitive-set)_
@@ -855,19 +872,19 @@ It's to be used as counterpart to [regExp.unicode](http://people.mozilla.org/~jo
#### re.match(string) _(es5-ext/reg-exp/#/match)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.match).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.match).
#### re.replace(string, replaceValue) _(es5-ext/reg-exp/#/replace)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.replace).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.replace).
#### re.search(string) _(es5-ext/reg-exp/#/search)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.search).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.search).
#### re.split(string) _(es5-ext/reg-exp/#/search)_
-[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.split).
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.split).
#### re.sticky _(es5-ext/reg-exp/#/sticky/implement)_
@@ -988,6 +1005,14 @@ Whether strings starts with given string
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype-@@iterator).
Returns iterator object which traverses all string characters (with respect to unicode symbols)
-### Tests [![Build Status](https://img.shields.io/circleci/project/github/medikoo/es5-ext.svg)](https://circleci.com/gh/medikoo/es5-ext)
+### Tests
+
+ $ npm test
- $ npm test
+[nix-build-image]: https://semaphoreci.com/api/v1/medikoo-org/es5-ext/branches/master/shields_badge.svg
+[nix-build-url]: https://semaphoreci.com/medikoo-org/es5-ext
+[win-build-image]: https://ci.appveyor.com/api/projects/status/3jox67ksw3p8hkwh?svg=true
+[win-build-url]: https://ci.appveyor.com/project/medikoo/es5-ext
+[transpilation-image]: https://img.shields.io/badge/transpilation-free-brightgreen.svg
+[npm-image]: https://img.shields.io/npm/v/es5-ext.svg
+[npm-url]: https://www.npmjs.com/package/es5-ext
diff --git a/node_modules/es5-ext/date/is-date.js b/node_modules/es5-ext/date/is-date.js
index 97582032d..f45bde469 100644
--- a/node_modules/es5-ext/date/is-date.js
+++ b/node_modules/es5-ext/date/is-date.js
@@ -3,5 +3,8 @@
var objToString = Object.prototype.toString, id = objToString.call(new Date());
module.exports = function (value) {
- return (value && (value instanceof Date || objToString.call(value) === id)) || false;
+ return (
+ (value && !isNaN(value) && (value instanceof Date || objToString.call(value) === id)) ||
+ false
+ );
};
diff --git a/node_modules/es5-ext/date/valid-date.js b/node_modules/es5-ext/date/valid-date.js
index c17125f0f..0c73dc5d3 100644
--- a/node_modules/es5-ext/date/valid-date.js
+++ b/node_modules/es5-ext/date/valid-date.js
@@ -3,6 +3,6 @@
var isDate = require("./is-date");
module.exports = function (value) {
- if (!isDate(value) || isNaN(value)) throw new TypeError(value + " is not valid Date object");
+ if (!isDate(value)) throw new TypeError(value + " is not valid Date object");
return value;
};
diff --git a/node_modules/es5-ext/function/#/index.js b/node_modules/es5-ext/function/#/index.js
index 74c7f0171..02ae9f491 100644
--- a/node_modules/es5-ext/function/#/index.js
+++ b/node_modules/es5-ext/function/#/index.js
@@ -5,6 +5,7 @@ module.exports = {
copy: require("./copy"),
curry: require("./curry"),
lock: require("./lock"),
+ microtaskDelay: require("./microtask-delay"),
not: require("./not"),
partial: require("./partial"),
spread: require("./spread"),
diff --git a/node_modules/es5-ext/index.js b/node_modules/es5-ext/index.js
index a6b57ea7e..0919764ec 100644
--- a/node_modules/es5-ext/index.js
+++ b/node_modules/es5-ext/index.js
@@ -16,6 +16,7 @@ module.exports = {
math: require("./math"),
number: require("./number"),
object: require("./object"),
+ promise: require("./promise"),
regExp: require("./reg-exp"),
string: require("./string")
};
diff --git a/node_modules/es5-ext/math/index.js b/node_modules/es5-ext/math/index.js
index db86101ff..a59269cc6 100644
--- a/node_modules/es5-ext/math/index.js
+++ b/node_modules/es5-ext/math/index.js
@@ -5,15 +5,18 @@ module.exports = {
asinh: require("./asinh"),
atanh: require("./atanh"),
cbrt: require("./cbrt"),
+ ceil10: require("./ceil-10"),
clz32: require("./clz32"),
cosh: require("./cosh"),
expm1: require("./expm1"),
+ floor10: require("./floor-10"),
fround: require("./fround"),
hypot: require("./hypot"),
imul: require("./imul"),
log10: require("./log10"),
log2: require("./log2"),
log1p: require("./log1p"),
+ round10: require("./round-10"),
sign: require("./sign"),
sinh: require("./sinh"),
tanh: require("./tanh"),
diff --git a/node_modules/es5-ext/object/assign-deep.js b/node_modules/es5-ext/object/assign-deep.js
index 8034a038e..4a8597a49 100644
--- a/node_modules/es5-ext/object/assign-deep.js
+++ b/node_modules/es5-ext/object/assign-deep.js
@@ -2,31 +2,32 @@
var includes = require("../array/#/contains")
, uniq = require("../array/#/uniq")
+ , copyDeep = require("./copy-deep")
, objForEach = require("./for-each")
, isPlainObject = require("./is-plain-object")
, ensureValue = require("./valid-value");
var isArray = Array.isArray, slice = Array.prototype.slice;
-var deepAssign = function (source, target) {
- if (isPlainObject(source)) {
- if (!isPlainObject(target)) return target;
- objForEach(target, function (value, key) {
- source[key] = deepAssign(source[key], value);
- });
- return source;
+var deepAssign = function (target, source) {
+ if (target === source) return target;
+ if (isPlainObject(target) && isPlainObject(source)) {
+ objForEach(source, function (value, key) { target[key] = deepAssign(target[key], value); });
+ return target;
}
- if (isArray(source)) {
- if (!isArray(target)) return target;
- target.forEach(function (item) {
- if (!includes.call(source, item)) source.push(item);
+ if (isArray(target) && isArray(source)) {
+ source.forEach(function (item) {
+ if (includes.call(target, item)) return;
+ if (isArray(item) || isPlainObject(item)) item = copyDeep(item);
+ target.push(item);
});
- return source;
+ return target;
}
- return target;
+ if (isPlainObject(source) || isArray(source)) return copyDeep(source);
+ return source;
};
-module.exports = function (target /*, ...objects*/) {
+module.exports = function (target/*, ...objects*/) {
return uniq
.call([ensureValue(target)].concat(slice.call(arguments, 1).map(ensureValue)))
.reduce(deepAssign);
diff --git a/node_modules/es5-ext/object/ensure-natural-number-value.js b/node_modules/es5-ext/object/ensure-natural-number-value.js
index d47d5d149..1a901aa42 100644
--- a/node_modules/es5-ext/object/ensure-natural-number-value.js
+++ b/node_modules/es5-ext/object/ensure-natural-number-value.js
@@ -1,9 +1,10 @@
"use strict";
-var ensure = require("./ensure-natural-number")
- , isValue = require("./is-value");
+var isNaturalValue = require("./is-natural-number-value")
+ , toShortString = require("../to-short-string-representation");
module.exports = function (arg) {
- if (!isValue(arg)) throw new TypeError(arg + " is not a natural number");
- return ensure(arg);
+ var num = Number(arg);
+ if (!isNaturalValue(arg)) throw new TypeError(toShortString(arg) + " is not a natural number");
+ return num;
};
diff --git a/node_modules/es5-ext/object/ensure-natural-number.js b/node_modules/es5-ext/object/ensure-natural-number.js
index 5b35e4a13..ec7e51467 100644
--- a/node_modules/es5-ext/object/ensure-natural-number.js
+++ b/node_modules/es5-ext/object/ensure-natural-number.js
@@ -1,9 +1,10 @@
"use strict";
-var isNatural = require("../number/is-natural");
+var isNatural = require("../number/is-natural")
+ , toShortString = require("../to-short-string-representation");
module.exports = function (arg) {
var num = Number(arg);
- if (!isNatural(num)) throw new TypeError(arg + " is not a natural number");
+ if (!isNatural(num)) throw new TypeError(toShortString(arg) + " is not a natural number");
return num;
};
diff --git a/node_modules/es5-ext/object/ensure-promise.js b/node_modules/es5-ext/object/ensure-promise.js
index 0a1119c4e..b5b535631 100644
--- a/node_modules/es5-ext/object/ensure-promise.js
+++ b/node_modules/es5-ext/object/ensure-promise.js
@@ -4,6 +4,6 @@ var safeToString = require("../safe-to-string")
, isPromise = require("./is-promise");
module.exports = function (value) {
- if (!isPromise(value)) throw new TypeError(safeToString(value) + " is not a thenable");
+ if (!isPromise(value)) throw new TypeError(safeToString(value) + " is not a promise");
return value;
};
diff --git a/node_modules/es5-ext/object/index.js b/node_modules/es5-ext/object/index.js
index 7075be41a..ed0b7d5a6 100644
--- a/node_modules/es5-ext/object/index.js
+++ b/node_modules/es5-ext/object/index.js
@@ -12,9 +12,13 @@ module.exports = {
create: require("./create"),
ensureArray: require("./ensure-array"),
ensureFiniteNumber: require("./ensure-finite-number"),
+ ensureInteger: require("./ensure-integer"),
ensureNaturalNumber: require("./ensure-natural-number"),
ensureNaturalNumberValue: require("./ensure-natural-number-value"),
+ ensurePlainFunction: require("./ensure-plain-function"),
ensurePromise: require("./ensure-promise"),
+ ensureThenable: require("./ensure-thenable"),
+ entries: require("./entries"),
eq: require("./eq"),
every: require("./every"),
filter: require("./filter"),
@@ -31,11 +35,15 @@ module.exports = {
isCopyDeep: require("./is-copy-deep"),
isEmpty: require("./is-empty"),
isFiniteNumber: require("./is-finite-number"),
+ isInteger: require("./is-integer"),
+ isNaturalNumber: require("./is-natural-number"),
+ isNaturalNumberValue: require("./is-natural-number-value"),
isNumberValue: require("./is-number-value"),
isObject: require("./is-object"),
isPlainFunction: require("./is-plain-function"),
isPlainObject: require("./is-plain-object"),
isPromise: require("./is-promise"),
+ isThenable: require("./is-thenable"),
isValue: require("./is-value"),
keyOf: require("./key-of"),
keys: require("./keys"),
diff --git a/node_modules/es5-ext/object/is-promise.js b/node_modules/es5-ext/object/is-promise.js
index 3e5d20d16..33d6df133 100644
--- a/node_modules/es5-ext/object/is-promise.js
+++ b/node_modules/es5-ext/object/is-promise.js
@@ -1,8 +1,4 @@
"use strict";
-var isCallable = require("./is-callable")
- , isObject = require("./is-object");
-
-module.exports = function (value) {
- return isObject(value) && isCallable(value.then);
-};
+// In next major this check will also confirm on promise constructor
+module.exports = require("./is-thenable");
diff --git a/node_modules/es5-ext/object/keys/implement.js b/node_modules/es5-ext/object/keys/implement.js
index 7119a706e..72ecfbdfc 100644
--- a/node_modules/es5-ext/object/keys/implement.js
+++ b/node_modules/es5-ext/object/keys/implement.js
@@ -1,8 +1,10 @@
"use strict";
if (!require("./is-implemented")()) {
- Object.defineProperty(Object, "keys", { value: require("./shim"),
+ Object.defineProperty(Object, "keys", {
+ value: require("./shim"),
configurable: true,
-enumerable: false,
-writable: true });
+ enumerable: false,
+ writable: true
+ });
}
diff --git a/node_modules/es5-ext/object/keys/index.js b/node_modules/es5-ext/object/keys/index.js
index b56b5347c..d1942279f 100644
--- a/node_modules/es5-ext/object/keys/index.js
+++ b/node_modules/es5-ext/object/keys/index.js
@@ -1,5 +1,3 @@
"use strict";
-module.exports = require("./is-implemented")()
- ? Object.keys
- : require("./shim");
+module.exports = require("./is-implemented")() ? Object.keys : require("./shim");
diff --git a/node_modules/es5-ext/object/keys/is-implemented.js b/node_modules/es5-ext/object/keys/is-implemented.js
index 7abd33a88..2dfcf1b99 100644
--- a/node_modules/es5-ext/object/keys/is-implemented.js
+++ b/node_modules/es5-ext/object/keys/is-implemented.js
@@ -5,6 +5,6 @@ module.exports = function () {
Object.keys("primitive");
return true;
} catch (e) {
- return false;
-}
+ return false;
+ }
};
diff --git a/node_modules/es5-ext/object/keys/shim.js b/node_modules/es5-ext/object/keys/shim.js
index bc802017e..a8908d5c7 100644
--- a/node_modules/es5-ext/object/keys/shim.js
+++ b/node_modules/es5-ext/object/keys/shim.js
@@ -4,6 +4,4 @@ var isValue = require("../is-value");
var keys = Object.keys;
-module.exports = function (object) {
- return keys(isValue(object) ? Object(object) : object);
-};
+module.exports = function (object) { return keys(isValue(object) ? Object(object) : object); };
diff --git a/node_modules/es5-ext/package.json b/node_modules/es5-ext/package.json
index 81b25b0aa..b85d9e960 100644
--- a/node_modules/es5-ext/package.json
+++ b/node_modules/es5-ext/package.json
@@ -1,6 +1,6 @@
{
"name": "es5-ext",
- "version": "0.10.37",
+ "version": "0.10.46",
"description": "ECMAScript extensions and shims",
"author": "Mariusz Nowak <medyk@medikoo.com> (http://www.medikoo.com/)",
"keywords": [
@@ -26,12 +26,13 @@
"url": "git://github.com/medikoo/es5-ext.git"
},
"dependencies": {
- "es6-iterator": "~2.0.1",
- "es6-symbol": "~3.1.1"
+ "es6-iterator": "~2.0.3",
+ "es6-symbol": "~3.1.1",
+ "next-tick": "1"
},
"devDependencies": {
- "eslint": "^4.6.1",
- "eslint-config-medikoo-es5": "^1.4.4",
+ "eslint": "^4.15",
+ "eslint-config-medikoo-es5": "^1.4.8",
"tad": "~0.2.7"
},
"eslintConfig": {
@@ -45,5 +46,5 @@
"lint": "eslint --ignore-path=.gitignore .",
"test": "node ./node_modules/tad/bin/tad"
},
- "license": "MIT"
+ "license": "ISC"
}
diff --git a/node_modules/es5-ext/safe-to-string.js b/node_modules/es5-ext/safe-to-string.js
index cc323d7c7..f49a238ae 100644
--- a/node_modules/es5-ext/safe-to-string.js
+++ b/node_modules/es5-ext/safe-to-string.js
@@ -7,6 +7,6 @@ module.exports = function (value) {
if (value && isCallable(value.toString)) return value.toString();
return String(value);
} catch (e) {
- return "<non-stringifiable value>";
+ return "<Non-coercible to string value>";
}
};
diff --git a/node_modules/es5-ext/test/object/assign-deep.js b/node_modules/es5-ext/test/object/assign-deep.js
index 071eeb739..962ac40df 100644
--- a/node_modules/es5-ext/test/object/assign-deep.js
+++ b/node_modules/es5-ext/test/object/assign-deep.js
@@ -10,6 +10,18 @@ module.exports = function (t, a) {
var obj1 = { foo: { bar: 3, marko: true } }
, obj2 = { foo: { elo: 12, marko: false }, miszka: [23] };
+
+ var copyObj1 = JSON.parse(JSON.stringify(obj1)), copyObj2 = JSON.parse(JSON.stringify(obj2));
a.deep(t({}, obj1, obj2), { foo: { bar: 3, marko: false, elo: 12 }, miszka: [23] });
+ // Ensure it's side effects free
+ a.deep(obj1, copyObj1);
+ a.deep(obj2, copyObj2);
+
+ obj1 = [{ foo: "bar" }];
+ var assignedObj = [];
+ t(assignedObj, obj1);
+ a.deep(assignedObj, [{ foo: "bar" }]);
+ // Ensure array items are copied and not passed
+ a.not(assignedObj[0], obj1[0]);
a(t(true), true);
};
diff --git a/node_modules/es5-ext/test/object/keys/implement.js b/node_modules/es5-ext/test/object/keys/implement.js
index d364abed9..3134886dc 100644
--- a/node_modules/es5-ext/test/object/keys/implement.js
+++ b/node_modules/es5-ext/test/object/keys/implement.js
@@ -2,6 +2,4 @@
var isImplemented = require("../../../object/keys/is-implemented");
-module.exports = function (a) {
- a(isImplemented(), true);
-};
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/node_modules/es5-ext/test/object/keys/is-implemented.js b/node_modules/es5-ext/test/object/keys/is-implemented.js
index 5003e7e93..566411ce2 100644
--- a/node_modules/es5-ext/test/object/keys/is-implemented.js
+++ b/node_modules/es5-ext/test/object/keys/is-implemented.js
@@ -1,5 +1,3 @@
"use strict";
-module.exports = function (t, a) {
- a(typeof t(), "boolean");
-};
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/node_modules/es5-ext/test/object/keys/shim.js b/node_modules/es5-ext/test/object/keys/shim.js
index 47e6547ed..dc09f46bd 100644
--- a/node_modules/es5-ext/test/object/keys/shim.js
+++ b/node_modules/es5-ext/test/object/keys/shim.js
@@ -3,10 +3,6 @@
module.exports = function (t, a) {
a.deep(t({ foo: "bar" }), ["foo"], "Object");
a.deep(t("raz"), ["0", "1", "2"], "Primitive");
- a.throws(function () {
- t();
-}, TypeError, "Undefined");
- a.throws(function () {
- t(null);
-}, TypeError, "Undefined");
+ a.throws(function () { t(); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "Undefined");
};
diff --git a/node_modules/es5-ext/test/reg-exp/#/match/shim.js b/node_modules/es5-ext/test/reg-exp/#/match/shim.js
index fce094f61..c6fedb57c 100644
--- a/node_modules/es5-ext/test/reg-exp/#/match/shim.js
+++ b/node_modules/es5-ext/test/reg-exp/#/match/shim.js
@@ -1,8 +1,6 @@
"use strict";
module.exports = function (t, a) {
- var result = ["foo"];
- result.index = 0;
- result.input = "foobar";
+ var result = "foobar".match(/foo/);
a.deep(t.call(/foo/, "foobar"), result);
};
diff --git a/node_modules/es5-ext/test/safe-to-string.js b/node_modules/es5-ext/test/safe-to-string.js
index 1e2d7e13e..8f545e5b7 100644
--- a/node_modules/es5-ext/test/safe-to-string.js
+++ b/node_modules/es5-ext/test/safe-to-string.js
@@ -5,15 +5,8 @@ module.exports = function (t, a) {
a(t(null), "null");
a(t(10), "10");
a(t("str"), "str");
- a(
- t({
- toString: function () {
- return "miszka";
- }
- }),
- "miszka"
- );
+ a(t({ toString: function () { return "miszka"; } }), "miszka");
// eslint-disable-next-line symbol-description
if (typeof Symbol === "function") a(t(Symbol()), "Symbol()");
- a(t(Object.create(null)), "<non-stringifiable value>");
+ a(t(Object.create(null)), "<Non-coercible to string value>");
};
diff --git a/node_modules/es5-ext/test/string/format-method.js b/node_modules/es5-ext/test/string/format-method.js
index 69e93de63..d0c216b46 100644
--- a/node_modules/es5-ext/test/string/format-method.js
+++ b/node_modules/es5-ext/test/string/format-method.js
@@ -1,12 +1,14 @@
"use strict";
module.exports = function (t, a) {
- t = t({ a: "A",
-aa: "B",
-ab: "C",
-b: "D",
+ t = t({
+ a: "A",
+ aa: "B",
+ ab: "C",
+ b: "D",
c: function () {
- return ++this.a;
-} });
+ return ++this.a;
+ }
+ });
a(t.call({ a: 0 }, " %a%aab%abb%b\\%aa%ab%c%c "), " ABbCbD%aaC12 ");
};
diff --git a/node_modules/es5-ext/test/to-short-string-representation.js b/node_modules/es5-ext/test/to-short-string-representation.js
index ea9a06d89..cac8d8701 100644
--- a/node_modules/es5-ext/test/to-short-string-representation.js
+++ b/node_modules/es5-ext/test/to-short-string-representation.js
@@ -7,17 +7,10 @@ module.exports = function (t, a) {
a(t(null), "null");
a(t(10), "10");
a(t("str"), "str");
- a(
- t({
- toString: function () {
- return "miszka";
- }
- }),
- "miszka"
- );
+ a(t({ toString: function () { return "miszka"; } }), "miszka");
// eslint-disable-next-line symbol-description
if (typeof Symbol === "function") a(t(Symbol()), "Symbol()");
- a(t(Object.create(null)), "<non-stringifiable value>");
+ a(t(Object.create(null)), "<Non-coercible to string value>");
a(t(repeat.call("a", 300)), repeat.call("a", 99) + "…");
a(t("mar\ntoo\nfar"), "mar\\ntoo\\nfar");
};