Showing preview only (676K chars total). Download the full file or copy to clipboard to get everything.
Repository: medikoo/es5-ext
Branch: main
Commit: f76b03d8c49c
Files: 847
Total size: 513.7 KB
Directory structure:
gitextract_4lrese67/
├── .editorconfig
├── .github/
│ ├── FUNDING.yml
│ └── workflows/
│ ├── integrate.yml
│ ├── publish.yml
│ └── validate.yml
├── .gitignore
├── .npmignore
├── CHANGELOG.md
├── CHANGES
├── LICENSE
├── README.md
├── _postinstall.js
├── array/
│ ├── #/
│ │ ├── @@iterator/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── _compare-by-length.js
│ │ ├── binary-search.js
│ │ ├── clear.js
│ │ ├── compact.js
│ │ ├── concat/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── contains.js
│ │ ├── copy-within/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── diff.js
│ │ ├── e-index-of.js
│ │ ├── e-last-index-of.js
│ │ ├── entries/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── exclusion.js
│ │ ├── fill/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── filter/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── find/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── find-index/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── first-index.js
│ │ ├── first.js
│ │ ├── flatten.js
│ │ ├── for-each-right.js
│ │ ├── group.js
│ │ ├── index.js
│ │ ├── indexes-of.js
│ │ ├── intersection.js
│ │ ├── is-copy.js
│ │ ├── is-empty.js
│ │ ├── is-uniq.js
│ │ ├── keys/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── last-index.js
│ │ ├── last.js
│ │ ├── map/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── remove.js
│ │ ├── separate.js
│ │ ├── slice/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── some-right.js
│ │ ├── splice/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── uniq.js
│ │ └── values/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── _is-extensible.js
│ ├── _sub-array-dummy-safe.js
│ ├── _sub-array-dummy.js
│ ├── from/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── generate.js
│ ├── index.js
│ ├── is-plain-array.js
│ ├── of/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── to-array.js
│ └── valid-array.js
├── boolean/
│ ├── index.js
│ └── is-boolean.js
├── commitlint.config.js
├── date/
│ ├── #/
│ │ ├── copy.js
│ │ ├── days-in-month.js
│ │ ├── floor-day.js
│ │ ├── floor-month.js
│ │ ├── floor-year.js
│ │ ├── format.js
│ │ └── index.js
│ ├── ensure-time-value.js
│ ├── index.js
│ ├── is-date.js
│ ├── is-time-value.js
│ └── valid-date.js
├── error/
│ ├── #/
│ │ ├── index.js
│ │ └── throw.js
│ ├── custom.js
│ ├── index.js
│ ├── is-error.js
│ └── valid-error.js
├── function/
│ ├── #/
│ │ ├── compose.js
│ │ ├── copy.js
│ │ ├── curry.js
│ │ ├── index.js
│ │ ├── lock.js
│ │ ├── microtask-delay.js
│ │ ├── not.js
│ │ ├── partial.js
│ │ ├── spread.js
│ │ └── to-string-tokens.js
│ ├── _define-length.js
│ ├── constant.js
│ ├── identity.js
│ ├── index.js
│ ├── invoke.js
│ ├── is-arguments.js
│ ├── is-function.js
│ ├── noop.js
│ ├── pluck.js
│ └── valid-function.js
├── global.js
├── index.js
├── iterable/
│ ├── for-each.js
│ ├── index.js
│ ├── is.js
│ ├── validate-object.js
│ └── validate.js
├── json/
│ ├── index.js
│ └── safe-stringify.js
├── math/
│ ├── _decimal-adjust.js
│ ├── _pack-ieee754.js
│ ├── _unpack-ieee754.js
│ ├── acosh/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── asinh/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── atanh/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── cbrt/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── ceil-10.js
│ ├── clz32/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── cosh/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── expm1/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── floor-10.js
│ ├── fround/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── hypot/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── imul/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── index.js
│ ├── log10/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── log1p/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── log2/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── round-10.js
│ ├── sign/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── sinh/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── tanh/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ └── trunc/
│ ├── implement.js
│ ├── index.js
│ ├── is-implemented.js
│ └── shim.js
├── number/
│ ├── #/
│ │ ├── index.js
│ │ └── pad.js
│ ├── epsilon/
│ │ ├── implement.js
│ │ ├── index.js
│ │ └── is-implemented.js
│ ├── index.js
│ ├── is-finite/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── is-integer/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── is-nan/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── is-natural.js
│ ├── is-number.js
│ ├── is-safe-integer/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── max-safe-integer/
│ │ ├── implement.js
│ │ ├── index.js
│ │ └── is-implemented.js
│ ├── min-safe-integer/
│ │ ├── implement.js
│ │ ├── index.js
│ │ └── is-implemented.js
│ ├── to-integer.js
│ ├── to-pos-integer.js
│ └── to-uint32.js
├── object/
│ ├── _iterate.js
│ ├── assign/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── assign-deep.js
│ ├── clear.js
│ ├── compact.js
│ ├── compare.js
│ ├── copy-deep.js
│ ├── copy.js
│ ├── count.js
│ ├── create.js
│ ├── ensure-array.js
│ ├── ensure-finite-number.js
│ ├── ensure-integer.js
│ ├── ensure-natural-number-value.js
│ ├── ensure-natural-number.js
│ ├── ensure-plain-function.js
│ ├── ensure-plain-object.js
│ ├── ensure-promise.js
│ ├── ensure-thenable.js
│ ├── entries/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── eq.js
│ ├── every.js
│ ├── filter.js
│ ├── find-key.js
│ ├── find.js
│ ├── first-key.js
│ ├── flatten.js
│ ├── for-each.js
│ ├── get-property-names.js
│ ├── index.js
│ ├── is-array-like.js
│ ├── is-callable.js
│ ├── is-copy-deep.js
│ ├── is-copy.js
│ ├── is-empty.js
│ ├── is-finite-number.js
│ ├── is-integer.js
│ ├── is-natural-number-value.js
│ ├── is-natural-number.js
│ ├── is-number-value.js
│ ├── is-object.js
│ ├── is-plain-function.js
│ ├── is-plain-object.js
│ ├── is-promise.js
│ ├── is-thenable.js
│ ├── is-value.js
│ ├── is.js
│ ├── key-of.js
│ ├── keys/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── map-keys.js
│ ├── map.js
│ ├── mixin-prototypes.js
│ ├── mixin.js
│ ├── normalize-options.js
│ ├── primitive-set.js
│ ├── safe-traverse.js
│ ├── serialize.js
│ ├── set-prototype-of/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── some.js
│ ├── to-array.js
│ ├── unserialize.js
│ ├── valid-callable.js
│ ├── valid-object.js
│ ├── valid-value.js
│ ├── validate-array-like-object.js
│ ├── validate-array-like.js
│ ├── validate-stringifiable-value.js
│ └── validate-stringifiable.js
├── optional-chaining.js
├── package.json
├── promise/
│ ├── #/
│ │ ├── as-callback.js
│ │ ├── finally/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ └── index.js
│ ├── .eslintrc.json
│ ├── index.js
│ └── lazy.js
├── reg-exp/
│ ├── #/
│ │ ├── index.js
│ │ ├── is-sticky.js
│ │ ├── is-unicode.js
│ │ ├── match/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── replace/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── search/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── split/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── sticky/
│ │ │ ├── implement.js
│ │ │ └── is-implemented.js
│ │ └── unicode/
│ │ ├── implement.js
│ │ └── is-implemented.js
│ ├── escape.js
│ ├── index.js
│ ├── is-reg-exp.js
│ └── valid-reg-exp.js
├── safe-to-string.js
├── string/
│ ├── #/
│ │ ├── @@iterator/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── at.js
│ │ ├── camel-to-hyphen.js
│ │ ├── capitalize.js
│ │ ├── case-insensitive-compare.js
│ │ ├── code-point-at/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── contains/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── count.js
│ │ ├── ends-with/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── hyphen-to-camel.js
│ │ ├── indent.js
│ │ ├── index.js
│ │ ├── last.js
│ │ ├── normalize/
│ │ │ ├── _data.js
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── pad.js
│ │ ├── plain-replace-all.js
│ │ ├── plain-replace.js
│ │ ├── repeat/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── starts-with/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ └── uncapitalize.js
│ ├── format-method.js
│ ├── from-code-point/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── index.js
│ ├── is-string.js
│ ├── random-uniq.js
│ ├── random.js
│ └── raw/
│ ├── implement.js
│ ├── index.js
│ ├── is-implemented.js
│ └── shim.js
├── test/
│ ├── .eslintrc.json
│ ├── __tad.js
│ ├── _postinstall.js
│ ├── array/
│ │ ├── #/
│ │ │ ├── @@iterator/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── _compare-by-length.js
│ │ │ ├── binary-search.js
│ │ │ ├── clear.js
│ │ │ ├── compact.js
│ │ │ ├── concat/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── contains.js
│ │ │ ├── copy-within/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── diff.js
│ │ │ ├── e-index-of.js
│ │ │ ├── e-last-index-of.js
│ │ │ ├── entries/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── exclusion.js
│ │ │ ├── fill/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── filter/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── find/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── find-index/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── first-index.js
│ │ │ ├── first.js
│ │ │ ├── flatten.js
│ │ │ ├── for-each-right.js
│ │ │ ├── group.js
│ │ │ ├── indexes-of.js
│ │ │ ├── intersection.js
│ │ │ ├── is-copy.js
│ │ │ ├── is-empty.js
│ │ │ ├── is-uniq.js
│ │ │ ├── keys/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── last-index.js
│ │ │ ├── last.js
│ │ │ ├── map/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── remove.js
│ │ │ ├── separate.js
│ │ │ ├── slice/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── some-right.js
│ │ │ ├── splice/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── uniq.js
│ │ │ └── values/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── __scopes.js
│ │ ├── _is-extensible.js
│ │ ├── _sub-array-dummy-safe.js
│ │ ├── _sub-array-dummy.js
│ │ ├── from/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── generate.js
│ │ ├── is-plain-array.js
│ │ ├── of/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── to-array.js
│ │ └── valid-array.js
│ ├── boolean/
│ │ └── is-boolean.js
│ ├── date/
│ │ ├── #/
│ │ │ ├── copy.js
│ │ │ ├── days-in-month.js
│ │ │ ├── floor-day.js
│ │ │ ├── floor-month.js
│ │ │ ├── floor-year.js
│ │ │ └── format.js
│ │ ├── ensure-time-value.js
│ │ ├── is-date.js
│ │ ├── is-time-value.js
│ │ └── valid-date.js
│ ├── error/
│ │ ├── #/
│ │ │ └── throw.js
│ │ ├── custom.js
│ │ ├── is-error.js
│ │ └── valid-error.js
│ ├── function/
│ │ ├── #/
│ │ │ ├── compose.js
│ │ │ ├── copy.js
│ │ │ ├── curry.js
│ │ │ ├── lock.js
│ │ │ ├── microtask-delay.js
│ │ │ ├── not.js
│ │ │ ├── partial.js
│ │ │ ├── spread.js
│ │ │ └── to-string-tokens.js
│ │ ├── _define-length.js
│ │ ├── constant.js
│ │ ├── identity.js
│ │ ├── invoke.js
│ │ ├── is-arguments.js
│ │ ├── is-function.js
│ │ ├── noop.js
│ │ ├── pluck.js
│ │ └── valid-function.js
│ ├── global.js
│ ├── iterable/
│ │ ├── for-each.js
│ │ ├── is.js
│ │ ├── validate-object.js
│ │ └── validate.js
│ ├── json/
│ │ └── safe-stringify.js
│ ├── math/
│ │ ├── _decimal-adjust.js
│ │ ├── _pack-ieee754.js
│ │ ├── _unpack-ieee754.js
│ │ ├── acosh/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── asinh/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── atanh/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── cbrt/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── ceil-10.js
│ │ ├── clz32/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── cosh/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── expm1/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── floor-10.js
│ │ ├── fround/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── hypot/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── imul/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── log10/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── log1p/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── log2/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── round-10.js
│ │ ├── sign/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── sinh/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── tanh/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ └── trunc/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ ├── number/
│ │ ├── #/
│ │ │ └── pad.js
│ │ ├── epsilon/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ └── is-implemented.js
│ │ ├── is-finite/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── is-integer/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── is-nan/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── is-natural.js
│ │ ├── is-number.js
│ │ ├── is-safe-integer/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── max-safe-integer/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ └── is-implemented.js
│ │ ├── min-safe-integer/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ └── is-implemented.js
│ │ ├── to-integer.js
│ │ ├── to-pos-integer.js
│ │ └── to-uint32.js
│ ├── object/
│ │ ├── _iterate.js
│ │ ├── assign/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── assign-deep.js
│ │ ├── clear.js
│ │ ├── compact.js
│ │ ├── compare.js
│ │ ├── copy-deep.js
│ │ ├── copy.js
│ │ ├── count.js
│ │ ├── create.js
│ │ ├── ensure-array.js
│ │ ├── ensure-finite-number.js
│ │ ├── ensure-integer.js
│ │ ├── ensure-natural-number-value.js
│ │ ├── ensure-natural-number.js
│ │ ├── ensure-plain-function.js
│ │ ├── ensure-plain-object.js
│ │ ├── ensure-promise.js
│ │ ├── ensure-thenable.js
│ │ ├── entries/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── eq.js
│ │ ├── every.js
│ │ ├── filter.js
│ │ ├── find-key.js
│ │ ├── find.js
│ │ ├── first-key.js
│ │ ├── flatten.js
│ │ ├── for-each.js
│ │ ├── get-property-names.js
│ │ ├── is-array-like.js
│ │ ├── is-callable.js
│ │ ├── is-copy-deep.js
│ │ ├── is-copy.js
│ │ ├── is-empty.js
│ │ ├── is-finite-number.js
│ │ ├── is-integer.js
│ │ ├── is-natural-number-value.js
│ │ ├── is-natural-number.js
│ │ ├── is-number-value.js
│ │ ├── is-object.js
│ │ ├── is-plain-function.js
│ │ ├── is-plain-object.js
│ │ ├── is-promise.js
│ │ ├── is-thenable.js
│ │ ├── is-value.js
│ │ ├── is.js
│ │ ├── key-of.js
│ │ ├── keys/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── map-keys.js
│ │ ├── map.js
│ │ ├── mixin-prototypes.js
│ │ ├── mixin.js
│ │ ├── normalize-options.js
│ │ ├── primitive-set.js
│ │ ├── safe-traverse.js
│ │ ├── serialize.js
│ │ ├── set-prototype-of/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── some.js
│ │ ├── to-array.js
│ │ ├── unserialize.js
│ │ ├── valid-callable.js
│ │ ├── valid-object.js
│ │ ├── valid-value.js
│ │ ├── validate-array-like-object.js
│ │ ├── validate-array-like.js
│ │ ├── validate-stringifiable-value.js
│ │ └── validate-stringifiable.js
│ ├── optional-chaining.js
│ ├── promise/
│ │ ├── #/
│ │ │ ├── as-callback.js
│ │ │ └── finally/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── .eslintrc.json
│ │ └── lazy.js
│ ├── reg-exp/
│ │ ├── #/
│ │ │ ├── index.js
│ │ │ ├── is-sticky.js
│ │ │ ├── is-unicode.js
│ │ │ ├── match/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── replace/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── search/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── split/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── sticky/
│ │ │ │ ├── implement.js
│ │ │ │ └── is-implemented.js
│ │ │ └── unicode/
│ │ │ ├── implement.js
│ │ │ └── is-implemented.js
│ │ ├── escape.js
│ │ ├── is-reg-exp.js
│ │ └── valid-reg-exp.js
│ ├── safe-to-string.js
│ ├── string/
│ │ ├── #/
│ │ │ ├── @@iterator/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── at.js
│ │ │ ├── camel-to-hyphen.js
│ │ │ ├── capitalize.js
│ │ │ ├── case-insensitive-compare.js
│ │ │ ├── code-point-at/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── contains/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── count.js
│ │ │ ├── ends-with/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── hyphen-to-camel.js
│ │ │ ├── indent.js
│ │ │ ├── last.js
│ │ │ ├── normalize/
│ │ │ │ ├── _data.js
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── pad.js
│ │ │ ├── plain-replace-all.js
│ │ │ ├── plain-replace.js
│ │ │ ├── repeat/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ ├── starts-with/
│ │ │ │ ├── implement.js
│ │ │ │ ├── index.js
│ │ │ │ ├── is-implemented.js
│ │ │ │ └── shim.js
│ │ │ └── uncapitalize.js
│ │ ├── format-method.js
│ │ ├── from-code-point/
│ │ │ ├── implement.js
│ │ │ ├── index.js
│ │ │ ├── is-implemented.js
│ │ │ └── shim.js
│ │ ├── is-string.js
│ │ ├── random-uniq.js
│ │ ├── random.js
│ │ └── raw/
│ │ ├── implement.js
│ │ ├── index.js
│ │ ├── is-implemented.js
│ │ └── shim.js
│ └── to-short-string-representation.js
└── to-short-string-representation.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab
trim_trailing_whitespace = true
[*.{md,yml}]
indent_size = 2
indent_style = space
[*.md]
trim_trailing_whitespace = false
================================================
FILE: .github/FUNDING.yml
================================================
github: medikoo
tidelift: "npm/es5-ext"
================================================
FILE: .github/workflows/integrate.yml
================================================
# main only
name: Integrate
on:
push:
branches: [main]
env:
FORCE_COLOR: 1
jobs:
_:
uses: medikoo/github-actions-workflows/.github/workflows/0.12-integrate.yml@main
secrets:
USER_GITHUB_TOKEN: ${{ secrets.USER_GITHUB_TOKEN }}
================================================
FILE: .github/workflows/publish.yml
================================================
# Version tags only
name: Publish
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
env:
FORCE_COLOR: 1
jobs:
_:
uses: medikoo/github-actions-workflows/.github/workflows/publish.yml@main
secrets:
USER_GITHUB_TOKEN: ${{ secrets.USER_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
================================================
FILE: .github/workflows/validate.yml
================================================
# PR's only
name: Validate
on:
pull_request:
branches: [main]
env:
FORCE_COLOR: 1
jobs:
_:
uses: medikoo/github-actions-workflows/.github/workflows/0.12-validate.yml@main
================================================
FILE: .gitignore
================================================
/node_modules
npm-debug.log
/package-lock.json
================================================
FILE: .npmignore
================================================
/.editorconfig
/.github
/.testignore
/CHANGES
/commitlint.config.js
/test
================================================
FILE: CHANGELOG.md
================================================
# Changelog
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.
### [0.10.64](https://github.com/medikoo/es5-ext/compare/v0.10.63...v0.10.64) (2024-02-27)
### Bug Fixes
- Revert update to postinstall script meant to fix Powershell issue, as it's a regression for some Linux terminals ([c2e2bb9](https://github.com/medikoo/es5-ext/commit/c2e2bb90c295c4c582445a6f03b2a3ad0b22550a))
### [0.10.63](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.63) (2024-02-23)
### Bug Fixes
- Do not rely on problematic regex ([3551cdd](https://github.com/medikoo/es5-ext/commit/3551cdd7b2db08b1632841f819d008757d28e8e2)), addresses [#201](https://github.com/medikoo/es5-ext/issues/201)
- Support ES2015+ function definitions in `function#toStringTokens()` ([a52e957](https://github.com/medikoo/es5-ext/commit/a52e95736690ad1d465ebcd9791d54570e294602)), addresses [#021](https://github.com/medikoo/es5-ext/issues/021)
- Ensure postinstall script does not crash on Windows, fixes [#181](https://github.com/medikoo/es5-ext/issues/181) ([bf8ed79](https://github.com/medikoo/es5-ext/commit/bf8ed799d57df53096da9d908ff577f305e1366f))
### Maintenance Improvements
- Simplify the manifest message ([7855319](https://github.com/medikoo/es5-ext/commit/7855319f41b9736639cf4555bd2c419f17addf55))
### [0.10.62](https://github.com/medikoo/es5-ext/compare/v0.10.61...v0.10.62) (2022-08-02)
### Maintenance Improvements
- **Manifest improvements:**
- ([#190](https://github.com/medikoo/es5-ext/issues/190)) ([b8dc53f](https://github.com/medikoo/es5-ext/commit/b8dc53fa439b98541644c64c1275f25d9f2e2235))
- ([c51d552](https://github.com/medikoo/es5-ext/commit/c51d552c03967858b8f14a4afa305338ba648cce))
### [0.10.61](https://github.com/medikoo/es5-ext/compare/v0.10.60...v0.10.61) (2022-04-20)
### Bug Fixes
- Ensure postinstall script does not error ([a0be4fd](https://github.com/medikoo/es5-ext/commit/a0be4fdacdbc3aefd6f2952b7b9215827d362bbb))
### Maintenance Improvements
- Bump dependencies ([d7e0a61](https://github.com/medikoo/es5-ext/commit/d7e0a612b7d895c1c7238c779feae1e39d4634c4))
### [0.10.60](https://github.com/medikoo/es5-ext/compare/v0.10.59...v0.10.60) (2022-04-07)
### Maintenance Improvements
- Improve `postinstall` script configuration ([ab6b121](https://github.com/medikoo/es5-ext/commit/ab6b121f0ca4f033bba9b6f400b24d07869bd716))
### [0.10.59](https://github.com/medikoo/es5-ext/compare/v0.10.58...v0.10.59) (2022-03-17)
### Maintenance Improvements
- Improve manifest wording ([#122](https://github.com/medikoo/es5-ext/issues/122)) ([eb7ae59](https://github.com/medikoo/es5-ext/commit/eb7ae59966774a8c26f1717415c627d90bb3d954))
- Update data in manifest ([3d2935a](https://github.com/medikoo/es5-ext/commit/3d2935ac6f1a0969c7569840d5b3bdeed6940e56))
### [0.10.58](https://github.com/medikoo/es5-ext/compare/v0.10.57...v0.10.58) (2022-03-11)
### Maintenance Improvements
- Improve "call for peace" manifest ([3beace4](https://github.com/medikoo/es5-ext/commit/3beace4b3d00f02da61b72dd328f90cf069d46de))
### [0.10.57](https://github.com/medikoo/es5-ext/compare/v0.10.56...v0.10.57) (2022-03-08)
### Bug Fixes
- Workaround `postinstall` script prevent npx error ([#110](https://github.com/medikoo/es5-ext/issues/110)) ([e212d5a](https://github.com/medikoo/es5-ext/commit/e212d5a0adf186f1fadf85fdc07aab25085ee097)) ([martindrq](https://github.com/martindrq))
### [0.10.56](https://github.com/medikoo/es5-ext/compare/v0.10.55...v0.10.56) (2022-03-07)
### Maintenance Improvements
- Add missing shebang to postinstall script ([e423fd7](https://github.com/medikoo/es5-ext/commit/e423fd7264c4f145921e461037d571b35b6a9833))
### [0.10.55](https://github.com/medikoo/es5-ext/compare/v0.10.54...v0.10.55) (2022-03-07)
### Maintenance Improvements
- Configure `.npmignore` file (exclude tests from publication) ([d3ed4b6](https://github.com/medikoo/es5-ext/commit/d3ed4b6a873900a2abf3957bbebdcf18c4e564e0))
### [0.10.54](https://github.com/medikoo/es5-ext/compare/v0.10.53...v0.10.54) (2022-03-07)
### Maintenance Improvements
- Convert dependency ranges ([765eb8e](https://github.com/medikoo/es5-ext/commit/765eb8e897cabc76f0351443d84b4843a1187b27))
- Give Peace a Chance ([28de285](https://github.com/medikoo/es5-ext/commit/28de285ed433b45113f01e4ce7c74e9a356b2af2))
### [0.10.53](https://github.com/medikoo/es5-ext/compare/v0.10.52...v0.10.53) (2019-11-21)
_Maintenance improvements_
### [0.10.52](https://github.com/medikoo/es5-ext/compare/v0.10.51...v0.10.52) (2019-10-29)
### Bug Fixes
- Fix global resolution for Safari ([00731d2](https://github.com/medikoo/es5-ext/commit/00731d2))
- Keep support for old Node.js versions ([2fa2a11](https://github.com/medikoo/es5-ext/commit/2fa2a11))
### [0.10.51](https://github.com/medikoo/es5-ext/compare/v0.10.50...v0.10.51) (2019-08-30)
### Bug Fixes
- Ensure Function.isFunction recognizes async functions ([6f06e66](https://github.com/medikoo/es5-ext/commit/6f06e66))
### Tests
- Fix after prettification changes ([dd6fc3f](https://github.com/medikoo/es5-ext/commit/dd6fc3f))
## [0.10.50](https://github.com/medikoo/es5-ext/compare/v0.10.49...v0.10.50) (2019-04-30)
### Bug Fixes
- maximum time value reference ([708202d](https://github.com/medikoo/es5-ext/commit/708202d))
### Features
- ensure global resolves in strict mode ([c6a19d7](https://github.com/medikoo/es5-ext/commit/c6a19d7)), closes [#86](https://github.com/medikoo/es5-ext/issues/86)
## [0.10.49](https://github.com/medikoo/es5-ext/compare/v0.10.48...v0.10.49) (2019-03-11)
### Features
- allow plain function usage of fn.compose ([2bafef7](https://github.com/medikoo/es5-ext/commit/2bafef7))
## [0.10.48](https://github.com/medikoo/es5-ext/compare/v0.10.47...v0.10.48) (2019-02-22)
### Features
- Object.ensurePlainObject util ([f48fbcf](https://github.com/medikoo/es5-ext/commit/f48fbcf))
<a name="0.10.47"></a>
## [0.10.47](https://github.com/medikoo/es5-ext/compare/v0.10.46...v0.10.47) (2019-01-16)
### Features
- Promise.prototype.finally shim ([4dadbc7](https://github.com/medikoo/es5-ext/commit/4dadbc7))
<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)
### Features
- String.random util ([7c28739](https://github.com/medikoo/es5-ext/commit/7c28739))
<a name="0.10.36"></a>
## [0.10.36](https://github.com/medikoo/es5-ext/compare/v0.10.35...v0.10.36) (2017-11-23)
### Features
- **date:** isTimeValue and ensureTimeValue utils ([7659dc5](https://github.com/medikoo/es5-ext/commit/7659dc5))
<a name="0.10.35"></a>
## [0.10.35](https://github.com/medikoo/es5-ext/compare/v0.10.34...v0.10.35) (2017-10-13)
### Bug Fixes
- **Object.copy:** do not upgrade primitives to objects ([dd4d88f](https://github.com/medikoo/es5-ext/commit/dd4d88f))
<a name="0.10.34"></a>
## [0.10.34](https://github.com/medikoo/es5-ext/compare/v0.10.33...v0.10.34) (2017-10-13)
### Features
- **copyDeep:** duplicate only recursive instances ([bba529a](https://github.com/medikoo/es5-ext/commit/bba529a))
<a name="0.10.33"></a>
## [0.10.33](https://github.com/medikoo/es5-ext/compare/v0.10.32...v0.10.33) (2017-10-13)
### Bug Fixes
- **Object.assignDeep:** relax input validation ([1baf57d](https://github.com/medikoo/es5-ext/commit/1baf57d))
<a name="0.10.32"></a>
## [0.10.32](https://github.com/medikoo/es5-ext/compare/v0.10.31...v0.10.32) (2017-10-13)
### Features
- Object.assignDeep ([2345e0b](https://github.com/medikoo/es5-ext/commit/2345e0b))
<a name="0.10.31"></a>
## [0.10.31](https://github.com/medikoo/es5-ext/compare/v0.10.30...v0.10.31) (2017-10-09)
### Features
- Object.isPlainFunction utility ([031be0a](https://github.com/medikoo/es5-ext/commit/031be0a))
<a name="0.10.30"></a>
## [0.10.30](https://github.com/medikoo/es5-ext/compare/v0.10.29...v0.10.30) (2017-08-25)
### Bug Fixes
- value stringification for error message ([37bb96b](https://github.com/medikoo/es5-ext/commit/37bb96b))
<a name="0.10.29"></a>
## [0.10.29](https://github.com/medikoo/es5-ext/compare/v0.10.28...v0.10.29) (2017-08-18)
### Bug Fixes
- string.repeat after recent regression ([b02fab4](https://github.com/medikoo/es5-ext/commit/b02fab4))
<a name="0.10.28"></a>
## [0.10.28](https://github.com/medikoo/es5-ext/compare/v0.10.27...v0.10.28) (2017-08-18)
### Features
- array.isEmpty method ([b0cfbdd](https://github.com/medikoo/es5-ext/commit/b0cfbdd))
- improve new lines representation ([860fe8b](https://github.com/medikoo/es5-ext/commit/860fe8b))
- Object.ensureArray util ([595c341](https://github.com/medikoo/es5-ext/commit/595c341))
- toShortStringRepresentation util ([6842d06](https://github.com/medikoo/es5-ext/commit/6842d06))
<a name="0.10.27"></a>
## [0.10.27](https://github.com/medikoo/es5-ext/compare/v0.10.26...v0.10.27) (2017-08-11)
### Bug Fixes
- isNumberValue should not crash on non-coercible values ([0db765e](https://github.com/medikoo/es5-ext/commit/0db765e))
### Features
- add Object.ensureFiniteNumber util ([11c67f5](https://github.com/medikoo/es5-ext/commit/11c67f5))
- add Object.isFiniteNumber util ([fe5b55a](https://github.com/medikoo/es5-ext/commit/fe5b55a))
<a name="0.10.26"></a>
## [0.10.26](https://github.com/medikoo/es5-ext/compare/v0.10.25...v0.10.26) (2017-08-02)
### Bug Fixes
- **general:** ensure optionalChaining in index ([3df879a](https://github.com/medikoo/es5-ext/commit/3df879a))
<a name="0.10.25"></a>
## [0.10.25](https://github.com/medikoo/es5-ext/compare/v0.10.24...v0.10.25) (2017-08-02)
### Features
- **general:** optionalChaining utility ([26332b5](https://github.com/medikoo/es5-ext/commit/26332b5))
<a name="0.10.24"></a>
## [0.10.24](https://github.com/medikoo/es5-ext/compare/v0.10.23...v0.10.24) (2017-07-10)
### Features
- resolve global with CSP safe method ([d386449](https://github.com/medikoo/es5-ext/commit/d386449))
<a name="0.10.23"></a>
## [0.10.23](https://github.com/medikoo/es5-ext/compare/v0.10.22...v0.10.23) (2017-06-05)
### Bug Fixes
- **Error.custom:** allow non-string code ([e8db3a0](https://github.com/medikoo/es5-ext/commit/e8db3a0))
- **Error.custom:** improve `ext` argument detection ([0edbfbc](https://github.com/medikoo/es5-ext/commit/0edbfbc))
<a name="0.10.22"></a>
## [0.10.22](https://github.com/medikoo/es5-ext/compare/v0.10.21...v0.10.22) (2017-05-31)
### Bug Fixes
- ensure proper symbols stringification in early implementations ([ce51900](https://github.com/medikoo/es5-ext/commit/ce51900))
<a name="0.10.21"></a>
## [0.10.21](https://github.com/medikoo/es5-ext/compare/v0.10.20...v0.10.21) (2017-05-22)
### Features
- support arrow functions in Function/#/to-tring-tokens.js ([ad3de1e](https://github.com/medikoo/es5-ext/commit/ad3de1e))
<a name="0.10.20"></a>
## [0.10.20](https://github.com/medikoo/es5-ext/compare/v0.10.19...v0.10.20) (2017-05-17)
### Features
- if listed copy not only if own property ([d7e7cef](https://github.com/medikoo/es5-ext/commit/d7e7cef))
- support `ensure` option in Object.copy ([295326f](https://github.com/medikoo/es5-ext/commit/295326f))
<a name="0.10.19"></a>
## [0.10.19](https://github.com/medikoo/es5-ext/compare/v0.10.18...v0.10.19) (2017-05-17)
### Features
- support propertyNames option in Object.copy ([5442279](https://github.com/medikoo/es5-ext/commit/5442279))
<a name="0.10.18"></a>
## [0.10.18](https://github.com/medikoo/es5-ext/compare/v0.10.17...v0.10.18) (2017-05-15)
### Bug Fixes
- take all changes in safeToString ([3c5cd12](https://github.com/medikoo/es5-ext/commit/3c5cd12))
<a name="0.10.17"></a>
## [0.10.17](https://github.com/medikoo/es5-ext/compare/v0.10.16...v0.10.17) (2017-05-15)
### Features
- introduce Object.ensurePromise ([46a2f45](https://github.com/medikoo/es5-ext/commit/46a2f45))
- introduce Object.isPromise ([27aecc8](https://github.com/medikoo/es5-ext/commit/27aecc8))
- introduce safeToString ([0cc6a7b](https://github.com/medikoo/es5-ext/commit/0cc6a7b))
<a name="0.10.16"></a>
## [0.10.16](https://github.com/medikoo/es5-ext/compare/v0.10.15...v0.10.16) (2017-05-09)
### Features
- add String.prototype.count ([2e53241](https://github.com/medikoo/es5-ext/commit/2e53241))
## Changelog for previous versions
See `CHANGES` file
================================================
FILE: CHANGES
================================================
For recent changelog see CHANGELOG.md
-----
v0.10.15 -- 2017.03.20
* Fix Object.isValue (it was actually isNotValue)
v0.10.14 -- 2017.03.15
* Object.isValue util
v0.10.13 -- 2017.03.13
* Introduce JSON.safeStringify
* Improve message handling in error/custom
* Fix Array#concat shim
* Improve Array#flatten algorithm so it's stack trace friendly
* Make Object.isObject ES3 compatible
v0.10.12 -- 2016.07.01
* Ensure symbols are copied in Object.mixin
* Prevent RangeError errors in array#flatten
* Do not validate invalidate dates in validDate
v0.10.11 -- 2015.12.18
* Ensure that check for implementation of RegExp flags doesn't crash in V8 (thanks @mathiasbynens)
v0.10.10 -- 2015.12.11
* Add Object.isNumberValue util
v0.10.9 -- 2015.12.01
* Add Object.ensureNaturalNumber and Object.ensureNaturalNumberValue
v0.10.8 -- 2015.10.02
* Add Number.isNatural
* Add Object.find and Object.findKey
* Support arrays in Object.copyDeep
* Fix iteration issue in forEachRight and someRight
* Fix detection of native sinh
* Depend on es6-symbol v3
v0.10.7 -- 2015.04.22
* New utlitities. They're convention differs from v0.10, as they were supposed to land in v1.
Still they're non breaking and start the conventions to be used in v1
* Object.validateArrayLike
* Object.validateArrayLikeObject
* Object.validateStringifiable
* Object.validateStringifiableValue
* Universal utilities for array-like/iterable objects
* Iterable.is
* Iterable.validate
* Iterable.validateObject
* Iterable.forEach
* Fix camelToHyphen resolution, it must be absolutely reversable by hyphenToCamel
* Fix calculations of large numbers in Math.tanh
* Fix algorithm of Math.sinh
* Fix indexes to not use real symbols
* Fix length of String.fromCodePoint
* Fix tests of Array#copyWithin
* Update Travis CI configuration
v0.10.6 -- 2015.02.02
* Fix handling of infinite values in Math.trunc
* Fix handling of getters in Object.normalizeOptions
v0.10.5 -- 2015.01.20
* Add Function#toStringTokens
* Add Object.serialize and Object.unserialize
* Add String.randomUniq
* Fix Strin#camelToHyphen issue with tokens that end with digit
* Optimise Number.isInteger logic
* Improve documentation
* Configure lint scripts
* Fix spelling of LICENSE
v0.10.4 -- 2014.04.30
* Assure maximum spec compliance of Array.of and Array.from (thanks @mathiasbynens)
* Improve documentations
v0.10.3 -- 2014.04.29
Provide accurate iterators handling:
* Array.from improvements:
* Assure right unicode symbols resolution when processing strings in Array.from
* Rely on ES6 symbol shim and use native @@iterator Symbol if provided by environment
* Add methods:
* Array.prototype.entries
* Array.prototype.keys
* Array.prototype.values
* Array.prototype[@@iterator]
* String.prototype[@@iterator]
Improve documentation
v0.10.2 -- 2014.04.24
- Simplify and deprecate `isCallable`. It seems in ES5 based engines there are
no callable objects which are `typeof obj !== 'function'`
- Update Array.from map callback signature (up to latest resolution of TC39)
- Improve documentation
v0.10.1 -- 2014.04.14
Bump version for npm
(Workaround for accidental premature publish & unpublish of v0.10.0 a while ago)
v0.10.0 -- 2014.04.13
Major update:
- All methods and function specified for ECMAScript 6 are now introduced as
shims accompanied with functions through which (optionally) they can be
implementend on native objects
- Filename convention was changed to shorter and strictly lower case names. e.g.
`lib/String/prototype/starts-with` became `string/#/starts-with`
- Generated functions are guaranteed to have expected length
- Objects with null prototype (created via `Object.create(null)`) are widely
supported (older version have crashed due to implied `obj.hasOwnProperty` and
related invocations)
- Support array subclasses
- When handling lists do not limit its length to Uint32 range
- Use newly introduced `Object.eq` for strict equality in place of `Object.is`
- Iteration of Object have been improved so properties that were hidden or
removed after iteration started are not iterated.
Additions:
- `Array.isPlainArray`
- `Array.validArray`
- `Array.prototype.concat` (as updated with ES6)
- `Array.prototype.copyWithin` (as introduced with ES6)
- `Array.prototype.fill` (as introduced with ES6)
- `Array.prototype.filter` (as updated with ES6)
- `Array.prototype.findIndex` (as introduced with ES6)
- `Array.prototype.map` (as updated with ES6)
- `Array.prototype.separate`
- `Array.prototype.slice` (as updated with ES6)
- `Array.prototype.splice` (as updated with ES6)
- `Function.prototype.copy`
- `Math.acosh` (as introduced with ES6)
- `Math.atanh` (as introduced with ES6)
- `Math.cbrt` (as introduced with ES6)
- `Math.clz32` (as introduced with ES6)
- `Math.cosh` (as introduced with ES6)
- `Math.expm1` (as introduced with ES6)
- `Math.fround` (as introduced with ES6)
- `Math.hypot` (as introduced with ES6)
- `Math.imul` (as introduced with ES6)
- `Math.log2` (as introduced with ES6)
- `Math.log10` (as introduced with ES6)
- `Math.log1p` (as introduced with ES6)
- `Math.sinh` (as introduced with ES6)
- `Math.tanh` (as introduced with ES6)
- `Math.trunc` (as introduced with ES6)
- `Number.EPSILON` (as introduced with ES6)
- `Number.MIN_SAFE_INTEGER` (as introduced with ES6)
- `Number.MAX_SAFE_INTEGER` (as introduced with ES6)
- `Number.isFinite` (as introduced with ES6)
- `Number.isInteger` (as introduced with ES6)
- `Number.isSafeInteger` (as introduced with ES6)
- `Object.create` (with fix for V8 issue which disallows prototype turn of
objects derived from null
- `Object.eq` - Less restrictive version of `Object.is` based on SameValueZero
algorithm
- `Object.firstKey`
- `Object.keys` (as updated with ES6)
- `Object.mixinPrototypes`
- `Object.primitiveSet`
- `Object.setPrototypeOf` (as introduced with ES6)
- `Object.validObject`
- `RegExp.escape`
- `RegExp.prototype.match` (as introduced with ES6)
- `RegExp.prototype.replace` (as introduced with ES6)
- `RegExp.prototype.search` (as introduced with ES6)
- `RegExp.prototype.split` (as introduced with ES6)
- `RegExp.prototype.sticky` (as introduced with ES6)
- `RegExp.prototype.unicode` (as introduced with ES6)
- `String.fromCodePoint` (as introduced with ES6)
- `String.raw` (as introduced with ES6)
- `String.prototype.at`
- `String.prototype.codePointAt` (as introduced with ES6)
- `String.prototype.normalize` (as introduced with ES6)
- `String.prototype.plainReplaceAll`
Removals:
- `reserved` set
- `Array.prototype.commonLeft`
- `Function.insert`
- `Function.remove`
- `Function.prototype.silent`
- `Function.prototype.wrap`
- `Object.descriptor` Move to external `d` project.
See: https://github.com/medikoo/d
- `Object.diff`
- `Object.extendDeep`
- `Object.reduce`
- `Object.values`
- `String.prototype.trimCommonLeft`
Renames:
- `Function.i` into `Function.identity`
- `Function.k` into `Function.constant`
- `Number.toInt` into `Number.toInteger`
- `Number.toUint` into `Number.toPosInteger`
- `Object.extend` into `Object.assign` (as introduced in ES 6)
- `Object.extendProperties` into `Object.mixin`, with improved internal
handling, so it matches temporarily specified `Object.mixin` for ECMAScript 6
- `Object.isList` into `Object.isArrayLike`
- `Object.mapToArray` into `Object.toArray` (with fixed function length)
- `Object.toPlainObject` into `Object.normalizeOptions` (as this is the real
use case where we use this function)
- `Function.prototype.chain` into `Function.prototype.compose`
- `Function.prototype.match` into `Function.prototype.spread`
- `String.prototype.format` into `String.formatMethod`
Improvements & Fixes:
- Remove workaround for primitive values handling in object iterators
- `Array.from`: Update so it follows ES 6 spec
- `Array.prototype.compact`: filters just null and undefined values
(not all falsies)
- `Array.prototype.eIndexOf` and `Array.prototype.eLastIndexOf`: fix position
handling, improve internals
- `Array.prototype.find`: return undefined not null, in case of not found
(follow ES 6)
- `Array.prototype.remove` fix function length
- `Error.custom`: simplify, Custom class case is addressed by outer
`error-create` project -> https://github.com/medikoo/error-create
- `Error.isError` true only for Error instances (remove detection of host
Exception objects)
- `Number.prototype.pad`: Normalize negative pad
- `Object.clear`: Handle errors same way as in `Object.assign`
- `Object.compact`: filters just null and undefined values (not all falsies)
- `Object.compare`: Take into account NaN values
- `Object.copy`: Split into `Object.copy` and `Object.copyDeep`
- `Object.isCopy`: Separate into `Object.isCopy` and `Object.isCopyDeep`, where
`isCopyDeep` handles nested plain objects and plain arrays only
- `String.prototype.endsWith`: Adjust up to ES6 specification
- `String.prototype.repeat`: Adjust up to ES6 specification and improve algorithm
- `String.prototype.simpleReplace`: Rename into `String.prototype.plainReplace`
- `String.prototype.startsWith`: Adjust up to ES6 specification
- Update lint rules, and adjust code to that
- Update Travis CI configuration
- Remove Makefile (it's cross-env utility)
v0.9.2 -- 2013.03.11
Added:
* Array.prototype.isCopy
* Array.prototype.isUniq
* Error.CustomError
* Function.validFunction
* Object.extendDeep
* Object.descriptor.binder
* Object.safeTraverse
* RegExp.validRegExp
* String.prototype.capitalize
* String.prototype.simpleReplace
Fixed:
* Fix Array.prototype.diff for sparse arrays
* Accept primitive objects as input values in Object iteration methods and
Object.clear, Object.count, Object.diff, Object.extend,
Object.getPropertyNames, Object.values
* Pass expected arguments to callbacks of Object.filter, Object.mapKeys,
Object.mapToArray, Object.map
* Improve callable callback support in Object.mapToArray
v0.9.1 -- 2012.09.17
* Object.reduce - reduce for hash-like collections
* Accapt any callable object as callback in Object.filter, mapKeys and map
* Convention cleanup
v0.9.0 -- 2012.09.13
We're getting to real solid API
Removed:
* Function#memoize - it's grown up to be external package, to be soon published
as 'memoizee'
* String.guid - it doesn't fit es5-ext (extensions) concept, will be provided as
external package
# Function.arguments - obsolete
# Function.context - obsolete
# Function#flip - not readable when used, so it was never used
# Object.clone - obsolete and confusing
Added:
* String#camelToHyphen - String format convertion
Renamed:
* String#dashToCamelCase -> String#hyphenToCamel
Fixes:
* Object.isObject - Quote names in literals that match reserved keywords
(older implementations crashed on that)
* String#repeat - Do not accept negative values (coerce them to 1)
Improvements:
* Array#remove - Accepts many arguments, we can now remove many values at once
* Object iterators (forEach, map, some) - Compare function invoked with scope
object bound to this
* Function#curry - Algorithm cleanup
* Object.isCopy - Support for all types, not just plain objects
* Object.isPlainObject - Support for cross-frame objects
* Do not memoize any of the functions, it shouldn't be decided internally
* Remove Object.freeze calls in reserved, it's not up to convention
* Improved documentation
* Better linting (hard-core approach using both JSLint mod and JSHint)
* Optional arguments are now documented in funtions signature
v0.8.2 -- 2012.06.22
Fix errors in Array's intersection and exclusion methods, related to improper
usage of contains method
v0.8.1 -- 2012.06.13
Reorganized internal logic of Function.prototype.memoize. So it's more safe now
and clears cache properly. Additionally preventCache option was provided.
v0.8.0 -- 2012.05.28
Again, major overhaul. Probably last experimental stuff was trashed, all API
looks more like standard extensions now.
Changes:
* Turn all Object.prototype extensions into functions and move them to Object
namespace. We learned that extending Object.prototype is bad idea in any case.
* Rename Function.prototype.curry into Function.prototype.partial. This function
is really doing partial application while currying is slightly different
concept.
* Convert Function.prototype.ncurry to new implementation of
Function.prototype.curry, it now serves real curry concept additionaly it
covers use cases for aritize and hold, which were removed.
* Rename Array's peek to last, and provide support for sparse arrays in it
* Rename Date's monthDaysCount into daysInMonth
* Simplify object iterators, now order of iteration can be configured with just
compareFn argument (no extra byKeys option)
* Rename Object.isDuplicate to Object.isCopy
* Rename Object.isEqual to Object.is which is compatible with future 'is'
keyword
* Function.memoize is now Function.prototype.memoize. Additionally clear cache
functionality is added, and access to original arguments object.
* Rename validation functions: assertNotNull to validValue, assertCallable to
validCallable. validValue was moved to Object namespace. On success they now
return validated value instead of true, it supports better composition.
Additionally created Date.validDate and Error.validError
* All documentation is now held in README.md not in code files.
* Move guid to String namespace. All guids now start with numbers.
* Array.generate: fill argument is now optional
* Object.toArray is now Array.from (as new ES6 specification draft suggests)
* All methods that rely on indexOf or lastIndexOf, now rely on egal (Object.is)
versions of them (eIndexOf, eLastIndexOf)
* Turn all get* functions that returned methods into actuall methods (get*
functionality can still be achieved with help of Function.prototype.partial).
So: Date.getFormat is now Date.prototype.format,
Number.getPad is now Number.prototype.pad,
String.getFormat is now String.prototype.format,
String.getIndent is now String.prototype.indent,
String.getPad is now String.prototype.pad
* Refactored Object.descriptor, it is now just two functions, main one and
main.gs, main is for describing values, and gs for describing getters and
setters. Configuration is passed with first argument as string e.g. 'ce' for
configurable and enumerable. If no configuration string is provided then by
default it returns configurable and writable but not enumerable for value or
configurable but not enumerable for getter/setter
* Function.prototype.silent now returns prepared function (it was
expected to be fixed for 0.7)
* Reserved keywords map (reserved) is now array not hash.
* Object.merge is now Object.extend (while former Object.extend was completely
removed) - 'extend' implies that we change object, not creating new one (as
'merge' may imply). Similarily Object.mergeProperties was renamed to
Object.extendProperties
* Position argument support in Array.prototype.contains and
String.prototype.contains (so it follows ES6 specification draft)
* endPosition argument support in String.prototype.endsWith and fromPosition
argument support in String.prototype.startsWith (so it follows ES6
specification draft)
* Better and cleaner String.prototype.indent implementation. No default value
for indent string argument, optional nest value (defaults to 1), remove
nostart argument
* Correct length values for most methods (so they reflect length of similar
methods in standard)
* Length argument is now optional in number and string pad methods.
* Improve arguments validation in general, so it adheres to standard conventions
* Fixed format of package.json
Removed methods and functions:
* Object.prototype.slice - Object is not ordered collection, so slice doesn't
make sense.
* Function's rcurry, rncurry, s - too cumbersome for JS, not many use cases for
that
* Function.prototype.aritize and Function.prototype.hold - same functionality
can be achieved with new Function.prototype.curry
* Function.prototype.log - provided more generic Function.prototype.wrap for
same use case
* getNextIdGenerator - no use case for that (String.guid should be used if
needed)
* Object.toObject - Can be now acheived with Object(validValue(x))
* Array.prototype.someValue - no real use case (personally used once and
case was already controversial)
* Date.prototype.duration - moved to external package
* Number.getAutoincrement - No real use case
* Object.prototype.extend, Object.prototype.override,
Object.prototype.plainCreate, Object.prototype.plainExtend - It was probably
too complex, same should be achieved just with Object.create,
Object.descriptor and by saving references to super methods in local scope.
* Object.getCompareBy - Functions should be created individually for each use
case
* Object.get, Object.getSet, Object.set, Object.unset - Not many use cases and
same can be easily achieved with simple inline function
* String.getPrefixWith - Not real use case for something that can be easily
achieved with '+' operator
* Object.isPrimitive - It's just negation of Object.isObject
* Number.prototype.isLess, Number.prototype.isLessOrEqual - they shouldn't be in
Number namespace and should rather be addressed with simple inline functions.
* Number.prototype.subtract - Should rather be addressed with simple inline
function
New methods and functions:
* Array.prototype.lastIndex - Returns last declared index in array
* String.prototype.last - last for strings
* Function.prototype.wrap - Wrap function with other, it allows to specify
before and after behavior transform return value or prevent original function
from being called.
* Math.sign - Returns sign of a number (already in ES6 specification draft)
* Number.toInt - Converts value to integer (already in ES6 specification draft)
* Number.isNaN - Returns true if value is NaN (already in ES6 specification
draft)
* Number.toUint - Converts value to unsigned integer
* Number.toUint32 - Converts value to 32bit unsigned integer
* Array.prototype.eIndexOf, eLastIndexOf - Egal version (that uses Object.is) of
standard methods (all methods that were using native indexOf or lastIndexOf
now uses eIndexOf and elastIndexOf respectively)
* Array.of - as it's specified for ES6
Fixes:
* Fixed binarySearch so it always returns valid list index
* Object.isList - it failed on lists that are callable (e.g. NodeList in Nitro
engine)
* Object.map now supports third argument for callback
v0.7.1 -- 2012.01.05
New methods:
* Array.prototype.firstIndex - returns first valid index of array (for
sparse arrays it may not be '0'
Improvements:
* Array.prototype.first - now returns value for index returned by firstIndex
* Object.prototype.mapToArray - can be called without callback, then array of
key-value pairs is returned
Fixes
* Array.prototype.forEachRight, object's length read through UInt32 conversion
v0.7.0 -- 2011.12.27
Major update.
Stepped back from experimental ideas and introduced more standard approach
taking example from how ES5 methods and functions are designed. One exceptions
is that, we don’t refrain from declaring methods for Object.prototype - it’s up
to developer whether how he decides to use it in his context (as function or as
method).
In general:
* Removed any method 'functionalization' and functionalize method itself.
es5-ext declares plain methods, which can be configured to work as functions
with call.bind(method) - see documentation.
* Removed separation of Object methods for ES5 (with descriptors) and
ES3 (plain) - we're following ES5 idea on that, some methods are intended just
for enumerable properties and some are for all properties, all are declared
for Object.prototype
* Removed separation of Array generic (collected in List folder) and not generic
methods (collected in Array folder). Now all methods are generic and are in
Array/prototype folder. This separation also meant, that methods in Array are
usually destructive. We don’t do that separation now, there’s generally no use
case for destructive iterators, we should be fine with one version of each
method, (same as ES5 is fine with e.g. one, non destructive 'filter' method)
* Folder structure resembles tree of native ES5 Objects
* All methods are written with ES5 conventions in mind, it means that most
methods are generic and can be run on any object. In more detail:
** Array.prototype and Object.prototype methods can be run on any object (any
not null or undefined value),
** Date.prototype methods should be called only on Date instances.
** Function.prototype methods can be called on any callable objects (not
necessarily functions)
** Number.prototype & String.prototype methods can be called on any value, in
case of Number it it’ll be degraded to number, in case of string it’ll be
degraded to string.
* Travis CI support (only for Node v0.6 branch, as v0.4 has buggy V8 version)
Improvements for existing functions and methods:
* Function.memoize (was Function.cache) is now fully generic, can operate on any
type of arguments and it’s NaN safe (all NaN objects are considered equal)
* Method properties passed to Object.prototype.extend or
Object.prototype.override can aside of _super optionally take prototype object
via _proto argument
* Object iterators: forEach, mapToArray and every can now iterate in specified
order
* pluck, invoke and other functions that return reusable functions or methods
have now their results memoized.
New methods:
* Global: assertNotNull, getNextIdGenerator, guid, isEqual, isPrimitive,
toObject
* Array: generate
* Array.prototype: binarySearch, clear, contains, diff, exclusion, find, first,
forEachRight, group, indexesOf, intersection, remove, someRight, someValue
* Boolean: isBoolean
* Date: isDate
* Function: arguments, context, insert, isArguments, remove
* Function.prototype: not, silent
* Number: getAutoincrement, isNumber
* Number.prototype: isLessOrEqual, isLess, subtract
* Object: assertCallable, descriptor (functions for clean descriptors),
getCompareBy, isCallable, isObject
* Object.prototype: clone (real clone), compact, count, diff, empty,
getPropertyNames, get, keyOf, mapKeys, override, plainCreate, plainExtend,
slice, some, unset
* RegExp: isRegExp
* String: getPrefixWith, isString
* String.prototype: caseInsensitiveCompare, contains, isNumeric
Renamed methods:
* Date.clone -> Date.prototype.copy
* Date.format -> Date.getFormat
* Date/day/floor -> Date.prototype.floorDay
* Date/month/floor -> Date.prototype.floorMonth
* Date/month/year -> Date.prototype.floorYear
* Function.cache -> Function.memoize
* Function.getApplyArg -> Function.prototype.match
* Function.sequence -> Function.prototype.chain
* List.findSameStartLength -> Array.prototype.commonLeft
* Number.pad -> Number.getPad
* Object/plain/clone -> Object.prototype.copy
* Object/plain/elevate -> Object.prototype.flatten
* Object/plain/same -> Object.prototype.isDuplicate
* Object/plain/setValue -> Object.getSet
* String.format -> String.getFormat
* String.indent -> String.getIndent
* String.pad -> String.getPad
* String.trimLeftStr -> String.prototype.trimCommonLeft
* Object.merge -> Object.prototype.mergeProperties
* Object/plain/pluck -> Object.prototype.get
* Array.clone is now Array.prototype.copy and can be used also on any array-like
objects
* List.isList -> Object.isList
* List.toArray -> Object.prototype.toArray
* String/convert/dashToCamelCase -> String.prototype.dashToCamelCase
Removed methods:
* Array.compact - removed destructive version (that operated on same array), we
have now non destructive version as Array.prototype.compact.
* Function.applyBind -> use apply.bind directly
* Function.bindBind -> use bind.bind directly
* Function.callBind -> use call.bind directly
* Fuction.clone -> no valid use case
* Function.dscope -> controversial approach, shouldn’t be considered seriously
* Function.functionalize -> It was experimental but standards are standards
* List/sort/length -> It can be easy obtained by Object.getCompareBy(‘length’)
* List.concat -> Concat’s for array-like’s makes no sense, just convert to array
first
* List.every -> Use Array.prototype.every directly
* List.filter -> Use Array.prototype.filter directly
* List.forEach -> User Array.prototype.forEach directly
* List.isListObject -> No valid use case, do: isList(list) && (typeof list ===
'object’)
* List.map -> Use Array.prototype.map directly
* List.reduce -> Use Array.prototype.reduce directly
* List.shiftSame -> Use Array.prototype.commonLeft and do slice
* List.slice -> Use Array.prototype.slice directly
* List.some -> Use Array.prototype.some directly
* Object.bindMethods -> it was version that considered descriptors, we have now
Object.prototype.bindMethods which operates only on enumerable properties
* Object.every -> version that considered all properties, we have now
Object.prototype.every which iterates only enumerables
* Object.invoke -> no use case
* Object.mergeDeep -> no use case
* Object.pluck -> no use case
* Object.same -> it considered descriptors, now there’s only Object.isDuplicate
which compares only enumerable properties
* Object.sameType -> no use case
* Object.toDescriptor and Object.toDescriptors -> replaced by much nicer
Object.descriptor functions
* Object/plain/link -> no use case (it was used internally only by
Object/plain/merge)
* Object/plain/setTrue -> now easily configurable by more universal
Object.getSet(true)
* String.trimRightStr -> Eventually String.prototype.trimCommonRight will be
added
v0.6.3 -- 2011.12.12
* Cleared npm warning for misnamed property in package.json
v0.6.2 -- 2011.08.12
* Calling String.indent without scope (global scope then) now treated as calling
it with null scope, it allows more direct invocations when using default nest
string: indent().call(str, nest)
v0.6.1 -- 2011.08.08
* Added TAD test suite to devDependencies, configured test commands.
Tests can be run with 'make test' or 'npm test'
v0.6.0 -- 2011.08.07
New methods:
* Array: clone, compact (in place)
* Date: format, duration, clone, monthDaysCount, day.floor, month.floor,
year.floor
* Function: getApplyArg, , ncurry, rncurry, hold, cache, log
* List: findSameStartLength, shiftSame, peek, isListObject
* Number: pad
* Object: sameType, toString, mapToArray, mergeDeep, toDescriptor,
toDescriptors, invoke
* String: startsWith, endsWith, indent, trimLeftStr, trimRightStr, pad, format
Fixed:
* Object.extend does now prototypal extend as exptected
* Object.merge now tries to overwrite only configurable properties
* Function.flip
Improved:
* Faster List.toArray
* Better global retrieval
* Functionalized all Function methods
* Renamed bindApply and bindCall to applyBind and callBind
* Removed Function.inherit (as it's unintuitive curry clone)
* Straightforward logic in Function.k
* Fixed naming of some tests files (letter case issue)
* Renamed Function.saturate into Function.lock
* String.dashToCamelCase digits support
* Strings now considered as List objects
* Improved List.compact
* Concise logic for List.concat
* Test wit TAD in clean ES5 context
v0.5.1 -- 2011.07.11
* Function's bindBind, bindCall and bindApply now more versatile
v0.5.0 -- 2011.07.07
* Removed Object.is and List.apply
* Renamed Object.plain.is to Object.plain.isPlainObject (keep naming convention
consistent)
* Improved documentation
v0.4.0 -- 2011.07.05
* Take most functions on Object to Object.plain to keep them away from object
descriptors
* Object functions with ES5 standard in mind (object descriptors)
v0.3.0 -- 2011.06.24
* New functions
* Consistent file naming (dash instead of camelCase)
v0.2.1 -- 2011.05.28
* Renamed Functions.K and Function.S to to lowercase versions (use consistent
naming)
v0.2.0 -- 2011.05.28
* Renamed Array folder to List (as its generic functions for array-like objects)
* Added Makefile
* Added various functions
v0.1.0 -- 2011.05.24
* Initial version
================================================
FILE: LICENSE
================================================
ISC License
Copyright (c) 2011-2024, Mariusz Nowak, @medikoo, medikoo.com
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 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.
================================================
FILE: README.md
================================================
[![Build status][build-image]][build-url]
[![Tests coverage][cov-image]][cov-url]
[![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.
It's designed to be used in compliant ECMAScript 5 or ECMAScript 6 environments. Older environments are not supported, although most of the features should work with correct ECMAScript 5 shim on board.
When used in ECMAScript 6 environment, native implementation (if valid) takes precedence over shims.
### Installation
```bash
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
#### ECMAScript 6 features
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']
```
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']
```
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']
```
##### 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')`
- `Promise.prototype.finally` -> `require('es5-ext/promise/#/finally')`
- `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:
```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
});
```
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.
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");
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"));
flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4]
```
You can configure custom toolkit (like [underscorejs](http://underscorejs.org/)), and use it throughout your application
```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.flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4]
```
As with native ones most methods are generic and can be run on any type of object.
## API
### Global extensions
#### global _(es5-ext/global)_
Object that represents global scope
### Array Constructor extensions
#### from(arrayLike[, mapFn[, thisArg]]) _(es5-ext/array/from)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from).
Returns array representation of _iterable_ or _arrayLike_. If _arrayLike_ is an instance of array, its copy is returned.
#### generate([length[, …fill]]) _(es5-ext/array/generate)_
Generate an array of pre-given _length_ built of repeated arguments.
#### isPlainArray(x) _(es5-ext/array/is-plain-array)_
Returns true if object is plain array (not instance of one of the Array's extensions).
#### of([…items]) _(es5-ext/array/of)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.of).
Create an array from given arguments.
#### toArray(obj) _(es5-ext/array/to-array)_
Returns array representation of `obj`. If `obj` is already an array, `obj` is returned back.
#### validArray(obj) _(es5-ext/array/valid-array)_
Returns `obj` if it's an array, otherwise throws `TypeError`
### Array Prototype extensions
#### arr.binarySearch(compareFn) _(es5-ext/array/#/binary-search)_
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)_
Clears the array
#### arr.compact() _(es5-ext/array/#/compact)_
Returns a copy of the context with all non-values (`null` or `undefined`) removed.
#### arr.concat() _(es5-ext/array/#/concat)_
[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.concat).
ES6's version of `concat`. Supports `isConcatSpreadable` symbol, and returns array of same type as the context.
#### arr.contains(searchElement[, position]) _(es5-ext/array/#/contains)_
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).
#### arr.diff(other) _(es5-ext/array/#/diff)_
Returns the array of elements that are present in context list but not present in other list.
#### arr.eIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-index-of)_
_egal_ version of `indexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision
#### arr.eLastIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-last-index-of)_
_egal_ version of `lastIndexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision
#### arr.entries() _(es5-ext/array/#/entries)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.entries).
Returns iterator object, which traverses the array. Each value is represented with an array, where first value is an index and second is corresponding to index value.
#### arr.exclusion([…lists]]) _(es5-ext/array/#/exclusion)_
Returns the array of elements that are found only in one of the lists (either context list or list provided in arguments).
#### arr.fill(value[, start, end]) _(es5-ext/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)_
[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.filter).
ES6's version of `filter`, returns array of same type as the context.
#### arr.find(predicate[, thisArg]) _(es5-ext/array/#/find)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.find).
Return first element for which given function returns true
#### arr.findIndex(predicate[, thisArg]) _(es5-ext/array/#/find-index)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.findindex).
Return first index for which given function returns true
#### arr.first() _(es5-ext/array/#/first)_
Returns value for first defined index
#### arr.firstIndex() _(es5-ext/array/#/first-index)_
Returns first declared index of the array
#### arr.flatten() _(es5-ext/array/#/flatten)_
Returns flattened version of the array
#### arr.forEachRight(cb[, thisArg]) _(es5-ext/array/#/for-each-right)_
`forEach` starting from last element
#### arr.group(cb[, thisArg]) _(es5-ext/array/#/group)_
Group list elements by value returned by _cb_ function
#### arr.indexesOf(searchElement[, fromIndex]) _(es5-ext/array/#/indexes-of)_
Returns array of all indexes of given value
#### arr.intersection([…lists]) _(es5-ext/array/#/intersection)_
Computes the array of values that are the intersection of all lists (context list and lists given in arguments)
#### arr.isCopy(other) _(es5-ext/array/#/is-copy)_
Returns true if both context and _other_ lists have same content
#### arr.isUniq() _(es5-ext/array/#/is-uniq)_
Returns true if all values in array are unique
#### arr.keys() _(es5-ext/array/#/keys)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.keys).
Returns iterator object, which traverses all array indexes.
#### arr.last() _(es5-ext/array/#/last)_
Returns value of last defined index
#### arr.lastIndex() _(es5-ext/array/#/last)_
Returns last defined index of the array
#### arr.map(callback[, thisArg]) _(es5-ext/array/#/map)_
[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.map).
ES6's version of `map`, returns array of same type as the context.
#### arr.remove(value[, …valuen]) _(es5-ext/array/#/remove)_
Remove values from the array
#### arr.separate(sep) _(es5-ext/array/#/separate)_
Returns array with items separated with `sep` value
#### arr.slice(callback[, thisArg]) _(es5-ext/array/#/slice)_
[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.slice).
ES6's version of `slice`, returns array of same type as the context.
#### arr.someRight(cb[, thisArg]) _(es5-ext/array/#/someRight)_
`some` starting from last element
#### arr.splice(callback[, thisArg]) _(es5-ext/array/#/splice)_
[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.splice).
ES6's version of `splice`, returns array of same type as the context.
#### arr.uniq() _(es5-ext/array/#/uniq)_
Returns duplicate-free version of the array
#### arr.values() _(es5-ext/array/#/values)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.values).
Returns iterator object which traverses all array values.
#### arr[@@iterator] _(es5-ext/array/#/@@iterator)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype-@@iterator).
Returns iterator object which traverses all array values.
### Boolean Constructor extensions
#### isBoolean(x) _(es5-ext/boolean/is-boolean)_
Whether value is boolean
### Date Constructor extensions
#### isDate(x) _(es5-ext/date/is-date)_
Whether value is date instance
#### validDate(x) _(es5-ext/date/valid-date)_
If given object is not date throw TypeError in other case return it.
### Date Prototype extensions
#### date.copy(date) _(es5-ext/date/#/copy)_
Returns a copy of the date object
#### date.daysInMonth() _(es5-ext/date/#/days-in-month)_
Returns number of days of date's month
#### date.floorDay() _(es5-ext/date/#/floor-day)_
Sets the date time to 00:00:00.000
#### date.floorMonth() _(es5-ext/date/#/floor-month)_
Sets date day to 1 and date time to 00:00:00.000
#### date.floorYear() _(es5-ext/date/#/floor-year)_
Sets date month to 0, day to 1 and date time to 00:00:00.000
#### date.format(pattern) _(es5-ext/date/#/format)_
Formats date up to given string. Supported patterns:
- `%Y` - Year with century, 1999, 2003
- `%y` - Year without century, 99, 03
- `%m` - Month, 01..12
- `%d` - Day of the month 01..31
- `%H` - Hour (24-hour clock), 00..23
- `%M` - Minute, 00..59
- `%S` - Second, 00..59
- `%L` - Milliseconds, 000..999
### Error Constructor extensions
#### custom(message/_, code, ext_/) _(es5-ext/error/custom)_
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`).
#### validError(x) _(es5-ext/error/valid-error)_
If given object is not error throw TypeError in other case return it.
### Error Prototype extensions
#### err.throw() _(es5-ext/error/#/throw)_
Throws error
### Function Constructor extensions
Some of the functions were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele
#### constant(x) _(es5-ext/function/constant)_
Returns a constant function that returns pregiven argument
_k(x)(y) =def x_
#### identity(x) _(es5-ext/function/identity)_
Identity function. Returns first argument
_i(x) =def x_
#### invoke(name[, …args]) _(es5-ext/function/invoke)_
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\)_
#### isArguments(x) _(es5-ext/function/is-arguments)_
Whether value is arguments object
#### isFunction(arg) _(es5-ext/function/is-function)_
Whether value is instance of function
#### noop() _(es5-ext/function/noop)_
No operation function
#### pluck(name) _(es5-ext/function/pluck)_
Returns a function that takes an object, and returns the value of its _name_
property
_pluck(name)(obj) =def obj[name]_
#### validFunction(arg) _(es5-ext/function/valid-function)_
If given object is not function throw TypeError in other case return it.
### Function Prototype extensions
Some of the methods were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele
#### fn.compose([…fns]) _(es5-ext/function/#/compose)_
Applies the functions in reverse argument-list order.
_f1.compose(f2, f3, f4)(…args) =def f1(f2(f3(f4(…arg))))_
`compose` can also be used in plain function form as:
_compose(f1, f2, f3, f4)(…args) =def f1(f2(f3(f4(…arg))))_
#### fn.copy() _(es5-ext/function/#/copy)_
Produces copy of given function
#### fn.curry([n]) _(es5-ext/function/#/curry)_
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)_
#### 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)_
_Named after it's counterpart in Google Closure_
#### fn.not() _(es5-ext/function/#/not)_
Returns a function that returns boolean negation of value returned by underlying function.
_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)_
#### 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)_
#### fn.toStringTokens() _(es5-ext/function/#/to-string-tokens)_
Serializes function into two (arguments and body) string tokens. Result is plain object with `args` and `body` properties.
### Math extensions
#### acosh(x) _(es5-ext/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).
#### atanh(x) _(es5-ext/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).
#### clz32(x) _(es5-ext/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).
#### expm1(x) _(es5-ext/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).
#### hypot([…values]) _(es5-ext/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).
#### log1p(x) _(es5-ext/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).
#### log10(x) _(es5-ext/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).
#### sinh(x) _(es5-ext/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).
#### trunc(x) _(es5-ext/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).
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.
#### isFinite(x) _(es5-ext/number/is-finite)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite).
Whether value is finite. Differs from global isNaN that it doesn't do type coercion.
#### isInteger(x) _(es5-ext/number/is-integer)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isinteger).
Whether value is integer.
#### isNaN(x) _(es5-ext/number/is-nan)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isnan).
Whether value is NaN. Differs from global isNaN that it doesn't do type coercion.
#### isNumber(x) _(es5-ext/number/is-number)_
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).
#### 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)\_
[_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).
#### toInteger(x) _(es5-ext/number/to-integer)_
Converts value to integer
#### toPosInteger(x) _(es5-ext/number/to-pos-integer)_
Converts value to positive integer. If provided value is less than 0, then 0 is returned
#### toUint32(x) _(es5-ext/number/to-uint32)_
Converts value to unsigned 32 bit integer. This type is used for array lengths.
See: http://www.2ality.com/2012/02/js-integers.html
### Number Prototype extensions
#### num.pad(length[, precision]) _(es5-ext/number/#/pad)_
Pad given number with zeros. Returns string
### Object Constructor extensions
#### assign(target, source[, …sourcen]) _(es5-ext/object/assign)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).
Extend _target_ by enumerable own properties of other objects. If properties are already set on target object, they will be overwritten.
#### clear(obj) _(es5-ext/object/clear)_
Remove all enumerable own properties of the object
#### compact(obj) _(es5-ext/object/compact)_
Returns copy of the object with all enumerable properties that have no falsy values
#### compare(obj1, obj2) _(es5-ext/object/compare)_
Universal cross-type compare function. To be used for e.g. array sort.
#### copy(obj) _(es5-ext/object/copy)_
Returns copy of the object with all enumerable properties.
#### copyDeep(obj) _(es5-ext/object/copy-deep)_
Returns deep copy of the object with all enumerable properties.
#### count(obj) _(es5-ext/object/count)_
Counts number of enumerable own properties on object
#### create(obj[, properties]) _(es5-ext/object/create)_
`Object.create` alternative that provides workaround for [V8 issue](http://code.google.com/p/v8/issues/detail?id=2804).
When `null` is provided as a prototype, it's substituted with specially prepared object that derives from Object.prototype but has all Object.prototype properties shadowed with undefined.
It's quirky solution that allows us to have plain objects with no truthy properties but with turnable prototype.
Use only for objects that you plan to switch prototypes of and be aware of limitations of this workaround.
#### eq(x, y) _(es5-ext/object/eq)_
Whether two values are equal, using [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm.
#### every(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/every)_
Analogous to Array.prototype.every. Returns true if every key-value pair in this object satisfies the provided testing function.
Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
#### filter(obj, cb[, thisArg]) _(es5-ext/object/filter)_
Analogous to Array.prototype.filter. Returns new object with properites for which _cb_ function returned truthy value.
#### firstKey(obj) _(es5-ext/object/first-key)_
Returns first enumerable key of the object, as keys are unordered by specification, it can be any key of an object.
#### flatten(obj) _(es5-ext/object/flatten)_
Returns new object, with flatten properties of input object
_flatten({ a: { b: 1 }, c: { d: 1 } }) =def { b: 1, d: 1 }_
#### forEach(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/for-each)_
Analogous to Array.prototype.forEach. Calls a function for each key-value pair found in object
Optionally _compareFn_ can be provided which assures that properties are iterated in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
#### getPropertyNames() _(es5-ext/object/get-property-names)_
Get all (not just own) property names of the object
#### is(x, y) _(es5-ext/object/is)_
Whether two values are equal, using [_SameValue_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm.
#### isArrayLike(x) _(es5-ext/object/is-array-like)_
Whether object is array-like object
#### isCopy(x, y) _(es5-ext/object/is-copy)_
Two values are considered a copy of same value when all of their own enumerable properties have same values.
#### isCopyDeep(x, y) _(es5-ext/object/is-copy-deep)_
Deep comparision of objects
#### isEmpty(obj) _(es5-ext/object/is-empty)_
True if object doesn't have any own enumerable property
#### isObject(arg) _(es5-ext/object/is-object)_
Whether value is not primitive
#### isPlainObject(arg) _(es5-ext/object/is-plain-object)_
Whether object is plain object, its protototype should be Object.prototype and it cannot be host object.
#### keyOf(obj, searchValue) _(es5-ext/object/key-of)_
Search object for value
#### keys(obj) _(es5-ext/object/keys)_
[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys).
ES6's version of `keys`, doesn't throw on primitive input
#### map(obj, cb[, thisArg]) _(es5-ext/object/map)_
Analogous to Array.prototype.map. Creates a new object with properties which values are results of calling a provided function on every key-value pair in this object.
#### mapKeys(obj, cb[, thisArg]) _(es5-ext/object/map-keys)_
Create new object with same values, but remapped keys
#### mixin(target, source) _(es5-ext/object/mixin)_
Extend _target_ by all own properties of other objects. Properties found in both objects will be overwritten (unless they're not configurable and cannot be overwritten).
_It was for a moment part of ECMAScript 6 draft._
#### mixinPrototypes(target, …source]) _(es5-ext/object/mixin-prototypes)_
Extends _target_, with all source and source's prototype properties.
Useful as an alternative for `setPrototypeOf` in environments in which it cannot be shimmed (no `__proto__` support).
#### normalizeOptions(options) _(es5-ext/object/normalize-options)_
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.
#### primitiveSet([…names]) _(es5-ext/object/primitive-set)_
Creates `null` prototype based plain object, and sets on it all property names provided in arguments to true.
#### safeTraverse(obj[, …names]) _(es5-ext/object/safe-traverse)_
Safe navigation of object properties. See http://wiki.ecmascript.org/doku.php?id=strawman:existential_operator
#### serialize(value) _(es5-ext/object/serialize)_
Serialize value into string. Differs from [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that it serializes also dates, functions and regular expresssions.
#### setPrototypeOf(object, proto) _(es5-ext/object/set-prototype-of)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof).
If native version is not provided, it depends on existence of `__proto__` functionality, if it's missing, `null` instead of function is exposed.
#### some(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/some)_
Analogous to Array.prototype.some Returns true if any key-value pair satisfies the provided
testing function.
Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
#### toArray(obj[, cb[, thisArg[, compareFn]]]) _(es5-ext/object/to-array)_
Creates an array of results of calling a provided function on every key-value pair in this object.
Optionally _compareFn_ can be provided which assures that results are added in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
#### unserialize(str) _(es5-ext/object/unserialize)_
Userializes value previously serialized with [serialize](#serializevalue-es5-extobjectserialize)
#### validCallable(x) _(es5-ext/object/valid-callable)_
If given object is not callable throw TypeError in other case return it.
#### validObject(x) _(es5-ext/object/valid-object)_
Throws error if given value is not an object, otherwise it is returned.
#### validValue(x) _(es5-ext/object/valid-value)_
Throws error if given value is `null` or `undefined`, otherwise returns value.
### Promise Prototype extensions
#### promise.finally(onFinally) _(es5-ext/promise/#/finally)_
[_Introduced with ECMAScript 2018_](https://tc39.github.io/ecma262/#sec-promise.prototype.finally).
### RegExp Constructor extensions
#### escape(str) _(es5-ext/reg-exp/escape)_
Escapes string to be used in regular expression
#### isRegExp(x) _(es5-ext/reg-exp/is-reg-exp)_
Whether object is regular expression
#### validRegExp(x) _(es5-ext/reg-exp/valid-reg-exp)_
If object is regular expression it is returned, otherwise TypeError is thrown.
### RegExp Prototype extensions
#### re.isSticky(x) _(es5-ext/reg-exp/#/is-sticky)_
Whether regular expression has `sticky` flag.
It's to be used as counterpart to [regExp.sticky](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.sticky) if it's not implemented.
#### re.isUnicode(x) _(es5-ext/reg-exp/#/is-unicode)_
Whether regular expression has `unicode` flag.
It's to be used as counterpart to [regExp.unicode](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.unicode) if it's not implemented.
#### re.match(string) _(es5-ext/reg-exp/#/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).
#### re.search(string) _(es5-ext/reg-exp/#/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).
#### re.sticky _(es5-ext/reg-exp/#/sticky/implement)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.sticky).
It's a getter, so only `implement` and `is-implemented` modules are provided.
#### re.unicode _(es5-ext/reg-exp/#/unicode/implement)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.unicode).
It's a getter, so only `implement` and `is-implemented` modules are provided.
### String Constructor extensions
#### formatMethod(fMap) _(es5-ext/string/format-method)_
Creates format method. It's used e.g. to create `Date.prototype.format` method
#### fromCodePoint([…codePoints]) _(es5-ext/string/from-code-point)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.fromcodepoint)
#### isString(x) _(es5-ext/string/is-string)_
Whether object is string
#### randomUniq() _(es5-ext/string/random-uniq)_
Returns randomly generated id, with guarantee of local uniqueness (no same id will be returned twice)
#### raw(callSite[, …substitutions]) _(es5-ext/string/raw)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.raw)
### String Prototype extensions
#### str.at(pos) _(es5-ext/string/#/at)_
_Proposed for ECMAScript 6/7 standard, but not (yet) in a draft_
Returns a string at given position in Unicode-safe manner.
Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.at).
#### str.camelToHyphen() _(es5-ext/string/#/camel-to-hyphen)_
Convert camelCase string to hyphen separated, e.g. one-two-three -> oneTwoThree.
Useful when converting names from js property convention into filename convention.
#### str.capitalize() _(es5-ext/string/#/capitalize)_
Capitalize first character of a string
#### str.caseInsensitiveCompare(str) _(es5-ext/string/#/case-insensitive-compare)_
Case insensitive compare
#### str.codePointAt(pos) _(es5-ext/string/#/code-point-at)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.codepointat)
Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.codePointAt).
#### str.contains(searchString[, position]) _(es5-ext/string/#/contains)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.contains)
Whether string contains given string.
#### str.endsWith(searchString[, endPosition]) _(es5-ext/string/#/ends-with)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith).
Whether strings ends with given string
#### str.hyphenToCamel() _(es5-ext/string/#/hyphen-to-camel)_
Convert hyphen separated string to camelCase, e.g. one-two-three -> oneTwoThree.
Useful when converting names from filename convention to js property name convention.
#### str.indent(str[, count]) _(es5-ext/string/#/indent)_
Indents each line with provided _str_ (if _count_ given then _str_ is repeated _count_ times).
#### str.last() _(es5-ext/string/#/last)_
Return last character
#### str.normalize([form]) _(es5-ext/string/#/normalize)_
[_Introduced with ECMAScript 6_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize).
Returns the Unicode Normalization Form of a given string.
Based on Matsuza's version. Code used for integrated shim can be found at [github.com/walling/unorm](https://github.com/walling/unorm/blob/master/lib/unorm.js)
#### str.pad(fill[, length]) _(es5-ext/string/#/pad)_
Pad string with _fill_.
If _length_ si given than _fill_ is reapated _length_ times.
If _length_ is negative then pad is applied from right.
#### str.repeat(n) _(es5-ext/string/#/repeat)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.repeat).
Repeat given string _n_ times
#### str.plainReplace(search, replace) _(es5-ext/string/#/plain-replace)_
Simple `replace` version. Doesn't support regular expressions. Replaces just first occurrence of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _\$_ characters escape in such case).
#### str.plainReplaceAll(search, replace) _(es5-ext/string/#/plain-replace-all)_
Simple `replace` version. Doesn't support regular expressions. Replaces all occurrences of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _\$_ characters escape in such case).
#### str.startsWith(searchString[, position]) _(es5-ext/string/#/starts-with)_
[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith).
Whether strings starts with given string
#### str[@@iterator] _(es5-ext/string/#/@@iterator)_
[_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
$ npm test
## Security contact information
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
## es5-ext for enterprise
Available as part of the Tidelift Subscription
The maintainers of es5-ext and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-es5-ext?utm_source=npm-es5-ext&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
[build-image]: https://github.com/medikoo/es5-ext/workflows/Integrate/badge.svg
[build-url]: https://github.com/medikoo/es5-ext/actions?query=workflow%3AIntegrate
[cov-image]: https://img.shields.io/codecov/c/github/medikoo/es5-ext.svg
[cov-url]: https://codecov.io/gh/medikoo/es5-ext
[npm-image]: https://img.shields.io/npm/v/es5-ext.svg
[npm-url]: https://www.npmjs.com/package/es5-ext
================================================
FILE: _postinstall.js
================================================
#!/usr/bin/env node
// Broadcasts "Call for peace" message when package is installed in Russia, otherwise no-op
"use strict";
try {
if (
[
"Asia/Anadyr", "Asia/Barnaul", "Asia/Chita", "Asia/Irkutsk", "Asia/Kamchatka",
"Asia/Khandyga", "Asia/Krasnoyarsk", "Asia/Magadan", "Asia/Novokuznetsk",
"Asia/Novosibirsk", "Asia/Omsk", "Asia/Sakhalin", "Asia/Srednekolymsk", "Asia/Tomsk",
"Asia/Ust-Nera", "Asia/Vladivostok", "Asia/Yakutsk", "Asia/Yekaterinburg",
"Europe/Astrakhan", "Europe/Kaliningrad", "Europe/Kirov", "Europe/Moscow",
"Europe/Samara", "Europe/Saratov", "Europe/Simferopol", "Europe/Ulyanovsk",
"Europe/Volgograd", "W-SU"
].indexOf(new Intl.DateTimeFormat().resolvedOptions().timeZone) === -1
) {
return;
}
var bold = function (msg) { return "\x1b[97m\x1b[1m" + msg + "\x1b[22m\x1b[37m"; };
process._rawDebug(
[
"",
"\x1b[37m24 февраля 2022 года " +
bold("Россия вторглась на Украину") +
". Это вторжение стало крупнейшей атакой на европейскую страну со времен " +
"Второй мировой войны.",
"",
"Оценивается, что это привело к десяткам тысяч жертв среди гражданского " +
"населения Украины и сотням тысяч военных потерь.",
"",
"Российское правительство ограничивает доступ граждан к внешней информации, " +
"продвигая односторонние формулировки и версии происходящего. Другие соседние " +
"страны изображаются как угроза для России, создавая предлог для очередного " +
"неоправданного вторжения в ближайшие годы.",
"",
"Это необходимо остановить. Узнайте, как обойти цензуру и безопасно получить доступ " +
"к широкому спектру источников:",
"",
bold(
"https://forum.torproject.net/t/tor-blocked-in-russia-how-to-circumvent-censorship/982"
),
"",
"Мы призываем изучать множество точек зрения для формирования всестороннего взгляда " +
"на ситуацию."
].join("\n")
);
} catch (error) {
// ignore
}
================================================
FILE: array/#/@@iterator/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, require("es6-symbol").iterator, {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: array/#/@@iterator/index.js
================================================
"use strict";
module.exports = require("./is-implemented")()
? Array.prototype[require("es6-symbol").iterator]
: require("./shim");
================================================
FILE: array/#/@@iterator/is-implemented.js
================================================
"use strict";
var iteratorSymbol = require("es6-symbol").iterator;
module.exports = function () {
var arr = ["foo", 1], iterator, result;
if (typeof arr[iteratorSymbol] !== "function") return false;
iterator = arr[iteratorSymbol]();
if (!iterator) return false;
if (typeof iterator.next !== "function") return false;
result = iterator.next();
if (!result) return false;
if (result.value !== "foo") return false;
if (result.done !== false) return false;
return true;
};
================================================
FILE: array/#/@@iterator/shim.js
================================================
"use strict";
module.exports = require("../values/shim");
================================================
FILE: array/#/_compare-by-length.js
================================================
// Used internally to sort array of lists by length
"use strict";
var toPosInt = require("../../number/to-pos-integer");
module.exports = function (arr1, arr2) { return toPosInt(arr1.length) - toPosInt(arr2.length); };
================================================
FILE: array/#/binary-search.js
================================================
"use strict";
var toPosInt = require("../../number/to-pos-integer")
, callable = require("../../object/valid-callable")
, value = require("../../object/valid-value")
, floor = Math.floor;
module.exports = function (compareFn) {
var length, low, high, middle;
value(this);
callable(compareFn);
length = toPosInt(this.length);
low = 0;
high = length - 1;
while (low <= high) {
middle = floor((low + high) / 2);
if (compareFn(this[middle]) < 0) high = middle - 1;
else low = middle + 1;
}
if (high < 0) return 0;
if (high >= length) return length - 1;
return high;
};
================================================
FILE: array/#/clear.js
================================================
// Inspired by Google Closure:
// http://closure-library.googlecode.com/svn/docs/
// closure_goog_array_array.js.html#goog.array.clear
"use strict";
var value = require("../../object/valid-value");
module.exports = function () {
value(this).length = 0;
return this;
};
================================================
FILE: array/#/compact.js
================================================
// Inspired by: http://documentcloud.github.com/underscore/#compact
"use strict";
var isValue = require("../../object/is-value");
var filter = Array.prototype.filter;
module.exports = function () {
return filter.call(this, function (val) { return isValue(val); });
};
================================================
FILE: array/#/concat/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "concat", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: array/#/concat/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.concat : require("./shim");
================================================
FILE: array/#/concat/is-implemented.js
================================================
"use strict";
var SubArray = require("../../_sub-array-dummy-safe");
module.exports = function () { return new SubArray().concat("foo") instanceof SubArray; };
================================================
FILE: array/#/concat/shim.js
================================================
"use strict";
var isPlainArray = require("../../is-plain-array")
, toPosInt = require("../../../number/to-pos-integer")
, isObject = require("../../../object/is-object")
, isConcatSpreadable = require("es6-symbol").isConcatSpreadable
, isArray = Array.isArray
, concat = Array.prototype.concat
, forEach = Array.prototype.forEach
, isSpreadable;
isSpreadable = function (value) {
if (!value) return false;
if (!isObject(value)) return false;
if (value[isConcatSpreadable] !== undefined) {
return Boolean(value[isConcatSpreadable]);
}
return isArray(value);
};
// eslint-disable-next-line no-unused-vars
module.exports = function (item /*, …items*/) {
var result;
if (!this || !isArray(this) || isPlainArray(this)) {
return concat.apply(this, arguments);
}
result = new this.constructor();
if (isSpreadable(this)) {
forEach.call(this, function (val, i) { result[i] = val; });
} else {
result[0] = this;
}
forEach.call(arguments, function (arg) {
var base;
if (isSpreadable(arg)) {
base = result.length;
result.length += toPosInt(arg.length);
forEach.call(arg, function (val, i) { result[base + i] = val; });
return;
}
result.push(arg);
});
return result;
};
================================================
FILE: array/#/contains.js
================================================
"use strict";
var indexOf = require("./e-index-of");
module.exports = function (searchElement /*, position*/) {
return indexOf.call(this, searchElement, arguments[1]) > -1;
};
================================================
FILE: array/#/copy-within/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "copyWithin", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: array/#/copy-within/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.copyWithin : require("./shim");
================================================
FILE: array/#/copy-within/is-implemented.js
================================================
"use strict";
module.exports = function () {
var arr = [1, 2, 3, 4, 5];
if (typeof arr.copyWithin !== "function") return false;
return String(arr.copyWithin(1, 3)) === "1,4,5,4,5";
};
================================================
FILE: array/#/copy-within/shim.js
================================================
// Taken from: https://github.com/paulmillr/es6-shim/
"use strict";
var toInteger = require("../../../number/to-integer")
, toPosInt = require("../../../number/to-pos-integer")
, validValue = require("../../../object/valid-value")
, objHasOwnProperty = Object.prototype.hasOwnProperty
, max = Math.max
, min = Math.min;
module.exports = function (target, start /*, end*/) {
var arr = validValue(this)
, end = arguments[2]
, length = toPosInt(arr.length)
, to
, from
, fin
, count
, direction;
target = toInteger(target);
start = toInteger(start);
end = end === undefined ? length : toInteger(end);
to = target < 0 ? max(length + target, 0) : min(target, length);
from = start < 0 ? max(length + start, 0) : min(start, length);
fin = end < 0 ? max(length + end, 0) : min(end, length);
count = min(fin - from, length - to);
direction = 1;
if (from < to && to < from + count) {
direction = -1;
from += count - 1;
to += count - 1;
}
while (count > 0) {
if (objHasOwnProperty.call(arr, from)) arr[to] = arr[from];
else delete arr[from];
from += direction;
to += direction;
count -= 1;
}
return arr;
};
================================================
FILE: array/#/diff.js
================================================
"use strict";
var value = require("../../object/valid-value")
, contains = require("./contains")
, filter = Array.prototype.filter;
module.exports = function (other) {
value(this);
value(other);
return filter.call(this, function (item) { return !contains.call(other, item); });
};
================================================
FILE: array/#/e-index-of.js
================================================
"use strict";
var numberIsNaN = require("../../number/is-nan")
, toPosInt = require("../../number/to-pos-integer")
, value = require("../../object/valid-value")
, indexOf = Array.prototype.indexOf
, objHasOwnProperty = Object.prototype.hasOwnProperty
, abs = Math.abs
, floor = Math.floor;
module.exports = function (searchElement /*, fromIndex*/) {
var i, length, fromIndex, val;
if (!numberIsNaN(searchElement)) return indexOf.apply(this, arguments);
length = toPosInt(value(this).length);
fromIndex = arguments[1];
if (isNaN(fromIndex)) fromIndex = 0;
else if (fromIndex >= 0) fromIndex = floor(fromIndex);
else fromIndex = toPosInt(this.length) - floor(abs(fromIndex));
for (i = fromIndex; i < length; ++i) {
if (objHasOwnProperty.call(this, i)) {
val = this[i];
if (numberIsNaN(val)) return i; // Jslint: ignore
}
}
return -1;
};
================================================
FILE: array/#/e-last-index-of.js
================================================
"use strict";
var numberIsNaN = require("../../number/is-nan")
, toPosInt = require("../../number/to-pos-integer")
, value = require("../../object/valid-value")
, lastIndexOf = Array.prototype.lastIndexOf
, objHasOwnProperty = Object.prototype.hasOwnProperty
, abs = Math.abs
, floor = Math.floor;
module.exports = function (searchElement /*, fromIndex*/) {
var i, fromIndex, val;
if (!numberIsNaN(searchElement)) {
// Jslint: ignore
return lastIndexOf.apply(this, arguments);
}
value(this);
fromIndex = arguments[1];
if (isNaN(fromIndex)) fromIndex = toPosInt(this.length) - 1;
else if (fromIndex >= 0) fromIndex = floor(fromIndex);
else fromIndex = toPosInt(this.length) - floor(abs(fromIndex));
for (i = fromIndex; i >= 0; --i) {
if (objHasOwnProperty.call(this, i)) {
val = this[i];
if (numberIsNaN(val)) return i; // Jslint: ignore
}
}
return -1;
};
================================================
FILE: array/#/entries/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "entries", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: array/#/entries/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.entries : require("./shim");
================================================
FILE: array/#/entries/is-implemented.js
================================================
"use strict";
module.exports = function () {
var arr = [1, "foo"], iterator, result;
if (typeof arr.entries !== "function") return false;
iterator = arr.entries();
if (!iterator) return false;
if (typeof iterator.next !== "function") return false;
result = iterator.next();
if (!result || !result.value) return false;
if (result.value[0] !== 0) return false;
if (result.value[1] !== 1) return false;
if (result.done !== false) return false;
return true;
};
================================================
FILE: array/#/entries/shim.js
================================================
"use strict";
var ArrayIterator = require("es6-iterator/array");
module.exports = function () { return new ArrayIterator(this, "key+value"); };
================================================
FILE: array/#/exclusion.js
================================================
"use strict";
var value = require("../../object/valid-value")
, aFrom = require("../from")
, toArray = require("../to-array")
, contains = require("./contains")
, byLength = require("./_compare-by-length")
, filter = Array.prototype.filter
, push = Array.prototype.push;
module.exports = function (/* …lists*/) {
var lists, seen, result;
if (!arguments.length) return aFrom(this);
push.apply((lists = [this]), arguments);
lists.forEach(value);
seen = [];
result = [];
lists.sort(byLength).forEach(function (list) {
result = result
.filter(function (item) { return !contains.call(list, item); })
.concat(filter.call(list, function (item) { return !contains.call(seen, item); }));
push.apply(seen, toArray(list));
});
return result;
};
================================================
FILE: array/#/fill/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "fill", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: array/#/fill/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.fill : require("./shim");
================================================
FILE: array/#/fill/is-implemented.js
================================================
"use strict";
module.exports = function () {
var arr = [1, 2, 3, 4, 5, 6];
if (typeof arr.fill !== "function") return false;
return String(arr.fill(-1, -3)) === "1,2,3,-1,-1,-1";
};
================================================
FILE: array/#/fill/shim.js
================================================
// Taken from: https://github.com/paulmillr/es6-shim/
"use strict";
var toInteger = require("../../../number/to-integer")
, toPosInt = require("../../../number/to-pos-integer")
, validValue = require("../../../object/valid-value")
, max = Math.max
, min = Math.min;
module.exports = function (value /*, start, end*/) {
var arr = validValue(this)
, start = arguments[1]
, end = arguments[2]
, length = toPosInt(arr.length)
, relativeStart
, i;
start = start === undefined ? 0 : toInteger(start);
end = end === undefined ? length : toInteger(end);
relativeStart = start < 0 ? max(length + start, 0) : min(start, length);
for (i = relativeStart; i < length && i < end; ++i) arr[i] = value;
return arr;
};
================================================
FILE: array/#/filter/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "filter", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: array/#/filter/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.filter : require("./shim");
================================================
FILE: array/#/filter/is-implemented.js
================================================
"use strict";
var SubArray = require("../../_sub-array-dummy-safe")
, pass = function () { return true; };
module.exports = function () { return new SubArray().filter(pass) instanceof SubArray; };
================================================
FILE: array/#/filter/shim.js
================================================
"use strict";
var isPlainArray = require("../../is-plain-array")
, callable = require("../../../object/valid-callable")
, isArray = Array.isArray
, filter = Array.prototype.filter
, forEach = Array.prototype.forEach
, call = Function.prototype.call;
module.exports = function (callbackFn /*, thisArg*/) {
var result, thisArg, i;
if (!this || !isArray(this) || isPlainArray(this)) {
return filter.apply(this, arguments);
}
callable(callbackFn);
thisArg = arguments[1];
result = new this.constructor();
i = 0;
forEach.call(this, function (val, j, self) {
if (call.call(callbackFn, thisArg, val, j, self)) result[i++] = val;
});
return result;
};
================================================
FILE: array/#/find/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "find", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: array/#/find/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.find : require("./shim");
================================================
FILE: array/#/find/is-implemented.js
================================================
"use strict";
var fn = function (value) { return value > 3; };
module.exports = function () {
var arr = [1, 2, 3, 4, 5, 6];
if (typeof arr.find !== "function") return false;
return arr.find(fn) === 4;
};
================================================
FILE: array/#/find/shim.js
================================================
"use strict";
var findIndex = require("../find-index/shim");
// eslint-disable-next-line no-unused-vars
module.exports = function (predicate /*, thisArg*/) {
var index = findIndex.apply(this, arguments);
return index === -1 ? undefined : this[index];
};
================================================
FILE: array/#/find-index/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "findIndex", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: array/#/find-index/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.findIndex : require("./shim");
================================================
FILE: array/#/find-index/is-implemented.js
================================================
"use strict";
var fn = function (value) { return value > 3; };
module.exports = function () {
var arr = [1, 2, 3, 4, 5, 6];
if (typeof arr.findIndex !== "function") return false;
return arr.findIndex(fn) === 3;
};
================================================
FILE: array/#/find-index/shim.js
================================================
"use strict";
var callable = require("../../../object/valid-callable")
, ensureValue = require("../../../object/valid-value")
, some = Array.prototype.some
, apply = Function.prototype.apply;
module.exports = function (predicate /*, thisArg*/) {
var k, self;
self = Object(ensureValue(this));
callable(predicate);
return some.call(
self,
function (value, index) {
if (apply.call(predicate, this, arguments)) {
k = index;
return true;
}
return false;
},
arguments[1]
)
? k
: -1;
};
================================================
FILE: array/#/first-index.js
================================================
"use strict";
var toPosInt = require("../../number/to-pos-integer")
, value = require("../../object/valid-value")
, objHasOwnProperty = Object.prototype.hasOwnProperty;
module.exports = function () {
var i, length;
if (!(length = toPosInt(value(this).length))) return null;
i = 0;
while (!objHasOwnProperty.call(this, i)) {
if (++i === length) return null;
}
return i;
};
================================================
FILE: array/#/first.js
================================================
"use strict";
var firstIndex = require("./first-index");
module.exports = function () {
var i;
if ((i = firstIndex.call(this)) !== null) return this[i];
return undefined;
};
================================================
FILE: array/#/flatten.js
================================================
// Stack grow safe implementation
"use strict";
var ensureValue = require("../../object/valid-value")
, isArray = Array.isArray
, objHasOwnProperty = Object.prototype.hasOwnProperty;
module.exports = function () {
var input = ensureValue(this), index = 0, remaining, remainingIndexes, length, i, result = [];
// Jslint: ignore
main: while (input) {
length = input.length;
for (i = index; i < length; ++i) {
if (!objHasOwnProperty.call(input, i)) continue;
if (isArray(input[i])) {
if (i < length - 1) {
// eslint-disable-next-line max-depth
if (!remaining) {
remaining = [];
remainingIndexes = [];
}
remaining.push(input);
remainingIndexes.push(i + 1);
}
input = input[i];
index = 0;
continue main;
}
result.push(input[i]);
}
if (remaining) {
input = remaining.pop();
index = remainingIndexes.pop();
} else {
input = null;
}
}
return result;
};
================================================
FILE: array/#/for-each-right.js
================================================
"use strict";
var toPosInt = require("../../number/to-pos-integer")
, callable = require("../../object/valid-callable")
, value = require("../../object/valid-value")
, objHasOwnProperty = Object.prototype.hasOwnProperty
, call = Function.prototype.call;
module.exports = function (cb /*, thisArg*/) {
var i, self, thisArg;
self = Object(value(this));
callable(cb);
thisArg = arguments[1];
for (i = toPosInt(self.length) - 1; i >= 0; --i) {
if (objHasOwnProperty.call(self, i)) call.call(cb, thisArg, self[i], i, self);
}
};
================================================
FILE: array/#/group.js
================================================
// Inspired by Underscore's groupBy:
// http://documentcloud.github.com/underscore/#groupBy
"use strict";
var callable = require("../../object/valid-callable")
, value = require("../../object/valid-value")
, forEach = Array.prototype.forEach
, apply = Function.prototype.apply;
module.exports = function (cb /*, thisArg*/) {
var result;
value(this);
callable(cb);
result = Object.create(null);
forEach.call(
this,
function (item) {
var key = apply.call(cb, this, arguments);
if (!result[key]) result[key] = [];
result[key].push(item);
},
arguments[1]
);
return result;
};
================================================
FILE: array/#/index.js
================================================
"use strict";
module.exports = {
"@@iterator": require("./@@iterator"),
"binarySearch": require("./binary-search"),
"clear": require("./clear"),
"compact": require("./compact"),
"concat": require("./concat"),
"contains": require("./contains"),
"copyWithin": require("./copy-within"),
"diff": require("./diff"),
"eIndexOf": require("./e-index-of"),
"eLastIndexOf": require("./e-last-index-of"),
"entries": require("./entries"),
"exclusion": require("./exclusion"),
"fill": require("./fill"),
"filter": require("./filter"),
"find": require("./find"),
"findIndex": require("./find-index"),
"first": require("./first"),
"firstIndex": require("./first-index"),
"flatten": require("./flatten"),
"forEachRight": require("./for-each-right"),
"keys": require("./keys"),
"group": require("./group"),
"indexesOf": require("./indexes-of"),
"intersection": require("./intersection"),
"isCopy": require("./is-copy"),
"isEmpty": require("./is-empty"),
"isUniq": require("./is-uniq"),
"last": require("./last"),
"lastIndex": require("./last-index"),
"map": require("./map"),
"remove": require("./remove"),
"separate": require("./separate"),
"slice": require("./slice"),
"someRight": require("./some-right"),
"splice": require("./splice"),
"uniq": require("./uniq"),
"values": require("./values")
};
================================================
FILE: array/#/indexes-of.js
================================================
"use strict";
var indexOf = require("./e-index-of");
module.exports = function (value /*, fromIndex*/) {
var result = [], i, fromIndex = arguments[1];
while ((i = indexOf.call(this, value, fromIndex)) !== -1) {
result.push(i);
fromIndex = i + 1;
}
return result;
};
================================================
FILE: array/#/intersection.js
================================================
"use strict";
var value = require("../../object/valid-value")
, contains = require("./contains")
, byLength = require("./_compare-by-length")
, filter = Array.prototype.filter
, push = Array.prototype.push
, slice = Array.prototype.slice;
module.exports = function (/* …list*/) {
var lists;
if (!arguments.length) slice.call(this);
push.apply((lists = [this]), arguments);
lists.forEach(value);
lists.sort(byLength);
return lists.reduce(function (list1, list2) {
return filter.call(list1, function (item) { return contains.call(list2, item); });
});
};
================================================
FILE: array/#/is-copy.js
================================================
"use strict";
var toPosInt = require("../../number/to-pos-integer")
, eq = require("../../object/eq")
, value = require("../../object/valid-value")
, objHasOwnProperty = Object.prototype.hasOwnProperty;
module.exports = function (other) {
var i, length;
value(this);
value(other);
length = toPosInt(this.length);
if (length !== toPosInt(other.length)) return false;
for (i = 0; i < length; ++i) {
if (objHasOwnProperty.call(this, i) !== objHasOwnProperty.call(other, i)) {
return false;
}
if (!eq(this[i], other[i])) return false;
}
return true;
};
================================================
FILE: array/#/is-empty.js
================================================
"use strict";
var ensureArray = require("../../object/ensure-array")
, firstIndex = require("./first-index");
module.exports = function () { return firstIndex.call(ensureArray(this)) === null; };
================================================
FILE: array/#/is-uniq.js
================================================
"use strict";
var indexOf = require("./e-index-of")
, every = Array.prototype.every
, isFirst;
isFirst = function (value, index) { return indexOf.call(this, value) === index; };
module.exports = function () { return every.call(this, isFirst, this); };
================================================
FILE: array/#/keys/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "keys", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: array/#/keys/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.keys : require("./shim");
================================================
FILE: array/#/keys/is-implemented.js
================================================
"use strict";
module.exports = function () {
var arr = [1, "foo"], iterator, result;
if (typeof arr.keys !== "function") return false;
iterator = arr.keys();
if (!iterator) return false;
if (typeof iterator.next !== "function") return false;
result = iterator.next();
if (!result) return false;
if (result.value !== 0) return false;
if (result.done !== false) return false;
return true;
};
================================================
FILE: array/#/keys/shim.js
================================================
"use strict";
var ArrayIterator = require("es6-iterator/array");
module.exports = function () { return new ArrayIterator(this, "key"); };
================================================
FILE: array/#/last-index.js
================================================
"use strict";
var toPosInt = require("../../number/to-pos-integer")
, value = require("../../object/valid-value")
, objHasOwnProperty = Object.prototype.hasOwnProperty;
module.exports = function () {
var i, length;
if (!(length = toPosInt(value(this).length))) return null;
i = length - 1;
while (!objHasOwnProperty.call(this, i)) {
if (--i === -1) return null;
}
return i;
};
================================================
FILE: array/#/last.js
================================================
"use strict";
var lastIndex = require("./last-index");
module.exports = function () {
var i;
if ((i = lastIndex.call(this)) !== null) return this[i];
return undefined;
};
================================================
FILE: array/#/map/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "map", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: array/#/map/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.map : require("./shim");
================================================
FILE: array/#/map/is-implemented.js
================================================
"use strict";
var identity = require("../../../function/identity")
, SubArray = require("../../_sub-array-dummy-safe");
module.exports = function () { return new SubArray().map(identity) instanceof SubArray; };
================================================
FILE: array/#/map/shim.js
================================================
"use strict";
var isPlainArray = require("../../is-plain-array")
, callable = require("../../../object/valid-callable")
, isArray = Array.isArray
, map = Array.prototype.map
, forEach = Array.prototype.forEach
, call = Function.prototype.call;
module.exports = function (callbackFn /*, thisArg*/) {
var result, thisArg;
if (!this || !isArray(this) || isPlainArray(this)) {
return map.apply(this, arguments);
}
callable(callbackFn);
thisArg = arguments[1];
result = new this.constructor(this.length);
forEach.call(this, function (val, i, self) {
result[i] = call.call(callbackFn, thisArg, val, i, self);
});
return result;
};
================================================
FILE: array/#/remove.js
================================================
"use strict";
var indexOf = require("./e-index-of")
, forEach = Array.prototype.forEach
, splice = Array.prototype.splice;
// eslint-disable-next-line no-unused-vars
module.exports = function (itemToRemove /*, …item*/) {
forEach.call(
arguments,
function (item) {
var index = indexOf.call(this, item);
if (index !== -1) splice.call(this, index, 1);
},
this
);
};
================================================
FILE: array/#/separate.js
================================================
"use strict";
var forEach = Array.prototype.forEach;
module.exports = function (sep) {
var result = [];
forEach.call(this, function (val) { result.push(val, sep); });
result.pop();
return result;
};
================================================
FILE: array/#/slice/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "slice", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: array/#/slice/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.slice : require("./shim");
================================================
FILE: array/#/slice/is-implemented.js
================================================
"use strict";
var SubArray = require("../../_sub-array-dummy-safe");
module.exports = function () { return new SubArray().slice() instanceof SubArray; };
================================================
FILE: array/#/slice/shim.js
================================================
"use strict";
var toInteger = require("../../../number/to-integer")
, toPosInt = require("../../../number/to-pos-integer")
, isPlainArray = require("../../is-plain-array")
, isArray = Array.isArray
, slice = Array.prototype.slice
, objHasOwnProperty = Object.prototype.hasOwnProperty
, max = Math.max;
module.exports = function (start, end) {
var length, result, i;
if (!this || !isArray(this) || isPlainArray(this)) {
return slice.apply(this, arguments);
}
length = toPosInt(this.length);
start = toInteger(start);
if (start < 0) start = max(length + start, 0);
else if (start > length) start = length;
if (end === undefined) {
end = length;
} else {
end = toInteger(end);
if (end < 0) end = max(length + end, 0);
else if (end > length) end = length;
}
if (start > end) start = end;
result = new this.constructor(end - start);
i = 0;
while (start !== end) {
if (objHasOwnProperty.call(this, start)) result[i] = this[start];
++i;
++start;
}
return result;
};
================================================
FILE: array/#/some-right.js
================================================
"use strict";
var toPosInt = require("../../number/to-pos-integer")
, callable = require("../../object/valid-callable")
, value = require("../../object/valid-value")
, objHasOwnProperty = Object.prototype.hasOwnProperty
, call = Function.prototype.call;
module.exports = function (cb /*, thisArg*/) {
var i, self, thisArg;
self = Object(value(this));
callable(cb);
thisArg = arguments[1];
for (i = toPosInt(self.length) - 1; i >= 0; --i) {
if (objHasOwnProperty.call(self, i) && call.call(cb, thisArg, self[i], i, self)) {
return true;
}
}
return false;
};
================================================
FILE: array/#/splice/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "splice", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: array/#/splice/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.splice : require("./shim");
================================================
FILE: array/#/splice/is-implemented.js
================================================
"use strict";
var SubArray = require("../../_sub-array-dummy-safe");
module.exports = function () { return new SubArray().splice(0) instanceof SubArray; };
================================================
FILE: array/#/splice/shim.js
================================================
"use strict";
var isPlainArray = require("../../is-plain-array")
, isArray = Array.isArray
, splice = Array.prototype.splice
, forEach = Array.prototype.forEach;
// eslint-disable-next-line no-unused-vars
module.exports = function (start, deleteCount /*, …items*/) {
var arr = splice.apply(this, arguments), result;
if (!this || !isArray(this) || isPlainArray(this)) return arr;
result = new this.constructor(arr.length);
forEach.call(arr, function (val, i) { result[i] = val; });
return result;
};
================================================
FILE: array/#/uniq.js
================================================
"use strict";
var indexOf = require("./e-index-of")
, filter = Array.prototype.filter
, isFirst;
isFirst = function (value, index) { return indexOf.call(this, value) === index; };
module.exports = function () { return filter.call(this, isFirst, this); };
================================================
FILE: array/#/values/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array.prototype, "values", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: array/#/values/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.values : require("./shim");
================================================
FILE: array/#/values/is-implemented.js
================================================
"use strict";
module.exports = function () {
var arr = ["foo", 1], iterator, result;
if (typeof arr.values !== "function") return false;
iterator = arr.values();
if (!iterator) return false;
if (typeof iterator.next !== "function") return false;
result = iterator.next();
if (!result) return false;
if (result.value !== "foo") return false;
if (result.done !== false) return false;
return true;
};
================================================
FILE: array/#/values/shim.js
================================================
"use strict";
var ArrayIterator = require("es6-iterator/array");
module.exports = function () { return new ArrayIterator(this, "value"); };
================================================
FILE: array/_is-extensible.js
================================================
"use strict";
module.exports = (function () {
var SubArray = require("./_sub-array-dummy")
, arr;
if (!SubArray) return false;
arr = new SubArray();
if (!Array.isArray(arr)) return false;
if (!(arr instanceof SubArray)) return false;
arr[34] = "foo";
return arr.length === 35;
})();
================================================
FILE: array/_sub-array-dummy-safe.js
================================================
"use strict";
var setPrototypeOf = require("../object/set-prototype-of")
, isExtensible = require("./_is-extensible");
module.exports = (function () {
var SubArray;
if (isExtensible) return require("./_sub-array-dummy");
if (!setPrototypeOf) return null;
SubArray = function () {
var arr = Array.apply(this, arguments);
setPrototypeOf(arr, SubArray.prototype);
return arr;
};
setPrototypeOf(SubArray, Array);
SubArray.prototype = Object.create(Array.prototype, {
constructor: { value: SubArray, enumerable: false, writable: true, configurable: true }
});
return SubArray;
})();
================================================
FILE: array/_sub-array-dummy.js
================================================
"use strict";
var setPrototypeOf = require("../object/set-prototype-of");
module.exports = (function () {
var SubArray;
if (!setPrototypeOf) return null;
SubArray = function () { Array.apply(this, arguments); };
setPrototypeOf(SubArray, Array);
SubArray.prototype = Object.create(Array.prototype, {
constructor: { value: SubArray, enumerable: false, writable: true, configurable: true }
});
return SubArray;
})();
================================================
FILE: array/from/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array, "from", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: array/from/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Array.from : require("./shim");
================================================
FILE: array/from/is-implemented.js
================================================
"use strict";
module.exports = function () {
var from = Array.from, arr, result;
if (typeof from !== "function") return false;
arr = ["raz", "dwa"];
result = from(arr);
return Boolean(result && result !== arr && result[1] === "dwa");
};
================================================
FILE: array/from/shim.js
================================================
"use strict";
var iteratorSymbol = require("es6-symbol").iterator
, isArguments = require("../../function/is-arguments")
, isFunction = require("../../function/is-function")
, toPosInt = require("../../number/to-pos-integer")
, callable = require("../../object/valid-callable")
, validValue = require("../../object/valid-value")
, isValue = require("../../object/is-value")
, isString = require("../../string/is-string")
, isArray = Array.isArray
, call = Function.prototype.call
, desc = { configurable: true, enumerable: true, writable: true, value: null }
, defineProperty = Object.defineProperty;
// eslint-disable-next-line complexity, max-lines-per-function
module.exports = function (arrayLike /*, mapFn, thisArg*/) {
var mapFn = arguments[1]
, thisArg = arguments[2]
, Context
, i
, j
, arr
, length
, code
, iterator
, result
, getIterator
, value;
arrayLike = Object(validValue(arrayLike));
if (isValue(mapFn)) callable(mapFn);
if (!this || this === Array || !isFunction(this)) {
// Result: Plain array
if (!mapFn) {
if (isArguments(arrayLike)) {
// Source: Arguments
length = arrayLike.length;
if (length !== 1) return Array.apply(null, arrayLike);
arr = new Array(1);
arr[0] = arrayLike[0];
return arr;
}
if (isArray(arrayLike)) {
// Source: Array
arr = new Array((length = arrayLike.length));
for (i = 0; i < length; ++i) arr[i] = arrayLike[i];
return arr;
}
}
arr = [];
} else {
// Result: Non plain array
Context = this;
}
if (!isArray(arrayLike)) {
if ((getIterator = arrayLike[iteratorSymbol]) !== undefined) {
// Source: Iterator
iterator = callable(getIterator).call(arrayLike);
if (Context) arr = new Context();
result = iterator.next();
i = 0;
while (!result.done) {
value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value;
if (Context) {
desc.value = value;
defineProperty(arr, i, desc);
} else {
arr[i] = value;
}
result = iterator.next();
++i;
}
length = i;
} else if (isString(arrayLike)) {
// Source: String
length = arrayLike.length;
if (Context) arr = new Context();
for (i = 0, j = 0; i < length; ++i) {
value = arrayLike[i];
if (i + 1 < length) {
code = value.charCodeAt(0);
// eslint-disable-next-line max-depth
if (code >= 0xd800 && code <= 0xdbff) value += arrayLike[++i];
}
value = mapFn ? call.call(mapFn, thisArg, value, j) : value;
if (Context) {
desc.value = value;
defineProperty(arr, j, desc);
} else {
arr[j] = value;
}
++j;
}
length = j;
}
}
if (length === undefined) {
// Source: array or array-like
length = toPosInt(arrayLike.length);
if (Context) arr = new Context(length);
for (i = 0; i < length; ++i) {
value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i];
if (Context) {
desc.value = value;
defineProperty(arr, i, desc);
} else {
arr[i] = value;
}
}
}
if (Context) {
desc.value = null;
arr.length = length;
}
return arr;
};
================================================
FILE: array/generate.js
================================================
"use strict";
var toPosInt = require("../number/to-pos-integer")
, value = require("../object/valid-value")
, slice = Array.prototype.slice;
module.exports = function (length /*, …fill*/) {
var arr, currentLength;
length = toPosInt(value(length));
if (length === 0) return [];
arr = arguments.length < 2 ? [undefined] : slice.call(arguments, 1, 1 + length);
while ((currentLength = arr.length) < length) {
arr = arr.concat(arr.slice(0, length - currentLength));
}
return arr;
};
================================================
FILE: array/index.js
================================================
"use strict";
module.exports = {
"#": require("./#"),
"from": require("./from"),
"generate": require("./generate"),
"isPlainArray": require("./is-plain-array"),
"of": require("./of"),
"toArray": require("./to-array"),
"validArray": require("./valid-array")
};
================================================
FILE: array/is-plain-array.js
================================================
"use strict";
var isArray = Array.isArray, getPrototypeOf = Object.getPrototypeOf;
module.exports = function (obj) {
var proto;
if (!obj || !isArray(obj)) return false;
proto = getPrototypeOf(obj);
if (!isArray(proto)) return false;
return !isArray(getPrototypeOf(proto));
};
================================================
FILE: array/of/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Array, "of", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: array/of/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Array.of : require("./shim");
================================================
FILE: array/of/is-implemented.js
================================================
"use strict";
module.exports = function () {
var of = Array.of, result;
if (typeof of !== "function") return false;
result = of("foo", "bar");
return Boolean(result && result[1] === "bar");
};
================================================
FILE: array/of/shim.js
================================================
"use strict";
var isFunction = require("../../function/is-function")
, slice = Array.prototype.slice
, defineProperty = Object.defineProperty
, desc = { configurable: true, enumerable: true, writable: true, value: null };
module.exports = function (/* …items*/) {
var result, i, length;
if (!this || this === Array || !isFunction(this)) return slice.call(arguments);
result = new this((length = arguments.length));
for (i = 0; i < length; ++i) {
desc.value = arguments[i];
defineProperty(result, i, desc);
}
desc.value = null;
result.length = length;
return result;
};
================================================
FILE: array/to-array.js
================================================
"use strict";
var from = require("./from")
, isArray = Array.isArray;
module.exports = function (arrayLike) { return isArray(arrayLike) ? arrayLike : from(arrayLike); };
================================================
FILE: array/valid-array.js
================================================
"use strict";
var isArray = Array.isArray;
module.exports = function (value) {
if (isArray(value)) return value;
throw new TypeError(value + " is not an array");
};
================================================
FILE: boolean/index.js
================================================
"use strict";
module.exports = { isBoolean: require("./is-boolean") };
================================================
FILE: boolean/is-boolean.js
================================================
"use strict";
var objToString = Object.prototype.toString, id = objToString.call(true);
module.exports = function (value) {
return (
typeof value === "boolean" ||
(typeof value === "object" && (value instanceof Boolean || objToString.call(value) === id))
);
};
================================================
FILE: commitlint.config.js
================================================
"use strict";
module.exports = {
rules: {
"body-leading-blank": [2, "always"],
"body-max-line-length": [2, "always", 72],
"footer-leading-blank": [2, "always"],
"footer-max-line-length": [2, "always", 72],
"header-max-length": [2, "always", 72],
"scope-case": [2, "always", "start-case"],
"scope-enum": [2, "always", [""]],
"subject-case": [2, "always", "sentence-case"],
"subject-empty": [2, "never"],
"subject-full-stop": [2, "never", "."],
"type-case": [2, "always", "lower-case"],
"type-empty": [2, "never"],
"type-enum": [
2, "always",
["build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "style", "test"]
]
}
};
================================================
FILE: date/#/copy.js
================================================
"use strict";
var getTime = Date.prototype.getTime;
module.exports = function () { return new Date(getTime.call(this)); };
================================================
FILE: date/#/days-in-month.js
================================================
"use strict";
var getMonth = Date.prototype.getMonth;
module.exports = function () {
switch (getMonth.call(this)) {
case 1:
return this.getFullYear() % 4 ? 28 : 29;
case 3:
case 5:
case 8:
case 10:
return 30;
default:
return 31;
}
};
================================================
FILE: date/#/floor-day.js
================================================
"use strict";
var setHours = Date.prototype.setHours;
module.exports = function () {
setHours.call(this, 0, 0, 0, 0);
return this;
};
================================================
FILE: date/#/floor-month.js
================================================
"use strict";
var floorDay = require("./floor-day");
module.exports = function () {
floorDay.call(this).setDate(1);
return this;
};
================================================
FILE: date/#/floor-year.js
================================================
"use strict";
var floorMonth = require("./floor-month");
module.exports = function () {
floorMonth.call(this).setMonth(0);
return this;
};
================================================
FILE: date/#/format.js
================================================
/* eslint id-length: "off" */
"use strict";
var pad = require("../../number/#/pad")
, date = require("../valid-date")
, format;
format = require("../../string/format-method")({
Y: function () { return String(this.getFullYear()); },
y: function () { return String(this.getFullYear()).slice(-2); },
m: function () { return pad.call(this.getMonth() + 1, 2); },
d: function () { return pad.call(this.getDate(), 2); },
H: function () { return pad.call(this.getHours(), 2); },
M: function () { return pad.call(this.getMinutes(), 2); },
S: function () { return pad.call(this.getSeconds(), 2); },
L: function () { return pad.call(this.getMilliseconds(), 3); }
});
module.exports = function (pattern) { return format.call(date(this), pattern); };
================================================
FILE: date/#/index.js
================================================
"use strict";
module.exports = {
copy: require("./copy"),
daysInMonth: require("./days-in-month"),
floorDay: require("./floor-day"),
floorMonth: require("./floor-month"),
floorYear: require("./floor-year"),
format: require("./format")
};
================================================
FILE: date/ensure-time-value.js
================================================
"use strict";
var safeToString = require("../safe-to-string")
, toInteger = require("../number/to-integer")
, isTimeValue = require("./is-time-value");
module.exports = function (value) {
if (isTimeValue(value)) return toInteger(value);
throw new TypeError(safeToString(value) + " is not a valid time value");
};
================================================
FILE: date/index.js
================================================
"use strict";
module.exports = {
"#": require("./#"),
"ensureTimeValue": require("./ensure-time-value"),
"isDate": require("./is-date"),
"isTimeValue": require("./is-time-value"),
"validDate": require("./valid-date")
};
================================================
FILE: date/is-date.js
================================================
"use strict";
var objToString = Object.prototype.toString, id = objToString.call(new Date());
module.exports = function (value) {
return (
(value && !isNaN(value) && (value instanceof Date || objToString.call(value) === id)) ||
false
);
};
================================================
FILE: date/is-time-value.js
================================================
"use strict";
module.exports = function (value) {
try { value = Number(value); }
catch (e) { return false; }
if (isNaN(value)) return false;
if (Math.abs(value) > 8.64e15) return false;
return true;
};
================================================
FILE: date/valid-date.js
================================================
"use strict";
var isDate = require("./is-date");
module.exports = function (value) {
if (!isDate(value)) throw new TypeError(value + " is not valid Date object");
return value;
};
================================================
FILE: error/#/index.js
================================================
"use strict";
module.exports = { throw: require("./throw") };
================================================
FILE: error/#/throw.js
================================================
"use strict";
var error = require("../valid-error");
module.exports = function () { throw error(this); };
================================================
FILE: error/custom.js
================================================
"use strict";
var assign = require("../object/assign")
, isObject = require("../object/is-object")
, isValue = require("../object/is-value")
, captureStackTrace = Error.captureStackTrace;
module.exports = function (message /*, code, ext*/) {
var err = new Error(message), code = arguments[1], ext = arguments[2];
if (!isValue(ext)) {
if (isObject(code)) {
ext = code;
code = null;
}
}
if (isValue(ext)) assign(err, ext);
if (isValue(code)) err.code = code;
if (captureStackTrace) captureStackTrace(err, module.exports);
return err;
};
================================================
FILE: error/index.js
================================================
"use strict";
module.exports = {
"#": require("./#"),
"custom": require("./custom"),
"isError": require("./is-error"),
"validError": require("./valid-error")
};
================================================
FILE: error/is-error.js
================================================
"use strict";
var objToString = Object.prototype.toString, id = objToString.call(new Error());
module.exports = function (value) {
return (value && (value instanceof Error || objToString.call(value) === id)) || false;
};
================================================
FILE: error/valid-error.js
================================================
"use strict";
var isError = require("./is-error");
module.exports = function (value) {
if (!isError(value)) throw new TypeError(value + " is not an Error object");
return value;
};
================================================
FILE: function/#/compose.js
================================================
"use strict";
var isValue = require("../../object/is-value")
, callable = require("../../object/valid-callable")
, aFrom = require("../../array/from");
var apply = Function.prototype.apply
, call = Function.prototype.call
, callFn = function (arg, fn) { return call.call(fn, this, arg); };
module.exports = function (fnIgnored /*, …fnn*/) {
var fns, first;
var args = aFrom(arguments);
fns = isValue(this) ? [this].concat(args) : args;
fns.forEach(callable);
fns = fns.reverse();
first = fns[0];
fns = fns.slice(1);
return function (argIgnored) { return fns.reduce(callFn, apply.call(first, this, arguments)); };
};
================================================
FILE: function/#/copy.js
================================================
"use strict";
var mixin = require("../../object/mixin")
, validFunction = require("../valid-function");
module.exports = function () {
validFunction(this);
var args = [];
for (var i = 0; i < this.length; ++i) args.push("arg" + (i + 1));
// eslint-disable-next-line no-new-func
var fn = new Function(
"fn",
"return function " +
(this.name || "") +
"(" +
args.join(", ") +
") { return fn.apply(this, arguments); };"
)(this);
try { mixin(fn, this); }
catch (ignore) {}
return fn;
};
================================================
FILE: function/#/curry.js
================================================
"use strict";
var toPosInt = require("../../number/to-pos-integer")
, callable = require("../../object/valid-callable")
, defineLength = require("../_define-length")
, slice = Array.prototype.slice
, apply = Function.prototype.apply
, curry;
curry = function self(fn, length, preArgs) {
return defineLength(
function () {
var args = preArgs
? preArgs.concat(slice.call(arguments, 0, length - preArgs.length))
: slice.call(arguments, 0, length);
return args.length === length ? apply.call(fn, this, args) : self(fn, length, args);
},
preArgs ? length - preArgs.length : length
);
};
module.exports = function (/* Length*/) {
var length = arguments[0];
return curry(callable(this), isNaN(length) ? toPosInt(this.length) : toPosInt(length));
};
================================================
FILE: function/#/index.js
================================================
"use strict";
module.exports = {
compose: require("./compose"),
copy: require("./copy"),
curry: require("./curry"),
lock: require("./lock"),
microtaskDelay: require("./microtask-delay"),
not: require("./not"),
partial: require("./partial"),
spread: require("./spread"),
toStringTokens: require("./to-string-tokens")
};
================================================
FILE: function/#/lock.js
================================================
"use strict";
var callable = require("../../object/valid-callable")
, apply = Function.prototype.apply;
module.exports = function (/* …args*/) {
var fn = callable(this), args = arguments;
return function () { return apply.call(fn, this, args); };
};
================================================
FILE: function/#/microtask-delay.js
================================================
"use strict";
var ensurePlainFunction = require("../../object/ensure-plain-function")
, defineLength = require("../_define-length")
, nextTick = require("next-tick");
var apply = Function.prototype.apply;
module.exports = function () {
var src = ensurePlainFunction(this);
return defineLength(function () { nextTick(apply.bind(src, this, arguments)); }, this.length);
};
================================================
FILE: function/#/not.js
================================================
"use strict";
var callable = require("../../object/valid-callable")
, defineLength = require("../_define-length")
, apply = Function.prototype.apply;
module.exports = function () {
var fn = callable(this);
return defineLength(function () { return !apply.call(fn, this, arguments); }, fn.length);
};
================================================
FILE: function/#/partial.js
================================================
"use strict";
var callable = require("../../object/valid-callable")
, aFrom = require("../../array/from")
, defineLength = require("../_define-length")
, apply = Function.prototype.apply;
module.exports = function (/* …args*/) {
var fn = callable(this), args = aFrom(arguments);
return defineLength(function () {
return apply.call(fn, this, args.concat(aFrom(arguments)));
}, fn.length - args.length);
};
================================================
FILE: function/#/spread.js
================================================
"use strict";
var callable = require("../../object/valid-callable")
, apply = Function.prototype.apply;
module.exports = function () {
var fn = callable(this);
return function (args) { return apply.call(fn, this, args); };
};
================================================
FILE: function/#/to-string-tokens.js
================================================
"use strict";
var isValue = require("../../object/is-value")
, esniff = require("esniff")
, validFunction = require("../valid-function");
var classRe = /^\s*class[\s{/}]/;
module.exports = function () {
var str = String(validFunction(this));
if (classRe.test(str)) throw new Error("Class methods are not supported");
var argsStartIndex
, argsEndIndex
, bodyStartIndex
, bodyEndReverseIndex = -1
, shouldTrimArgs = false;
esniff(str, function (emitter, accessor) {
emitter.once("trigger:(", function () { argsStartIndex = accessor.index + 1; });
emitter.once("trigger:=", function () {
if (isValue(argsStartIndex)) return;
argsStartIndex = 0;
argsEndIndex = accessor.index;
shouldTrimArgs = true;
if (!accessor.skipCodePart("=>")) {
throw new Error("Unexpected function string: " + str);
}
accessor.skipWhitespace();
if (!accessor.skipCodePart("{")) bodyEndReverseIndex = Infinity;
bodyStartIndex = accessor.index;
});
emitter.on("trigger:)", function () {
if (accessor.scopeDepth) return;
argsEndIndex = accessor.index;
accessor.skipCodePart(")");
accessor.skipWhitespace();
if (accessor.skipCodePart("=>")) {
accessor.skipWhitespace();
if (!accessor.skipCodePart("{")) bodyEndReverseIndex = Infinity;
} else if (!accessor.skipCodePart("{")) {
throw new Error("Unexpected function string: " + str);
}
bodyStartIndex = accessor.index;
accessor.stop();
});
});
var argsString = str.slice(argsStartIndex, argsEndIndex);
if (shouldTrimArgs) argsString = argsString.trim();
return { args: argsString, body: str.slice(bodyStartIndex, bodyEndReverseIndex) };
};
================================================
FILE: function/_define-length.js
================================================
"use strict";
var toPosInt = require("../number/to-pos-integer");
var test = function (arg1, arg2) { return arg2; };
var desc, defineProperty, generate, mixin;
try {
Object.defineProperty(test, "length", {
configurable: true,
writable: false,
enumerable: false,
value: 1
});
}
catch (ignore) {}
if (test.length === 1) {
// ES6
desc = { configurable: true, writable: false, enumerable: false };
defineProperty = Object.defineProperty;
module.exports = function (fn, length) {
length = toPosInt(length);
if (fn.length === length) return fn;
desc.value = length;
return defineProperty(fn, "length", desc);
};
} else {
mixin = require("../object/mixin");
generate = (function () {
var cache = [];
return function (length) {
var args, i = 0;
if (cache[length]) return cache[length];
args = [];
while (length--) args.push("a" + (++i).toString(36));
// eslint-disable-next-line no-new-func
return new Function(
"fn",
"return function (" + args.join(", ") + ") { return fn.apply(this, arguments); };"
);
};
})();
module.exports = function (src, length) {
var target;
length = toPosInt(length);
if (src.length === length) return src;
target = generate(length)(src);
try { mixin(target, src); }
catch (ignore) {}
return target;
};
}
================================================
FILE: function/constant.js
================================================
"use strict";
module.exports = function (value) {
return function () { return value; };
};
================================================
FILE: function/identity.js
================================================
"use strict";
module.exports = function (value) { return value; };
================================================
FILE: function/index.js
================================================
// Export all modules.
"use strict";
module.exports = {
"#": require("./#"),
"constant": require("./constant"),
"identity": require("./identity"),
"invoke": require("./invoke"),
"isArguments": require("./is-arguments"),
"isFunction": require("./is-function"),
"noop": require("./noop"),
"pluck": require("./pluck"),
"validFunction": require("./valid-function")
};
================================================
FILE: function/invoke.js
================================================
"use strict";
var isCallable = require("../object/is-callable")
, value = require("../object/valid-value")
, slice = Array.prototype.slice
, apply = Function.prototype.apply;
module.exports = function (name /*, …args*/) {
var args = slice.call(arguments, 1), isFn = isCallable(name);
return function (obj) {
value(obj);
return apply.call(isFn ? name : obj[name], obj, args.concat(slice.call(arguments, 1)));
};
};
================================================
FILE: function/is-arguments.js
================================================
"use strict";
var objToString = Object.prototype.toString
, id = objToString.call((function () { return arguments; })());
module.exports = function (value) { return objToString.call(value) === id; };
================================================
FILE: function/is-function.js
================================================
"use strict";
var objToString = Object.prototype.toString
, isFunctionStringTag = RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);
module.exports = function (value) {
return typeof value === "function" && isFunctionStringTag(objToString.call(value));
};
================================================
FILE: function/noop.js
================================================
"use strict";
// eslint-disable-next-line no-empty-function
module.exports = function () {};
================================================
FILE: function/pluck.js
================================================
"use strict";
var value = require("../object/valid-value");
module.exports = function (name) {
return function (obj) { return value(obj)[name]; };
};
================================================
FILE: function/valid-function.js
================================================
"use strict";
var isFunction = require("./is-function");
module.exports = function (value) {
if (!isFunction(value)) throw new TypeError(value + " is not a function");
return value;
};
================================================
FILE: global.js
================================================
var naiveFallback = function () {
if (typeof self === "object" && self) return self;
if (typeof window === "object" && window) return window;
throw new Error("Unable to resolve global `this`");
};
module.exports = (function () {
if (this) return this;
// Unexpected strict mode (may happen if e.g. bundled into ESM module)
// Fallback to standard globalThis if available
if (typeof globalThis === "object" && globalThis) return globalThis;
// Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis
// In all ES5+ engines global object inherits from Object.prototype
// (if you approached one that doesn't please report)
try {
Object.defineProperty(Object.prototype, "__global__", {
get: function () { return this; },
configurable: true
});
} catch (error) {
// Unfortunate case of updates to Object.prototype being restricted
// via preventExtensions, seal or freeze
return naiveFallback();
}
try {
// Safari case (window.__global__ works, but __global__ does not)
if (!__global__) return naiveFallback();
return __global__;
} finally {
delete Object.prototype.__global__;
}
})();
================================================
FILE: index.js
================================================
"use strict";
module.exports = {
global: require("./global"),
optionalChaining: require("./optional-chaining"),
safeToString: require("./safe-to-string"),
toShortStringRepresentation: require("./to-short-string-representation"),
array: require("./array"),
boolean: require("./boolean"),
date: require("./date"),
error: require("./error"),
function: require("./function"),
iterable: require("./iterable"),
json: require("./json"),
math: require("./math"),
number: require("./number"),
object: require("./object"),
promise: require("./promise"),
regExp: require("./reg-exp"),
string: require("./string")
};
================================================
FILE: iterable/for-each.js
================================================
"use strict";
var forOf = require("es6-iterator/for-of")
, isIterable = require("es6-iterator/is-iterable")
, iterable = require("./validate")
, forEach = Array.prototype.forEach;
module.exports = function (target, cb /*, thisArg*/) {
if (isIterable(iterable(target))) forOf(target, cb, arguments[2]);
else forEach.call(target, cb, arguments[2]);
};
================================================
FILE: iterable/index.js
================================================
"use strict";
module.exports = {
forEach: require("./for-each"),
is: require("./is"),
validate: require("./validate"),
validateObject: require("./validate-object")
};
================================================
FILE: iterable/is.js
================================================
"use strict";
var iteratorSymbol = require("es6-symbol").iterator
, isValue = require("../object/is-value")
, isArrayLike = require("../object/is-array-like");
module.exports = function (value) {
if (!isValue(value)) return false;
if (typeof value[iteratorSymbol] === "function") return true;
return isArrayLike(value);
};
================================================
FILE: iterable/validate-object.js
================================================
"use strict";
var isObject = require("../object/is-object")
, is = require("./is");
module.exports = function (value) {
if (is(value) && isObject(value)) return value;
throw new TypeError(value + " is not an iterable or array-like object");
};
================================================
FILE: iterable/validate.js
================================================
"use strict";
var is = require("./is");
module.exports = function (value) {
if (is(value)) return value;
throw new TypeError(value + " is not an iterable or array-like");
};
================================================
FILE: json/index.js
================================================
"use strict";
module.exports = { safeStringify: require("./safe-stringify") };
================================================
FILE: json/safe-stringify.js
================================================
"use strict";
var compact = require("../array/#/compact")
, isObject = require("../object/is-object")
, toArray = require("../object/to-array")
, isArray = Array.isArray
, stringify = JSON.stringify;
module.exports = function self(value /*, replacer, space*/) {
var replacer = arguments[1], space = arguments[2];
try {
return stringify(value, replacer, space);
} catch (e) {
if (!isObject(value)) return null;
if (typeof value.toJSON === "function") return null;
if (isArray(value)) {
return (
"[" +
compact.call(value.map(function (item) { return self(item, replacer, space); })) +
"]"
);
}
return (
"{" +
compact
.call(
toArray(value, function (item, key) {
item = self(item, replacer, space);
if (!item) return null;
return stringify(key) + ":" + item;
})
)
.join(",") +
"}"
);
}
};
================================================
FILE: math/_decimal-adjust.js
================================================
// Credit:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round
// #Decimal_rounding
"use strict";
var isValue = require("../object/is-value")
, ensureInteger = require("../object/ensure-integer");
var split = String.prototype.split;
module.exports = function (type) {
return function (value /*, exp*/) {
value = Number(value);
var exp = arguments[1];
if (isValue(exp)) exp = ensureInteger(exp);
if (!value) return value;
if (!exp) return Math[type](value);
if (!isFinite(value)) return value;
// Shift
var tokens = split.call(value, "e");
value = Math[type](tokens[0] + "e" + ((tokens[1] || 0) - exp));
// Shift back
tokens = value.toString().split("e");
return Number(tokens[0] + "e" + (Number(tokens[1] || 0) + exp));
};
};
================================================
FILE: math/_pack-ieee754.js
================================================
/* eslint no-bitwise: "off" */
// Credit: https://github.com/paulmillr/es6-shim/
"use strict";
var abs = Math.abs
, floor = Math.floor
, log = Math.log
, min = Math.min
, pow = Math.pow
, LN2 = Math.LN2
, roundToEven;
roundToEven = function (num) {
var whole = floor(num), fraction = num - whole;
if (fraction < 0.5) return whole;
if (fraction > 0.5) return whole + 1;
return whole % 2 ? whole + 1 : whole;
};
// eslint-disable-next-line max-statements, max-lines-per-function
module.exports = function (value, ebits, fbits) {
var bias = (1 << (ebits - 1)) - 1, sign, e, fraction, i, bits, str, bytes;
// Compute sign, exponent, fraction
if (isNaN(value)) {
// NaN
// http://dev.w3.org/2006/webapi/WebIDL/#es-type-mapping
e = (1 << ebits) - 1;
fraction = pow(2, fbits - 1);
sign = 0;
} else if (value === Infinity || value === -Infinity) {
e = (1 << ebits) - 1;
fraction = 0;
sign = value < 0 ? 1 : 0;
} else if (value === 0) {
e = 0;
fraction = 0;
sign = 1 / value === -Infinity ? 1 : 0;
} else {
sign = value < 0;
value = abs(value);
if (value >= pow(2, 1 - bias)) {
e = min(floor(log(value) / LN2), 1023);
fraction = roundToEven((value / pow(2, e)) * pow(2, fbits));
if (fraction / pow(2, fbits) >= 2) {
e += 1;
fraction = 1;
}
if (e > bias) {
// Overflow
e = (1 << ebits) - 1;
fraction = 0;
} else {
// Normal
e += bias;
fraction -= pow(2, fbits);
}
} else {
// Subnormal
e = 0;
fraction = roundToEven(value / pow(2, 1 - bias - fbits));
}
}
// Pack sign, exponent, fraction
bits = [];
for (i = fbits; i; i -= 1) {
bits.push(fraction % 2 ? 1 : 0);
fraction = floor(fraction / 2);
}
for (i = ebits; i; i -= 1) {
bits.push(e % 2 ? 1 : 0);
e = floor(e / 2);
}
bits.push(sign ? 1 : 0);
bits.reverse();
str = bits.join("");
// Bits to bytes
bytes = [];
while (str.length) {
bytes.push(parseInt(str.substring(0, 8), 2));
str = str.substring(8);
}
return bytes;
};
================================================
FILE: math/_unpack-ieee754.js
================================================
/* eslint no-bitwise: "off" */
// Credit: https://github.com/paulmillr/es6-shim/
"use strict";
var pow = Math.pow;
module.exports = function (bytes, ebits, fbits) {
// Bytes to bits
var bits = [], i, j, bit, str, bias, sign, e, fraction;
for (i = bytes.length; i; i -= 1) {
bit = bytes[i - 1];
for (j = 8; j; j -= 1) {
bits.push(bit % 2 ? 1 : 0);
bit >>= 1;
}
}
bits.reverse();
str = bits.join("");
// Unpack sign, exponent, fraction
bias = (1 << (ebits - 1)) - 1;
sign = parseInt(str.substring(0, 1), 2) ? -1 : 1;
e = parseInt(str.substring(1, 1 + ebits), 2);
fraction = parseInt(str.substring(1 + ebits), 2);
// Produce number
if (e === (1 << ebits) - 1) return fraction === 0 ? sign * Infinity : NaN;
if (e > 0) return sign * pow(2, e - bias) * (1 + fraction / pow(2, fbits));
if (fraction !== 0) return sign * pow(2, -(bias - 1)) * (fraction / pow(2, fbits));
return sign < 0 ? -0 : 0;
};
================================================
FILE: math/acosh/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "acosh", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/acosh/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.acosh : require("./shim");
================================================
FILE: math/acosh/is-implemented.js
================================================
"use strict";
module.exports = function () {
var acosh = Math.acosh;
if (typeof acosh !== "function") return false;
return acosh(2) === 1.3169578969248166;
};
================================================
FILE: math/acosh/shim.js
================================================
"use strict";
var log = Math.log, sqrt = Math.sqrt;
module.exports = function (value) {
if (isNaN(value)) return NaN;
value = Number(value);
if (value < 1) return NaN;
if (value === 1) return 0;
if (value === Infinity) return value;
return log(value + sqrt(value * value - 1));
};
================================================
FILE: math/asinh/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "asinh", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/asinh/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.asinh : require("./shim");
================================================
FILE: math/asinh/is-implemented.js
================================================
"use strict";
module.exports = function () {
var asinh = Math.asinh;
if (typeof asinh !== "function") return false;
return asinh(2) === 1.4436354751788103;
};
================================================
FILE: math/asinh/shim.js
================================================
"use strict";
var log = Math.log, sqrt = Math.sqrt;
module.exports = function (value) {
if (isNaN(value)) return NaN;
value = Number(value);
if (value === 0) return value;
if (!isFinite(value)) return value;
if (value < 0) {
value = -value;
return -log(value + sqrt(value * value + 1));
}
return log(value + sqrt(value * value + 1));
};
================================================
FILE: math/atanh/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "atanh", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/atanh/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.atanh : require("./shim");
================================================
FILE: math/atanh/is-implemented.js
================================================
"use strict";
module.exports = function () {
var atanh = Math.atanh;
if (typeof atanh !== "function") return false;
return Math.round(atanh(0.5) * 1e15) === 549306144334055;
};
================================================
FILE: math/atanh/shim.js
================================================
"use strict";
var log = Math.log;
module.exports = function (value) {
if (isNaN(value)) return NaN;
value = Number(value);
if (value < -1) return NaN;
if (value > 1) return NaN;
if (value === -1) return -Infinity;
if (value === 1) return Infinity;
if (value === 0) return value;
return 0.5 * log((1 + value) / (1 - value));
};
================================================
FILE: math/cbrt/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "cbrt", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/cbrt/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.cbrt : require("./shim");
================================================
FILE: math/cbrt/is-implemented.js
================================================
"use strict";
module.exports = function () {
var cbrt = Math.cbrt;
if (typeof cbrt !== "function") return false;
return cbrt(2) === 1.2599210498948732;
};
================================================
FILE: math/cbrt/shim.js
================================================
"use strict";
var pow = Math.pow;
module.exports = function (value) {
if (isNaN(value)) return NaN;
value = Number(value);
if (value === 0) return value;
if (!isFinite(value)) return value;
if (value < 0) return -pow(-value, 1 / 3);
return pow(value, 1 / 3);
};
================================================
FILE: math/ceil-10.js
================================================
"use strict";
module.exports = require("./_decimal-adjust")("ceil");
================================================
FILE: math/clz32/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "clz32", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/clz32/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.clz32 : require("./shim");
================================================
FILE: math/clz32/is-implemented.js
================================================
"use strict";
module.exports = function () {
var clz32 = Math.clz32;
if (typeof clz32 !== "function") return false;
return clz32(1000) === 22;
};
================================================
FILE: math/clz32/shim.js
================================================
"use strict";
module.exports = function (value) {
// eslint-disable-next-line no-bitwise
value >>>= 0;
return value ? 32 - value.toString(2).length : 32;
};
================================================
FILE: math/cosh/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "cosh", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/cosh/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.cosh : require("./shim");
================================================
FILE: math/cosh/is-implemented.js
================================================
"use strict";
module.exports = function () {
var cosh = Math.cosh;
if (typeof cosh !== "function") return false;
return cosh(1) === 1.5430806348152437;
};
================================================
FILE: math/cosh/shim.js
================================================
"use strict";
var exp = Math.exp;
module.exports = function (value) {
if (isNaN(value)) return NaN;
value = Number(value);
if (value === 0) return 1;
if (!isFinite(value)) return Infinity;
return (exp(value) + exp(-value)) / 2;
};
================================================
FILE: math/expm1/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "expm1", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/expm1/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.expm1 : require("./shim");
================================================
FILE: math/expm1/is-implemented.js
================================================
"use strict";
module.exports = function () {
var expm1 = Math.expm1;
if (typeof expm1 !== "function") return false;
return expm1(1).toFixed(15) === "1.718281828459045";
};
================================================
FILE: math/expm1/shim.js
================================================
// Thanks: https://github.com/monolithed/ECMAScript-6
"use strict";
var exp = Math.exp;
module.exports = function (value) {
if (isNaN(value)) return NaN;
value = Number(value);
if (value === 0) return value;
if (value === Infinity) return Infinity;
if (value === -Infinity) return -1;
if (value > -1.0e-6 && value < 1.0e-6) return value + (value * value) / 2;
return exp(value) - 1;
};
================================================
FILE: math/floor-10.js
================================================
"use strict";
module.exports = require("./_decimal-adjust")("floor");
================================================
FILE: math/fround/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "fround", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/fround/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.fround : require("./shim");
================================================
FILE: math/fround/is-implemented.js
================================================
"use strict";
module.exports = function () {
var fround = Math.fround;
if (typeof fround !== "function") return false;
return fround(1.337) === 1.3370000123977661;
};
================================================
FILE: math/fround/shim.js
================================================
/* global Float32Array */
// Credit: https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js
"use strict";
var toFloat32;
if (typeof Float32Array === "undefined") {
toFloat32 = (function () {
var pack = require("../_pack-ieee754")
, unpack = require("../_unpack-ieee754");
return function (value) { return unpack(pack(value, 8, 23), 8, 23); };
})();
} else {
toFloat32 = (function () {
var float32Array = new Float32Array(1);
return function (num) {
float32Array[0] = num;
return float32Array[0];
};
})();
}
module.exports = function (value) {
if (isNaN(value)) return NaN;
value = Number(value);
if (value === 0) return value;
if (!isFinite(value)) return value;
return toFloat32(value);
};
================================================
FILE: math/hypot/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "hypot", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/hypot/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.hypot : require("./shim");
================================================
FILE: math/hypot/is-implemented.js
================================================
"use strict";
module.exports = function () {
var hypot = Math.hypot;
if (typeof hypot !== "function") return false;
return hypot(3, 4) === 5;
};
================================================
FILE: math/hypot/shim.js
================================================
// Thanks for hints: https://github.com/paulmillr/es6-shim
"use strict";
var some = Array.prototype.some
, abs = Math.abs
, sqrt = Math.sqrt
, compare = function (val1, val2) { return val2 - val1; }
, divide = function (value) { return value / this; }
, add = function (sum, number) { return sum + number * number; };
// eslint-disable-next-line no-unused-vars
module.exports = function (val1, val2 /*, …valn*/) {
var result, numbers;
if (!arguments.length) return 0;
some.call(arguments, function (val) {
if (isNaN(val)) {
result = NaN;
return false;
}
if (!isFinite(val)) {
result = Infinity;
return true;
}
if (result !== undefined) return false;
val = Number(val);
if (val === 0) return false;
if (numbers) numbers.push(abs(val));
else numbers = [abs(val)];
return false;
});
if (result !== undefined) return result;
if (!numbers) return 0;
numbers.sort(compare);
return numbers[0] * sqrt(numbers.map(divide, numbers[0]).reduce(add, 0));
};
================================================
FILE: math/imul/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "imul", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/imul/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.imul : require("./shim");
================================================
FILE: math/imul/is-implemented.js
================================================
"use strict";
module.exports = function () {
var imul = Math.imul;
if (typeof imul !== "function") return false;
return imul(-1, 8) === -8;
};
================================================
FILE: math/imul/shim.js
================================================
/* eslint no-bitwise: "off" */
// Thanks: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
// /Global_Objects/Math/imul
"use strict";
module.exports = function (val1, val2) {
var xh = (val1 >>> 16) & 0xffff
, xl = val1 & 0xffff
, yh = (val2 >>> 16) & 0xffff
, yl = val2 & 0xffff;
// The shift by 0 fixes the sign on the high part
// the final |0 converts the unsigned value into a signed value
return (xl * yl + (((xh * yl + xl * yh) << 16) >>> 0)) | 0;
};
================================================
FILE: math/index.js
================================================
"use strict";
module.exports = {
acosh: require("./acosh"),
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"),
trunc: require("./trunc")
};
================================================
FILE: math/log10/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "log10", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/log10/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.log10 : require("./shim");
================================================
FILE: math/log10/is-implemented.js
================================================
"use strict";
module.exports = function () {
var log10 = Math.log10;
if (typeof log10 !== "function") return false;
return log10(2) === 0.3010299956639812;
};
================================================
FILE: math/log10/shim.js
================================================
"use strict";
var log = Math.log, LOG10E = Math.LOG10E;
module.exports = function (value) {
if (isNaN(value)) return NaN;
value = Number(value);
if (value < 0) return NaN;
if (value === 0) return -Infinity;
if (value === 1) return 0;
if (value === Infinity) return Infinity;
return log(value) * LOG10E;
};
================================================
FILE: math/log1p/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "log1p", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/log1p/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.log1p : require("./shim");
================================================
FILE: math/log1p/is-implemented.js
================================================
"use strict";
module.exports = function () {
var log1p = Math.log1p;
if (typeof log1p !== "function") return false;
return log1p(1) === 0.6931471805599453;
};
================================================
FILE: math/log1p/shim.js
================================================
// Thanks: https://github.com/monolithed/ECMAScript-6/blob/master/ES6.js
"use strict";
var log = Math.log;
module.exports = function (value) {
if (isNaN(value)) return NaN;
value = Number(value);
if (value < -1) return NaN;
if (value === -1) return -Infinity;
if (value === 0) return value;
if (value === Infinity) return Infinity;
if (value > -1.0e-8 && value < 1.0e-8) return value - (value * value) / 2;
return log(1 + value);
};
================================================
FILE: math/log2/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "log2", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/log2/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.log2 : require("./shim");
================================================
FILE: math/log2/is-implemented.js
================================================
"use strict";
module.exports = function () {
var log2 = Math.log2;
if (typeof log2 !== "function") return false;
return log2(3).toFixed(15) === "1.584962500721156";
};
================================================
FILE: math/log2/shim.js
================================================
"use strict";
var log = Math.log, LOG2E = Math.LOG2E;
module.exports = function (value) {
if (isNaN(value)) return NaN;
value = Number(value);
if (value < 0) return NaN;
if (value === 0) return -Infinity;
if (value === 1) return 0;
if (value === Infinity) return Infinity;
return log(value) * LOG2E;
};
================================================
FILE: math/round-10.js
================================================
"use strict";
module.exports = require("./_decimal-adjust")("round");
================================================
FILE: math/sign/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "sign", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/sign/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.sign : require("./shim");
================================================
FILE: math/sign/is-implemented.js
================================================
"use strict";
module.exports = function () {
var sign = Math.sign;
if (typeof sign !== "function") return false;
return sign(10) === 1 && sign(-20) === -1;
};
================================================
FILE: math/sign/shim.js
================================================
"use strict";
module.exports = function (value) {
value = Number(value);
if (isNaN(value) || value === 0) return value;
return value > 0 ? 1 : -1;
};
================================================
FILE: math/sinh/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "sinh", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/sinh/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.sinh : require("./shim");
================================================
FILE: math/sinh/is-implemented.js
================================================
"use strict";
module.exports = function () {
var sinh = Math.sinh;
if (typeof sinh !== "function") return false;
return sinh(1) === 1.1752011936438014 && sinh(Number.MIN_VALUE) === 5e-324;
};
================================================
FILE: math/sinh/shim.js
================================================
// Parts of implementation taken from es6-shim project
// See: https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js
"use strict";
var expm1 = require("../expm1")
, abs = Math.abs
, exp = Math.exp
, e = Math.E;
module.exports = function (value) {
if (isNaN(value)) return NaN;
value = Number(value);
if (value === 0) return value;
if (!isFinite(value)) return value;
if (abs(value) < 1) return (expm1(value) - expm1(-value)) / 2;
return ((exp(value - 1) - exp(-value - 1)) * e) / 2;
};
================================================
FILE: math/tanh/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "tanh", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/tanh/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.tanh : require("./shim");
================================================
FILE: math/tanh/is-implemented.js
================================================
"use strict";
module.exports = function () {
var tanh = Math.tanh;
if (typeof tanh !== "function") return false;
return tanh(1) === 0.7615941559557649 && tanh(Number.MAX_VALUE) === 1;
};
================================================
FILE: math/tanh/shim.js
================================================
"use strict";
var exp = Math.exp;
module.exports = function (value) {
var num1, num2;
if (isNaN(value)) return NaN;
value = Number(value);
if (value === 0) return value;
if (value === Infinity) return 1;
if (value === -Infinity) return -1;
num1 = exp(value);
if (num1 === Infinity) return 1;
num2 = exp(-value);
if (num2 === Infinity) return -1;
return (num1 - num2) / (num1 + num2);
};
================================================
FILE: math/trunc/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "trunc", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: math/trunc/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Math.trunc : require("./shim");
================================================
FILE: math/trunc/is-implemented.js
================================================
"use strict";
module.exports = function () {
var trunc = Math.trunc;
if (typeof trunc !== "function") return false;
return trunc(13.67) === 13 && trunc(-13.67) === -13;
};
================================================
FILE: math/trunc/shim.js
================================================
"use strict";
var floor = Math.floor;
module.exports = function (value) {
if (isNaN(value)) return NaN;
value = Number(value);
if (value === 0) return value;
if (value === Infinity) return Infinity;
if (value === -Infinity) return -Infinity;
if (value > 0) return floor(value);
return -floor(-value);
};
================================================
FILE: number/#/index.js
================================================
"use strict";
module.exports = { pad: require("./pad") };
================================================
FILE: number/#/pad.js
================================================
"use strict";
var pad = require("../../string/#/pad")
, toPosInt = require("../to-pos-integer")
, toFixed = Number.prototype.toFixed;
module.exports = function (length /*, precision*/) {
var precision;
length = toPosInt(length);
precision = toPosInt(arguments[1]);
return pad.call(
precision ? toFixed.call(this, precision) : this, "0",
length + (precision ? 1 + precision : 0)
);
};
================================================
FILE: number/epsilon/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Number, "EPSILON", {
value: require("./"),
configurable: false,
enumerable: false,
writable: false
});
}
================================================
FILE: number/epsilon/index.js
================================================
"use strict";
module.exports = 2.220446049250313e-16;
================================================
FILE: number/epsilon/is-implemented.js
================================================
"use strict";
module.exports = function () { return typeof Number.EPSILON === "number"; };
================================================
FILE: number/index.js
================================================
"use strict";
module.exports = {
"#": require("./#"),
"EPSILON": require("./epsilon"),
"isFinite": require("./is-finite"),
"isInteger": require("./is-integer"),
"isNaN": require("./is-nan"),
"isNatural": require("./is-natural"),
"isNumber": require("./is-number"),
"isSafeInteger": require("./is-safe-integer"),
"MAX_SAFE_INTEGER": require("./max-safe-integer"),
"MIN_SAFE_INTEGER": require("./min-safe-integer"),
"toInteger": require("./to-integer"),
"toPosInteger": require("./to-pos-integer"),
"toUint32": require("./to-uint32")
};
================================================
FILE: number/is-finite/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Number, "isFinite", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: number/is-finite/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Number.isFinite : require("./shim");
================================================
FILE: number/is-finite/is-implemented.js
================================================
"use strict";
module.exports = function () {
var numberIsFinite = Number.isFinite;
if (typeof numberIsFinite !== "function") return false;
return !numberIsFinite("23") && numberIsFinite(34) && !numberIsFinite(Infinity);
};
================================================
FILE: number/is-finite/shim.js
================================================
"use strict";
module.exports = function (value) { return typeof value === "number" && isFinite(value); };
================================================
FILE: number/is-integer/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Number, "isInteger", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: number/is-integer/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Number.isInteger : require("./shim");
================================================
FILE: number/is-integer/is-implemented.js
================================================
"use strict";
module.exports = function () {
var isInteger = Number.isInteger;
if (typeof isInteger !== "function") return false;
return !isInteger("23") && isInteger(34) && !isInteger(32.34);
};
================================================
FILE: number/is-integer/shim.js
================================================
// Credit: http://www.2ality.com/2014/05/is-integer.html
"use strict";
module.exports = function (value) {
if (typeof value !== "number") return false;
return value % 1 === 0;
};
================================================
FILE: number/is-nan/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Number, "isNaN", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: number/is-nan/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Number.isNaN : require("./shim");
================================================
FILE: number/is-nan/is-implemented.js
================================================
"use strict";
module.exports = function () {
var numberIsNaN = Number.isNaN;
if (typeof numberIsNaN !== "function") return false;
return !numberIsNaN({}) && numberIsNaN(NaN) && !numberIsNaN(34);
};
================================================
FILE: number/is-nan/shim.js
================================================
"use strict";
module.exports = function (value) {
// eslint-disable-next-line no-self-compare
return value !== value;
};
================================================
FILE: number/is-natural.js
================================================
"use strict";
var isInteger = require("./is-integer");
module.exports = function (num) { return isInteger(num) && num >= 0; };
================================================
FILE: number/is-number.js
================================================
"use strict";
var objToString = Object.prototype.toString, id = objToString.call(1);
module.exports = function (value) {
return (
typeof value === "number" ||
value instanceof Number ||
(typeof value === "object" && objToString.call(value) === id)
);
};
================================================
FILE: number/is-safe-integer/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Number, "isSafeInteger", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}
================================================
FILE: number/is-safe-integer/index.js
================================================
"use strict";
module.exports = require("./is-implemented")() ? Number.isSafeInteger : require("./shim");
================================================
FILE: number/is-safe-integer/is-implemented.js
================================================
"use strict";
module.exports = function () {
var isSafeInteger = Number.isSafeInteger;
if (typeof isSafeInteger !== "function") return false;
return !isSafeInteger("23") && isSafeInteger(34232322323) && !isSafeInteger(9007199254740992);
};
================================================
FILE: number/is-safe-integer/shim.js
================================================
"use strict";
var isInteger = require("../is-integer/shim")
, maxValue = require("../max-safe-integer")
, abs = Math.abs;
module.exports = function (value) {
if (!isInteger(value)) return false;
return abs(value) <= maxValue;
};
================================================
FILE: number/max-safe-integer/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Number, "MAX_SAFE_INTEGER", {
value: require("./"),
configurable: false,
enumerable: false,
writable: false
});
}
================================================
FILE: number/max-safe-integer/index.js
================================================
"use strict";
module.exports = Math.pow(2, 53) - 1;
================================================
FILE: number/max-safe-integer/is-implemented.js
================================================
"use strict";
module.exports = function () { return typeof Number.MAX_SAFE_INTEGER === "number"; };
================================================
FILE: number/min-safe-integer/implement.js
================================================
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Number, "MIN_SAFE_INTEGER", {
value: require("./"),
configurable: false,
enumerable: false,
writable: false
});
}
================================================
FILE: number/min-safe-integer/index.js
================================================
"use strict";
module.exports = -(Math.pow(2, 53) - 1);
================================================
FILE: number/min-safe-integer/is-implemented.js
================================================
"use strict";
module.exports = function () { return typeof Number.MIN_SAFE_INTEGER === "number"; };
================================================
FILE: number/to-integer.js
================================================
"use strict";
var sign = require("../math/sign")
, abs = Math.abs
, floor = Math.floor;
module.exports = function (value) {
if (isNaN(value)) return 0;
value = Number(value);
if (value === 0 || !isFinite(value)) return value;
return sign(value) * floor(abs(value));
};
================================================
FILE: number/to-pos-integer.js
================================================
"use strict";
var toInteger = require("./to-integer")
, max = Math.max;
module.exports = function (value) { return max(0, toInteger(value)); };
================================================
FILE: number/to-uint32.js
================================================
"use strict";
module.exports = function (value) {
// eslint-disable-next-line no-bitwise
return value >>> 0;
};
================================================
FILE: object/_iterate.js
================================================
// Internal method, used by iteration functions.
// Calls a function for each key-value pair found in object
// Optionally takes compareFn to iterate object in specific order
"use strict";
var callable = require("./valid-callable")
, value = require("./valid-value")
, bind = Function.prototype.bind
, call = Function.prototype.call
, keys = Object.keys
, objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
module.exports = functio
gitextract_4lrese67/ ├── .editorconfig ├── .github/ │ ├── FUNDING.yml │ └── workflows/ │ ├── integrate.yml │ ├── publish.yml │ └── validate.yml ├── .gitignore ├── .npmignore ├── CHANGELOG.md ├── CHANGES ├── LICENSE ├── README.md ├── _postinstall.js ├── array/ │ ├── #/ │ │ ├── @@iterator/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── _compare-by-length.js │ │ ├── binary-search.js │ │ ├── clear.js │ │ ├── compact.js │ │ ├── concat/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── contains.js │ │ ├── copy-within/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── diff.js │ │ ├── e-index-of.js │ │ ├── e-last-index-of.js │ │ ├── entries/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── exclusion.js │ │ ├── fill/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── filter/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── find/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── find-index/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── first-index.js │ │ ├── first.js │ │ ├── flatten.js │ │ ├── for-each-right.js │ │ ├── group.js │ │ ├── index.js │ │ ├── indexes-of.js │ │ ├── intersection.js │ │ ├── is-copy.js │ │ ├── is-empty.js │ │ ├── is-uniq.js │ │ ├── keys/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── last-index.js │ │ ├── last.js │ │ ├── map/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── remove.js │ │ ├── separate.js │ │ ├── slice/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── some-right.js │ │ ├── splice/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── uniq.js │ │ └── values/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── _is-extensible.js │ ├── _sub-array-dummy-safe.js │ ├── _sub-array-dummy.js │ ├── from/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── generate.js │ ├── index.js │ ├── is-plain-array.js │ ├── of/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── to-array.js │ └── valid-array.js ├── boolean/ │ ├── index.js │ └── is-boolean.js ├── commitlint.config.js ├── date/ │ ├── #/ │ │ ├── copy.js │ │ ├── days-in-month.js │ │ ├── floor-day.js │ │ ├── floor-month.js │ │ ├── floor-year.js │ │ ├── format.js │ │ └── index.js │ ├── ensure-time-value.js │ ├── index.js │ ├── is-date.js │ ├── is-time-value.js │ └── valid-date.js ├── error/ │ ├── #/ │ │ ├── index.js │ │ └── throw.js │ ├── custom.js │ ├── index.js │ ├── is-error.js │ └── valid-error.js ├── function/ │ ├── #/ │ │ ├── compose.js │ │ ├── copy.js │ │ ├── curry.js │ │ ├── index.js │ │ ├── lock.js │ │ ├── microtask-delay.js │ │ ├── not.js │ │ ├── partial.js │ │ ├── spread.js │ │ └── to-string-tokens.js │ ├── _define-length.js │ ├── constant.js │ ├── identity.js │ ├── index.js │ ├── invoke.js │ ├── is-arguments.js │ ├── is-function.js │ ├── noop.js │ ├── pluck.js │ └── valid-function.js ├── global.js ├── index.js ├── iterable/ │ ├── for-each.js │ ├── index.js │ ├── is.js │ ├── validate-object.js │ └── validate.js ├── json/ │ ├── index.js │ └── safe-stringify.js ├── math/ │ ├── _decimal-adjust.js │ ├── _pack-ieee754.js │ ├── _unpack-ieee754.js │ ├── acosh/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── asinh/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── atanh/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── cbrt/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── ceil-10.js │ ├── clz32/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── cosh/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── expm1/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── floor-10.js │ ├── fround/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── hypot/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── imul/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── index.js │ ├── log10/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── log1p/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── log2/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── round-10.js │ ├── sign/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── sinh/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── tanh/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ └── trunc/ │ ├── implement.js │ ├── index.js │ ├── is-implemented.js │ └── shim.js ├── number/ │ ├── #/ │ │ ├── index.js │ │ └── pad.js │ ├── epsilon/ │ │ ├── implement.js │ │ ├── index.js │ │ └── is-implemented.js │ ├── index.js │ ├── is-finite/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── is-integer/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── is-nan/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── is-natural.js │ ├── is-number.js │ ├── is-safe-integer/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── max-safe-integer/ │ │ ├── implement.js │ │ ├── index.js │ │ └── is-implemented.js │ ├── min-safe-integer/ │ │ ├── implement.js │ │ ├── index.js │ │ └── is-implemented.js │ ├── to-integer.js │ ├── to-pos-integer.js │ └── to-uint32.js ├── object/ │ ├── _iterate.js │ ├── assign/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── assign-deep.js │ ├── clear.js │ ├── compact.js │ ├── compare.js │ ├── copy-deep.js │ ├── copy.js │ ├── count.js │ ├── create.js │ ├── ensure-array.js │ ├── ensure-finite-number.js │ ├── ensure-integer.js │ ├── ensure-natural-number-value.js │ ├── ensure-natural-number.js │ ├── ensure-plain-function.js │ ├── ensure-plain-object.js │ ├── ensure-promise.js │ ├── ensure-thenable.js │ ├── entries/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── eq.js │ ├── every.js │ ├── filter.js │ ├── find-key.js │ ├── find.js │ ├── first-key.js │ ├── flatten.js │ ├── for-each.js │ ├── get-property-names.js │ ├── index.js │ ├── is-array-like.js │ ├── is-callable.js │ ├── is-copy-deep.js │ ├── is-copy.js │ ├── is-empty.js │ ├── is-finite-number.js │ ├── is-integer.js │ ├── is-natural-number-value.js │ ├── is-natural-number.js │ ├── is-number-value.js │ ├── is-object.js │ ├── is-plain-function.js │ ├── is-plain-object.js │ ├── is-promise.js │ ├── is-thenable.js │ ├── is-value.js │ ├── is.js │ ├── key-of.js │ ├── keys/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── map-keys.js │ ├── map.js │ ├── mixin-prototypes.js │ ├── mixin.js │ ├── normalize-options.js │ ├── primitive-set.js │ ├── safe-traverse.js │ ├── serialize.js │ ├── set-prototype-of/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── some.js │ ├── to-array.js │ ├── unserialize.js │ ├── valid-callable.js │ ├── valid-object.js │ ├── valid-value.js │ ├── validate-array-like-object.js │ ├── validate-array-like.js │ ├── validate-stringifiable-value.js │ └── validate-stringifiable.js ├── optional-chaining.js ├── package.json ├── promise/ │ ├── #/ │ │ ├── as-callback.js │ │ ├── finally/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ └── index.js │ ├── .eslintrc.json │ ├── index.js │ └── lazy.js ├── reg-exp/ │ ├── #/ │ │ ├── index.js │ │ ├── is-sticky.js │ │ ├── is-unicode.js │ │ ├── match/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── replace/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── search/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── split/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── sticky/ │ │ │ ├── implement.js │ │ │ └── is-implemented.js │ │ └── unicode/ │ │ ├── implement.js │ │ └── is-implemented.js │ ├── escape.js │ ├── index.js │ ├── is-reg-exp.js │ └── valid-reg-exp.js ├── safe-to-string.js ├── string/ │ ├── #/ │ │ ├── @@iterator/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── at.js │ │ ├── camel-to-hyphen.js │ │ ├── capitalize.js │ │ ├── case-insensitive-compare.js │ │ ├── code-point-at/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── contains/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── count.js │ │ ├── ends-with/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── hyphen-to-camel.js │ │ ├── indent.js │ │ ├── index.js │ │ ├── last.js │ │ ├── normalize/ │ │ │ ├── _data.js │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── pad.js │ │ ├── plain-replace-all.js │ │ ├── plain-replace.js │ │ ├── repeat/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── starts-with/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ └── uncapitalize.js │ ├── format-method.js │ ├── from-code-point/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── index.js │ ├── is-string.js │ ├── random-uniq.js │ ├── random.js │ └── raw/ │ ├── implement.js │ ├── index.js │ ├── is-implemented.js │ └── shim.js ├── test/ │ ├── .eslintrc.json │ ├── __tad.js │ ├── _postinstall.js │ ├── array/ │ │ ├── #/ │ │ │ ├── @@iterator/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── _compare-by-length.js │ │ │ ├── binary-search.js │ │ │ ├── clear.js │ │ │ ├── compact.js │ │ │ ├── concat/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── contains.js │ │ │ ├── copy-within/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── diff.js │ │ │ ├── e-index-of.js │ │ │ ├── e-last-index-of.js │ │ │ ├── entries/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── exclusion.js │ │ │ ├── fill/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── filter/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── find/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── find-index/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── first-index.js │ │ │ ├── first.js │ │ │ ├── flatten.js │ │ │ ├── for-each-right.js │ │ │ ├── group.js │ │ │ ├── indexes-of.js │ │ │ ├── intersection.js │ │ │ ├── is-copy.js │ │ │ ├── is-empty.js │ │ │ ├── is-uniq.js │ │ │ ├── keys/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── last-index.js │ │ │ ├── last.js │ │ │ ├── map/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── remove.js │ │ │ ├── separate.js │ │ │ ├── slice/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── some-right.js │ │ │ ├── splice/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── uniq.js │ │ │ └── values/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── __scopes.js │ │ ├── _is-extensible.js │ │ ├── _sub-array-dummy-safe.js │ │ ├── _sub-array-dummy.js │ │ ├── from/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── generate.js │ │ ├── is-plain-array.js │ │ ├── of/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── to-array.js │ │ └── valid-array.js │ ├── boolean/ │ │ └── is-boolean.js │ ├── date/ │ │ ├── #/ │ │ │ ├── copy.js │ │ │ ├── days-in-month.js │ │ │ ├── floor-day.js │ │ │ ├── floor-month.js │ │ │ ├── floor-year.js │ │ │ └── format.js │ │ ├── ensure-time-value.js │ │ ├── is-date.js │ │ ├── is-time-value.js │ │ └── valid-date.js │ ├── error/ │ │ ├── #/ │ │ │ └── throw.js │ │ ├── custom.js │ │ ├── is-error.js │ │ └── valid-error.js │ ├── function/ │ │ ├── #/ │ │ │ ├── compose.js │ │ │ ├── copy.js │ │ │ ├── curry.js │ │ │ ├── lock.js │ │ │ ├── microtask-delay.js │ │ │ ├── not.js │ │ │ ├── partial.js │ │ │ ├── spread.js │ │ │ └── to-string-tokens.js │ │ ├── _define-length.js │ │ ├── constant.js │ │ ├── identity.js │ │ ├── invoke.js │ │ ├── is-arguments.js │ │ ├── is-function.js │ │ ├── noop.js │ │ ├── pluck.js │ │ └── valid-function.js │ ├── global.js │ ├── iterable/ │ │ ├── for-each.js │ │ ├── is.js │ │ ├── validate-object.js │ │ └── validate.js │ ├── json/ │ │ └── safe-stringify.js │ ├── math/ │ │ ├── _decimal-adjust.js │ │ ├── _pack-ieee754.js │ │ ├── _unpack-ieee754.js │ │ ├── acosh/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── asinh/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── atanh/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── cbrt/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── ceil-10.js │ │ ├── clz32/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── cosh/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── expm1/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── floor-10.js │ │ ├── fround/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── hypot/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── imul/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── log10/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── log1p/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── log2/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── round-10.js │ │ ├── sign/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── sinh/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── tanh/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ └── trunc/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ ├── number/ │ │ ├── #/ │ │ │ └── pad.js │ │ ├── epsilon/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ └── is-implemented.js │ │ ├── is-finite/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── is-integer/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── is-nan/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── is-natural.js │ │ ├── is-number.js │ │ ├── is-safe-integer/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── max-safe-integer/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ └── is-implemented.js │ │ ├── min-safe-integer/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ └── is-implemented.js │ │ ├── to-integer.js │ │ ├── to-pos-integer.js │ │ └── to-uint32.js │ ├── object/ │ │ ├── _iterate.js │ │ ├── assign/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── assign-deep.js │ │ ├── clear.js │ │ ├── compact.js │ │ ├── compare.js │ │ ├── copy-deep.js │ │ ├── copy.js │ │ ├── count.js │ │ ├── create.js │ │ ├── ensure-array.js │ │ ├── ensure-finite-number.js │ │ ├── ensure-integer.js │ │ ├── ensure-natural-number-value.js │ │ ├── ensure-natural-number.js │ │ ├── ensure-plain-function.js │ │ ├── ensure-plain-object.js │ │ ├── ensure-promise.js │ │ ├── ensure-thenable.js │ │ ├── entries/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── eq.js │ │ ├── every.js │ │ ├── filter.js │ │ ├── find-key.js │ │ ├── find.js │ │ ├── first-key.js │ │ ├── flatten.js │ │ ├── for-each.js │ │ ├── get-property-names.js │ │ ├── is-array-like.js │ │ ├── is-callable.js │ │ ├── is-copy-deep.js │ │ ├── is-copy.js │ │ ├── is-empty.js │ │ ├── is-finite-number.js │ │ ├── is-integer.js │ │ ├── is-natural-number-value.js │ │ ├── is-natural-number.js │ │ ├── is-number-value.js │ │ ├── is-object.js │ │ ├── is-plain-function.js │ │ ├── is-plain-object.js │ │ ├── is-promise.js │ │ ├── is-thenable.js │ │ ├── is-value.js │ │ ├── is.js │ │ ├── key-of.js │ │ ├── keys/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── map-keys.js │ │ ├── map.js │ │ ├── mixin-prototypes.js │ │ ├── mixin.js │ │ ├── normalize-options.js │ │ ├── primitive-set.js │ │ ├── safe-traverse.js │ │ ├── serialize.js │ │ ├── set-prototype-of/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── some.js │ │ ├── to-array.js │ │ ├── unserialize.js │ │ ├── valid-callable.js │ │ ├── valid-object.js │ │ ├── valid-value.js │ │ ├── validate-array-like-object.js │ │ ├── validate-array-like.js │ │ ├── validate-stringifiable-value.js │ │ └── validate-stringifiable.js │ ├── optional-chaining.js │ ├── promise/ │ │ ├── #/ │ │ │ ├── as-callback.js │ │ │ └── finally/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── .eslintrc.json │ │ └── lazy.js │ ├── reg-exp/ │ │ ├── #/ │ │ │ ├── index.js │ │ │ ├── is-sticky.js │ │ │ ├── is-unicode.js │ │ │ ├── match/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── replace/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── search/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── split/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── sticky/ │ │ │ │ ├── implement.js │ │ │ │ └── is-implemented.js │ │ │ └── unicode/ │ │ │ ├── implement.js │ │ │ └── is-implemented.js │ │ ├── escape.js │ │ ├── is-reg-exp.js │ │ └── valid-reg-exp.js │ ├── safe-to-string.js │ ├── string/ │ │ ├── #/ │ │ │ ├── @@iterator/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── at.js │ │ │ ├── camel-to-hyphen.js │ │ │ ├── capitalize.js │ │ │ ├── case-insensitive-compare.js │ │ │ ├── code-point-at/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── contains/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── count.js │ │ │ ├── ends-with/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── hyphen-to-camel.js │ │ │ ├── indent.js │ │ │ ├── last.js │ │ │ ├── normalize/ │ │ │ │ ├── _data.js │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── pad.js │ │ │ ├── plain-replace-all.js │ │ │ ├── plain-replace.js │ │ │ ├── repeat/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ ├── starts-with/ │ │ │ │ ├── implement.js │ │ │ │ ├── index.js │ │ │ │ ├── is-implemented.js │ │ │ │ └── shim.js │ │ │ └── uncapitalize.js │ │ ├── format-method.js │ │ ├── from-code-point/ │ │ │ ├── implement.js │ │ │ ├── index.js │ │ │ ├── is-implemented.js │ │ │ └── shim.js │ │ ├── is-string.js │ │ ├── random-uniq.js │ │ ├── random.js │ │ └── raw/ │ │ ├── implement.js │ │ ├── index.js │ │ ├── is-implemented.js │ │ └── shim.js │ └── to-short-string-representation.js └── to-short-string-representation.js
Condensed preview — 847 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (626K chars).
[
{
"path": ".editorconfig",
"chars": 302,
"preview": "# EditorConfig is awesome: http://EditorConfig.org\n\n# top-most EditorConfig file\nroot = true\n\n[*]\ncharset = utf-8\nend_of"
},
{
"path": ".github/FUNDING.yml",
"chars": 40,
"preview": "github: medikoo\ntidelift: \"npm/es5-ext\"\n"
},
{
"path": ".github/workflows/integrate.yml",
"chars": 254,
"preview": "# main only\n\nname: Integrate\n\non:\n push:\n branches: [main]\n\nenv:\n FORCE_COLOR: 1\n\njobs:\n _:\n uses: medikoo/gith"
},
{
"path": ".github/workflows/publish.yml",
"chars": 314,
"preview": "# Version tags only\n\nname: Publish\n\non:\n push:\n tags:\n - v[0-9]+.[0-9]+.[0-9]+\n\nenv:\n FORCE_COLOR: 1\n\njobs:\n "
},
{
"path": ".github/workflows/validate.yml",
"chars": 189,
"preview": "# PR's only\n\nname: Validate\n\non:\n pull_request:\n branches: [main]\n\nenv:\n FORCE_COLOR: 1\n\njobs:\n _:\n uses: medik"
},
{
"path": ".gitignore",
"chars": 47,
"preview": "/node_modules\nnpm-debug.log\n/package-lock.json\n"
},
{
"path": ".npmignore",
"chars": 74,
"preview": "/.editorconfig\n/.github\n/.testignore\n/CHANGES\n/commitlint.config.js\n/test\n"
},
{
"path": "CHANGELOG.md",
"chars": 15000,
"preview": "# Changelog\n\nAll notable changes to this project will be documented in this file. See [standard-version](https://github."
},
{
"path": "CHANGES",
"chars": 27975,
"preview": "For recent changelog see CHANGELOG.md\n\n-----\n\nv0.10.15 -- 2017.03.20\n* Fix Object.isValue (it was actually isNotValue)"
},
{
"path": "LICENSE",
"chars": 773,
"preview": "ISC License\n\nCopyright (c) 2011-2024, Mariusz Nowak, @medikoo, medikoo.com\n\nPermission to use, copy, modify, and/or dist"
},
{
"path": "README.md",
"chars": 40334,
"preview": "[![Build status][build-image]][build-url]\n[![Tests coverage][cov-image]][cov-url]\n[![npm version][npm-image]][npm-url]\n\n"
},
{
"path": "_postinstall.js",
"chars": 1925,
"preview": "#!/usr/bin/env node\n\n// Broadcasts \"Call for peace\" message when package is installed in Russia, otherwise no-op\n\n\"use s"
},
{
"path": "array/#/@@iterator/implement.js",
"chars": 222,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Array.prototype, require(\"es6-symbol\").itera"
},
{
"path": "array/#/@@iterator/index.js",
"chars": 135,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")()\n\t? Array.prototype[require(\"es6-symbol\").iterator]\n\t: requ"
},
{
"path": "array/#/@@iterator/is-implemented.js",
"chars": 481,
"preview": "\"use strict\";\n\nvar iteratorSymbol = require(\"es6-symbol\").iterator;\n\nmodule.exports = function () {\n\tvar arr = [\"foo\", 1"
},
{
"path": "array/#/@@iterator/shim.js",
"chars": 59,
"preview": "\"use strict\";\n\nmodule.exports = require(\"../values/shim\");\n"
},
{
"path": "array/#/_compare-by-length.js",
"chars": 222,
"preview": "// Used internally to sort array of lists by length\n\n\"use strict\";\n\nvar toPosInt = require(\"../../number/to-pos-integer\""
},
{
"path": "array/#/binary-search.js",
"chars": 600,
"preview": "\"use strict\";\n\nvar toPosInt = require(\"../../number/to-pos-integer\")\n , callable = require(\"../../object/valid-callable"
},
{
"path": "array/#/clear.js",
"chars": 274,
"preview": "// Inspired by Google Closure:\n// http://closure-library.googlecode.com/svn/docs/\n// closure_goog_array_array.js.html#go"
},
{
"path": "array/#/compact.js",
"chars": 273,
"preview": "// Inspired by: http://documentcloud.github.com/underscore/#compact\n\n\"use strict\";\n\nvar isValue = require(\"../../object/"
},
{
"path": "array/#/concat/implement.js",
"chars": 200,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Array.prototype, \"concat\", {\n\t\tvalue: requir"
},
{
"path": "array/#/concat/index.js",
"chars": 108,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Array.prototype.concat : require(\"./shim\");\n"
},
{
"path": "array/#/concat/is-implemented.js",
"chars": 162,
"preview": "\"use strict\";\n\nvar SubArray = require(\"../../_sub-array-dummy-safe\");\n\nmodule.exports = function () { return new SubArra"
},
{
"path": "array/#/concat/shim.js",
"chars": 1277,
"preview": "\"use strict\";\n\nvar isPlainArray = require(\"../../is-plain-array\")\n , toPosInt = require(\"../../../numbe"
},
{
"path": "array/#/contains.js",
"chars": 179,
"preview": "\"use strict\";\n\nvar indexOf = require(\"./e-index-of\");\n\nmodule.exports = function (searchElement /*, position*/) {\n\tretur"
},
{
"path": "array/#/copy-within/implement.js",
"chars": 204,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Array.prototype, \"copyWithin\", {\n\t\tvalue: re"
},
{
"path": "array/#/copy-within/index.js",
"chars": 112,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Array.prototype.copyWithin : require(\"./shim\");\n"
},
{
"path": "array/#/copy-within/is-implemented.js",
"chars": 188,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar arr = [1, 2, 3, 4, 5];\n\tif (typeof arr.copyWithin !== \"function\") ret"
},
{
"path": "array/#/copy-within/shim.js",
"chars": 1216,
"preview": "// Taken from: https://github.com/paulmillr/es6-shim/\n\n\"use strict\";\n\nvar toInteger = require(\"../../../number/t"
},
{
"path": "array/#/diff.js",
"chars": 295,
"preview": "\"use strict\";\n\nvar value = require(\"../../object/valid-value\")\n , contains = require(\"./contains\")\n , filter = Ar"
},
{
"path": "array/#/e-index-of.js",
"chars": 934,
"preview": "\"use strict\";\n\nvar numberIsNaN = require(\"../../number/is-nan\")\n , toPosInt = require(\"../../number/to-p"
},
{
"path": "array/#/e-last-index-of.js",
"chars": 955,
"preview": "\"use strict\";\n\nvar numberIsNaN = require(\"../../number/is-nan\")\n , toPosInt = require(\"../../number/to-p"
},
{
"path": "array/#/entries/implement.js",
"chars": 201,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Array.prototype, \"entries\", {\n\t\tvalue: requi"
},
{
"path": "array/#/entries/index.js",
"chars": 109,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Array.prototype.entries : require(\"./shim\");\n"
},
{
"path": "array/#/entries/is-implemented.js",
"chars": 469,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar arr = [1, \"foo\"], iterator, result;\n\tif (typeof arr.entries !== \"func"
},
{
"path": "array/#/entries/shim.js",
"chars": 145,
"preview": "\"use strict\";\n\nvar ArrayIterator = require(\"es6-iterator/array\");\nmodule.exports = function () { return new ArrayIterato"
},
{
"path": "array/#/exclusion.js",
"chars": 780,
"preview": "\"use strict\";\n\nvar value = require(\"../../object/valid-value\")\n , aFrom = require(\"../from\")\n , toArray = requi"
},
{
"path": "array/#/fill/implement.js",
"chars": 198,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Array.prototype, \"fill\", {\n\t\tvalue: require("
},
{
"path": "array/#/fill/index.js",
"chars": 106,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Array.prototype.fill : require(\"./shim\");\n"
},
{
"path": "array/#/fill/is-implemented.js",
"chars": 186,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar arr = [1, 2, 3, 4, 5, 6];\n\tif (typeof arr.fill !== \"function\") return"
},
{
"path": "array/#/fill/shim.js",
"chars": 753,
"preview": "// Taken from: https://github.com/paulmillr/es6-shim/\n\n\"use strict\";\n\nvar toInteger = require(\"../../../number/to-integ"
},
{
"path": "array/#/filter/implement.js",
"chars": 200,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Array.prototype, \"filter\", {\n\t\tvalue: requir"
},
{
"path": "array/#/filter/index.js",
"chars": 108,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Array.prototype.filter : require(\"./shim\");\n"
},
{
"path": "array/#/filter/is-implemented.js",
"chars": 205,
"preview": "\"use strict\";\n\nvar SubArray = require(\"../../_sub-array-dummy-safe\")\n , pass = function () { return true; };\n\nmodul"
},
{
"path": "array/#/filter/shim.js",
"chars": 698,
"preview": "\"use strict\";\n\nvar isPlainArray = require(\"../../is-plain-array\")\n , callable = require(\"../../../object/valid-call"
},
{
"path": "array/#/find/implement.js",
"chars": 198,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Array.prototype, \"find\", {\n\t\tvalue: require("
},
{
"path": "array/#/find/index.js",
"chars": 106,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Array.prototype.find : require(\"./shim\");\n"
},
{
"path": "array/#/find/is-implemented.js",
"chars": 209,
"preview": "\"use strict\";\n\nvar fn = function (value) { return value > 3; };\n\nmodule.exports = function () {\n\tvar arr = [1, 2, 3, 4, "
},
{
"path": "array/#/find/shim.js",
"chars": 258,
"preview": "\"use strict\";\n\nvar findIndex = require(\"../find-index/shim\");\n\n// eslint-disable-next-line no-unused-vars\nmodule.exports"
},
{
"path": "array/#/find-index/implement.js",
"chars": 203,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Array.prototype, \"findIndex\", {\n\t\tvalue: req"
},
{
"path": "array/#/find-index/index.js",
"chars": 111,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Array.prototype.findIndex : require(\"./shim\");\n"
},
{
"path": "array/#/find-index/is-implemented.js",
"chars": 219,
"preview": "\"use strict\";\n\nvar fn = function (value) { return value > 3; };\n\nmodule.exports = function () {\n\tvar arr = [1, 2, 3, 4, "
},
{
"path": "array/#/find-index/shim.js",
"chars": 540,
"preview": "\"use strict\";\n\nvar callable = require(\"../../../object/valid-callable\")\n , ensureValue = require(\"../../../object/va"
},
{
"path": "array/#/first-index.js",
"chars": 407,
"preview": "\"use strict\";\n\nvar toPosInt = require(\"../../number/to-pos-integer\")\n , value = require(\"../../obj"
},
{
"path": "array/#/first.js",
"chars": 179,
"preview": "\"use strict\";\n\nvar firstIndex = require(\"./first-index\");\n\nmodule.exports = function () {\n\tvar i;\n\tif ((i = firstIndex.c"
},
{
"path": "array/#/flatten.js",
"chars": 963,
"preview": "// Stack grow safe implementation\n\n\"use strict\";\n\nvar ensureValue = require(\"../../object/valid-value\")\n , isArra"
},
{
"path": "array/#/for-each-right.js",
"chars": 587,
"preview": "\"use strict\";\n\nvar toPosInt = require(\"../../number/to-pos-integer\")\n , callable = require(\"../../obj"
},
{
"path": "array/#/group.js",
"chars": 614,
"preview": "// Inspired by Underscore's groupBy:\n// http://documentcloud.github.com/underscore/#groupBy\n\n\"use strict\";\n\nvar callable"
},
{
"path": "array/#/index.js",
"chars": 1321,
"preview": "\"use strict\";\n\nmodule.exports = {\n\t\"@@iterator\": require(\"./@@iterator\"),\n\t\"binarySearch\": require(\"./binary-search\"),\n\t"
},
{
"path": "array/#/indexes-of.js",
"chars": 276,
"preview": "\"use strict\";\n\nvar indexOf = require(\"./e-index-of\");\n\nmodule.exports = function (value /*, fromIndex*/) {\n\tvar result ="
},
{
"path": "array/#/intersection.js",
"chars": 586,
"preview": "\"use strict\";\n\nvar value = require(\"../../object/valid-value\")\n , contains = require(\"./contains\")\n , byLength = re"
},
{
"path": "array/#/is-copy.js",
"chars": 610,
"preview": "\"use strict\";\n\nvar toPosInt = require(\"../../number/to-pos-integer\")\n , eq = require(\"../../obj"
},
{
"path": "array/#/is-empty.js",
"chars": 201,
"preview": "\"use strict\";\n\nvar ensureArray = require(\"../../object/ensure-array\")\n , firstIndex = require(\"./first-index\");\n\nmodul"
},
{
"path": "array/#/is-uniq.js",
"chars": 261,
"preview": "\"use strict\";\n\nvar indexOf = require(\"./e-index-of\")\n , every = Array.prototype.every\n , isFirst;\n\nisFirst = functio"
},
{
"path": "array/#/keys/implement.js",
"chars": 198,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Array.prototype, \"keys\", {\n\t\tvalue: require("
},
{
"path": "array/#/keys/index.js",
"chars": 106,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Array.prototype.keys : require(\"./shim\");\n"
},
{
"path": "array/#/keys/is-implemented.js",
"chars": 401,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar arr = [1, \"foo\"], iterator, result;\n\tif (typeof arr.keys !== \"functio"
},
{
"path": "array/#/keys/shim.js",
"chars": 139,
"preview": "\"use strict\";\n\nvar ArrayIterator = require(\"es6-iterator/array\");\nmodule.exports = function () { return new ArrayIterato"
},
{
"path": "array/#/last-index.js",
"chars": 412,
"preview": "\"use strict\";\n\nvar toPosInt = require(\"../../number/to-pos-integer\")\n , value = require(\"../../obj"
},
{
"path": "array/#/last.js",
"chars": 176,
"preview": "\"use strict\";\n\nvar lastIndex = require(\"./last-index\");\n\nmodule.exports = function () {\n\tvar i;\n\tif ((i = lastIndex.call"
},
{
"path": "array/#/map/implement.js",
"chars": 197,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Array.prototype, \"map\", {\n\t\tvalue: require(\""
},
{
"path": "array/#/map/index.js",
"chars": 105,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Array.prototype.map : require(\"./shim\");\n"
},
{
"path": "array/#/map/is-implemented.js",
"chars": 215,
"preview": "\"use strict\";\n\nvar identity = require(\"../../../function/identity\")\n , SubArray = require(\"../../_sub-array-dummy-safe\""
},
{
"path": "array/#/map/shim.js",
"chars": 681,
"preview": "\"use strict\";\n\nvar isPlainArray = require(\"../../is-plain-array\")\n , callable = require(\"../../../object/valid-call"
},
{
"path": "array/#/remove.js",
"chars": 386,
"preview": "\"use strict\";\n\nvar indexOf = require(\"./e-index-of\")\n , forEach = Array.prototype.forEach\n , splice = Array.prototype"
},
{
"path": "array/#/separate.js",
"chars": 205,
"preview": "\"use strict\";\n\nvar forEach = Array.prototype.forEach;\n\nmodule.exports = function (sep) {\n\tvar result = [];\n\tforEach.call"
},
{
"path": "array/#/slice/implement.js",
"chars": 199,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Array.prototype, \"slice\", {\n\t\tvalue: require"
},
{
"path": "array/#/slice/index.js",
"chars": 107,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Array.prototype.slice : require(\"./shim\");\n"
},
{
"path": "array/#/slice/is-implemented.js",
"chars": 156,
"preview": "\"use strict\";\n\nvar SubArray = require(\"../../_sub-array-dummy-safe\");\n\nmodule.exports = function () { return new SubArra"
},
{
"path": "array/#/slice/shim.js",
"chars": 1063,
"preview": "\"use strict\";\n\nvar toInteger = require(\"../../../number/to-integer\")\n , toPosInt = require(\"../../../n"
},
{
"path": "array/#/some-right.js",
"chars": 625,
"preview": "\"use strict\";\n\nvar toPosInt = require(\"../../number/to-pos-integer\")\n , callable = require(\"../../obj"
},
{
"path": "array/#/splice/implement.js",
"chars": 200,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Array.prototype, \"splice\", {\n\t\tvalue: requir"
},
{
"path": "array/#/splice/index.js",
"chars": 108,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Array.prototype.splice : require(\"./shim\");\n"
},
{
"path": "array/#/splice/is-implemented.js",
"chars": 158,
"preview": "\"use strict\";\n\nvar SubArray = require(\"../../_sub-array-dummy-safe\");\n\nmodule.exports = function () { return new SubArra"
},
{
"path": "array/#/splice/shim.js",
"chars": 528,
"preview": "\"use strict\";\n\nvar isPlainArray = require(\"../../is-plain-array\")\n , isArray = Array.isArray\n , splice = Ar"
},
{
"path": "array/#/uniq.js",
"chars": 263,
"preview": "\"use strict\";\n\nvar indexOf = require(\"./e-index-of\")\n , filter = Array.prototype.filter\n , isFirst;\n\nisFirst = functi"
},
{
"path": "array/#/values/implement.js",
"chars": 200,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Array.prototype, \"values\", {\n\t\tvalue: requir"
},
{
"path": "array/#/values/index.js",
"chars": 108,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Array.prototype.values : require(\"./shim\");\n"
},
{
"path": "array/#/values/is-implemented.js",
"chars": 409,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar arr = [\"foo\", 1], iterator, result;\n\tif (typeof arr.values !== \"funct"
},
{
"path": "array/#/values/shim.js",
"chars": 141,
"preview": "\"use strict\";\n\nvar ArrayIterator = require(\"es6-iterator/array\");\nmodule.exports = function () { return new ArrayIterato"
},
{
"path": "array/_is-extensible.js",
"chars": 296,
"preview": "\"use strict\";\n\nmodule.exports = (function () {\n\tvar SubArray = require(\"./_sub-array-dummy\")\n\t , arr;\n\n\tif (!SubArray) "
},
{
"path": "array/_sub-array-dummy-safe.js",
"chars": 603,
"preview": "\"use strict\";\n\nvar setPrototypeOf = require(\"../object/set-prototype-of\")\n , isExtensible = require(\"./_is-extensible"
},
{
"path": "array/_sub-array-dummy.js",
"chars": 426,
"preview": "\"use strict\";\n\nvar setPrototypeOf = require(\"../object/set-prototype-of\");\n\nmodule.exports = (function () {\n\tvar SubArra"
},
{
"path": "array/from/implement.js",
"chars": 188,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Array, \"from\", {\n\t\tvalue: require(\"./shim\"),"
},
{
"path": "array/from/index.js",
"chars": 96,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Array.from : require(\"./shim\");\n"
},
{
"path": "array/from/is-implemented.js",
"chars": 243,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar from = Array.from, arr, result;\n\tif (typeof from !== \"function\") retu"
},
{
"path": "array/from/shim.js",
"chars": 3199,
"preview": "\"use strict\";\n\nvar iteratorSymbol = require(\"es6-symbol\").iterator\n , isArguments = require(\"../../function/is-argum"
},
{
"path": "array/generate.js",
"chars": 502,
"preview": "\"use strict\";\n\nvar toPosInt = require(\"../number/to-pos-integer\")\n , value = require(\"../object/valid-value\")\n , sl"
},
{
"path": "array/index.js",
"chars": 268,
"preview": "\"use strict\";\n\nmodule.exports = {\n\t\"#\": require(\"./#\"),\n\t\"from\": require(\"./from\"),\n\t\"generate\": require(\"./generate\"),\n"
},
{
"path": "array/is-plain-array.js",
"chars": 283,
"preview": "\"use strict\";\n\nvar isArray = Array.isArray, getPrototypeOf = Object.getPrototypeOf;\n\nmodule.exports = function (obj) {\n\t"
},
{
"path": "array/of/implement.js",
"chars": 186,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Array, \"of\", {\n\t\tvalue: require(\"./shim\"),\n\t"
},
{
"path": "array/of/index.js",
"chars": 94,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Array.of : require(\"./shim\");\n"
},
{
"path": "array/of/is-implemented.js",
"chars": 198,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar of = Array.of, result;\n\tif (typeof of !== \"function\") return false;\n\t"
},
{
"path": "array/of/shim.js",
"chars": 612,
"preview": "\"use strict\";\n\nvar isFunction = require(\"../../function/is-function\")\n , slice = Array.prototype.slice\n ,"
},
{
"path": "array/to-array.js",
"chars": 177,
"preview": "\"use strict\";\n\nvar from = require(\"./from\")\n , isArray = Array.isArray;\n\nmodule.exports = function (arrayLike) { ret"
},
{
"path": "array/valid-array.js",
"chars": 169,
"preview": "\"use strict\";\n\nvar isArray = Array.isArray;\n\nmodule.exports = function (value) {\n\tif (isArray(value)) return value;\n\tthr"
},
{
"path": "boolean/index.js",
"chars": 72,
"preview": "\"use strict\";\n\nmodule.exports = { isBoolean: require(\"./is-boolean\") };\n"
},
{
"path": "boolean/is-boolean.js",
"chars": 269,
"preview": "\"use strict\";\n\nvar objToString = Object.prototype.toString, id = objToString.call(true);\n\nmodule.exports = function (val"
},
{
"path": "commitlint.config.js",
"chars": 670,
"preview": "\"use strict\";\n\nmodule.exports = {\n\trules: {\n\t\t\"body-leading-blank\": [2, \"always\"],\n\t\t\"body-max-line-length\": [2, \"always"
},
{
"path": "date/#/copy.js",
"chars": 125,
"preview": "\"use strict\";\n\nvar getTime = Date.prototype.getTime;\n\nmodule.exports = function () { return new Date(getTime.call(this))"
},
{
"path": "date/#/days-in-month.js",
"chars": 259,
"preview": "\"use strict\";\n\nvar getMonth = Date.prototype.getMonth;\n\nmodule.exports = function () {\n\tswitch (getMonth.call(this)) {\n\t"
},
{
"path": "date/#/floor-day.js",
"chars": 138,
"preview": "\"use strict\";\n\nvar setHours = Date.prototype.setHours;\n\nmodule.exports = function () {\n\tsetHours.call(this, 0, 0, 0, 0);"
},
{
"path": "date/#/floor-month.js",
"chars": 136,
"preview": "\"use strict\";\n\nvar floorDay = require(\"./floor-day\");\n\nmodule.exports = function () {\n\tfloorDay.call(this).setDate(1);\n\t"
},
{
"path": "date/#/floor-year.js",
"chars": 143,
"preview": "\"use strict\";\n\nvar floorMonth = require(\"./floor-month\");\n\nmodule.exports = function () {\n\tfloorMonth.call(this).setMont"
},
{
"path": "date/#/format.js",
"chars": 755,
"preview": "/* eslint id-length: \"off\" */\n\n\"use strict\";\n\nvar pad = require(\"../../number/#/pad\")\n , date = require(\"../valid-date"
},
{
"path": "date/#/index.js",
"chars": 245,
"preview": "\"use strict\";\n\nmodule.exports = {\n\tcopy: require(\"./copy\"),\n\tdaysInMonth: require(\"./days-in-month\"),\n\tfloorDay: require"
},
{
"path": "date/ensure-time-value.js",
"chars": 325,
"preview": "\"use strict\";\n\nvar safeToString = require(\"../safe-to-string\")\n , toInteger = require(\"../number/to-integer\")\n , is"
},
{
"path": "date/index.js",
"chars": 226,
"preview": "\"use strict\";\n\nmodule.exports = {\n\t\"#\": require(\"./#\"),\n\t\"ensureTimeValue\": require(\"./ensure-time-value\"),\n\t\"isDate\": r"
},
{
"path": "date/is-date.js",
"chars": 248,
"preview": "\"use strict\";\n\nvar objToString = Object.prototype.toString, id = objToString.call(new Date());\n\nmodule.exports = functio"
},
{
"path": "date/is-time-value.js",
"chars": 208,
"preview": "\"use strict\";\n\nmodule.exports = function (value) {\n\ttry { value = Number(value); }\n\tcatch (e) { return false; }\n\tif (isN"
},
{
"path": "date/valid-date.js",
"chars": 184,
"preview": "\"use strict\";\n\nvar isDate = require(\"./is-date\");\n\nmodule.exports = function (value) {\n\tif (!isDate(value)) throw new Ty"
},
{
"path": "error/#/index.js",
"chars": 63,
"preview": "\"use strict\";\n\nmodule.exports = { throw: require(\"./throw\") };\n"
},
{
"path": "error/#/throw.js",
"chars": 108,
"preview": "\"use strict\";\n\nvar error = require(\"../valid-error\");\n\nmodule.exports = function () { throw error(this); };\n"
},
{
"path": "error/custom.js",
"chars": 590,
"preview": "\"use strict\";\n\nvar assign = require(\"../object/assign\")\n , isObject = require(\"../object/is-object\""
},
{
"path": "error/index.js",
"chars": 166,
"preview": "\"use strict\";\n\nmodule.exports = {\n\t\"#\": require(\"./#\"),\n\t\"custom\": require(\"./custom\"),\n\t\"isError\": require(\"./is-error\""
},
{
"path": "error/is-error.js",
"chars": 224,
"preview": "\"use strict\";\n\nvar objToString = Object.prototype.toString, id = objToString.call(new Error());\n\nmodule.exports = functi"
},
{
"path": "error/valid-error.js",
"chars": 185,
"preview": "\"use strict\";\n\nvar isError = require(\"./is-error\");\n\nmodule.exports = function (value) {\n\tif (!isError(value)) throw new"
},
{
"path": "function/#/compose.js",
"chars": 639,
"preview": "\"use strict\";\n\nvar isValue = require(\"../../object/is-value\")\n , callable = require(\"../../object/valid-callable\")\n ,"
},
{
"path": "function/#/copy.js",
"chars": 518,
"preview": "\"use strict\";\n\nvar mixin = require(\"../../object/mixin\")\n , validFunction = require(\"../valid-function\");\n\nmodu"
},
{
"path": "function/#/curry.js",
"chars": 801,
"preview": "\"use strict\";\n\nvar toPosInt = require(\"../../number/to-pos-integer\")\n , callable = require(\"../../object/valid-"
},
{
"path": "function/#/index.js",
"chars": 329,
"preview": "\"use strict\";\n\nmodule.exports = {\n\tcompose: require(\"./compose\"),\n\tcopy: require(\"./copy\"),\n\tcurry: require(\"./curry\"),\n"
},
{
"path": "function/#/lock.js",
"chars": 260,
"preview": "\"use strict\";\n\nvar callable = require(\"../../object/valid-callable\")\n , apply = Function.prototype.apply;\n\nmodule.ex"
},
{
"path": "function/#/microtask-delay.js",
"chars": 398,
"preview": "\"use strict\";\n\nvar ensurePlainFunction = require(\"../../object/ensure-plain-function\")\n , defineLength = require"
},
{
"path": "function/#/not.js",
"chars": 319,
"preview": "\"use strict\";\n\nvar callable = require(\"../../object/valid-callable\")\n , defineLength = require(\"../_define-length\")"
},
{
"path": "function/#/partial.js",
"chars": 437,
"preview": "\"use strict\";\n\nvar callable = require(\"../../object/valid-callable\")\n , aFrom = require(\"../../array/from\")\n"
},
{
"path": "function/#/spread.js",
"chars": 235,
"preview": "\"use strict\";\n\nvar callable = require(\"../../object/valid-callable\")\n , apply = Function.prototype.apply;\n\nmodule.ex"
},
{
"path": "function/#/to-string-tokens.js",
"chars": 1678,
"preview": "\"use strict\";\n\nvar isValue = require(\"../../object/is-value\")\n , esniff = require(\"esniff\")\n , validFunct"
},
{
"path": "function/_define-length.js",
"chars": 1305,
"preview": "\"use strict\";\n\nvar toPosInt = require(\"../number/to-pos-integer\");\n\nvar test = function (arg1, arg2) { return arg2; };\n\n"
},
{
"path": "function/constant.js",
"chars": 93,
"preview": "\"use strict\";\n\nmodule.exports = function (value) {\n\treturn function () { return value; };\n};\n"
},
{
"path": "function/identity.js",
"chars": 68,
"preview": "\"use strict\";\n\nmodule.exports = function (value) { return value; };\n"
},
{
"path": "function/index.js",
"chars": 375,
"preview": "// Export all modules.\n\n\"use strict\";\n\nmodule.exports = {\n\t\"#\": require(\"./#\"),\n\t\"constant\": require(\"./constant\"),\n\t\"id"
},
{
"path": "function/invoke.js",
"chars": 444,
"preview": "\"use strict\";\n\nvar isCallable = require(\"../object/is-callable\")\n , value = require(\"../object/valid-value\")\n , s"
},
{
"path": "function/is-arguments.js",
"chars": 204,
"preview": "\"use strict\";\n\nvar objToString = Object.prototype.toString\n , id = objToString.call((function () { return arguments; })"
},
{
"path": "function/is-function.js",
"chars": 273,
"preview": "\"use strict\";\n\nvar objToString = Object.prototype.toString\n , isFunctionStringTag = RegExp.prototype.test.bind(/^[objec"
},
{
"path": "function/noop.js",
"chars": 94,
"preview": "\"use strict\";\n\n// eslint-disable-next-line no-empty-function\nmodule.exports = function () {};\n"
},
{
"path": "function/pluck.js",
"chars": 153,
"preview": "\"use strict\";\n\nvar value = require(\"../object/valid-value\");\n\nmodule.exports = function (name) {\n\treturn function (obj) "
},
{
"path": "function/valid-function.js",
"chars": 189,
"preview": "\"use strict\";\n\nvar isFunction = require(\"./is-function\");\n\nmodule.exports = function (value) {\n\tif (!isFunction(value)) "
},
{
"path": "global.js",
"chars": 1137,
"preview": "var naiveFallback = function () {\n\tif (typeof self === \"object\" && self) return self;\n\tif (typeof window === \"object\" &&"
},
{
"path": "index.js",
"chars": 624,
"preview": "\"use strict\";\n\nmodule.exports = {\n\tglobal: require(\"./global\"),\n\toptionalChaining: require(\"./optional-chaining\"),\n\tsafe"
},
{
"path": "iterable/for-each.js",
"chars": 370,
"preview": "\"use strict\";\n\nvar forOf = require(\"es6-iterator/for-of\")\n , isIterable = require(\"es6-iterator/is-iterable\")\n , "
},
{
"path": "iterable/index.js",
"chars": 172,
"preview": "\"use strict\";\n\nmodule.exports = {\n\tforEach: require(\"./for-each\"),\n\tis: require(\"./is\"),\n\tvalidate: require(\"./validate\""
},
{
"path": "iterable/is.js",
"chars": 342,
"preview": "\"use strict\";\n\nvar iteratorSymbol = require(\"es6-symbol\").iterator\n , isValue = require(\"../object/is-value\")\n "
},
{
"path": "iterable/validate-object.js",
"chars": 256,
"preview": "\"use strict\";\n\nvar isObject = require(\"../object/is-object\")\n , is = require(\"./is\");\n\nmodule.exports = function "
},
{
"path": "iterable/validate.js",
"chars": 178,
"preview": "\"use strict\";\n\nvar is = require(\"./is\");\n\nmodule.exports = function (value) {\n\tif (is(value)) return value;\n\tthrow new T"
},
{
"path": "json/index.js",
"chars": 80,
"preview": "\"use strict\";\n\nmodule.exports = { safeStringify: require(\"./safe-stringify\") };\n"
},
{
"path": "json/safe-stringify.js",
"chars": 888,
"preview": "\"use strict\";\n\nvar compact = require(\"../array/#/compact\")\n , isObject = require(\"../object/is-object\")\n , toArray "
},
{
"path": "math/_decimal-adjust.js",
"chars": 809,
"preview": "// Credit:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round\n// #Decimal_ro"
},
{
"path": "math/_pack-ieee754.js",
"chars": 2012,
"preview": "/* eslint no-bitwise: \"off\" */\n// Credit: https://github.com/paulmillr/es6-shim/\n\n\"use strict\";\n\nvar abs = Math.abs\n , "
},
{
"path": "math/_unpack-ieee754.js",
"chars": 927,
"preview": "/* eslint no-bitwise: \"off\" */\n// Credit: https://github.com/paulmillr/es6-shim/\n\n\"use strict\";\n\nvar pow = Math.pow;\n\nmo"
},
{
"path": "math/acosh/implement.js",
"chars": 188,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Math, \"acosh\", {\n\t\tvalue: require(\"./shim\"),"
},
{
"path": "math/acosh/index.js",
"chars": 96,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Math.acosh : require(\"./shim\");\n"
},
{
"path": "math/acosh/is-implemented.js",
"chars": 163,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar acosh = Math.acosh;\n\tif (typeof acosh !== \"function\") return false;\n\t"
},
{
"path": "math/acosh/shim.js",
"chars": 289,
"preview": "\"use strict\";\n\nvar log = Math.log, sqrt = Math.sqrt;\n\nmodule.exports = function (value) {\n\tif (isNaN(value)) return NaN;"
},
{
"path": "math/asinh/implement.js",
"chars": 188,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Math, \"asinh\", {\n\t\tvalue: require(\"./shim\"),"
},
{
"path": "math/asinh/index.js",
"chars": 96,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Math.asinh : require(\"./shim\");\n"
},
{
"path": "math/asinh/is-implemented.js",
"chars": 163,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar asinh = Math.asinh;\n\tif (typeof asinh !== \"function\") return false;\n\t"
},
{
"path": "math/asinh/shim.js",
"chars": 350,
"preview": "\"use strict\";\n\nvar log = Math.log, sqrt = Math.sqrt;\n\nmodule.exports = function (value) {\n\tif (isNaN(value)) return NaN;"
},
{
"path": "math/atanh/implement.js",
"chars": 188,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Math, \"atanh\", {\n\t\tvalue: require(\"./shim\"),"
},
{
"path": "math/atanh/index.js",
"chars": 96,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Math.atanh : require(\"./shim\");\n"
},
{
"path": "math/atanh/is-implemented.js",
"chars": 181,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar atanh = Math.atanh;\n\tif (typeof atanh !== \"function\") return false;\n\t"
},
{
"path": "math/atanh/shim.js",
"chars": 337,
"preview": "\"use strict\";\n\nvar log = Math.log;\n\nmodule.exports = function (value) {\n\tif (isNaN(value)) return NaN;\n\tvalue = Number(v"
},
{
"path": "math/cbrt/implement.js",
"chars": 187,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Math, \"cbrt\", {\n\t\tvalue: require(\"./shim\"),\n"
},
{
"path": "math/cbrt/index.js",
"chars": 95,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Math.cbrt : require(\"./shim\");\n"
},
{
"path": "math/cbrt/is-implemented.js",
"chars": 159,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar cbrt = Math.cbrt;\n\tif (typeof cbrt !== \"function\") return false;\n\tret"
},
{
"path": "math/cbrt/shim.js",
"chars": 270,
"preview": "\"use strict\";\n\nvar pow = Math.pow;\n\nmodule.exports = function (value) {\n\tif (isNaN(value)) return NaN;\n\tvalue = Number(v"
},
{
"path": "math/ceil-10.js",
"chars": 70,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./_decimal-adjust\")(\"ceil\");\n"
},
{
"path": "math/clz32/implement.js",
"chars": 188,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Math, \"clz32\", {\n\t\tvalue: require(\"./shim\"),"
},
{
"path": "math/clz32/index.js",
"chars": 96,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Math.clz32 : require(\"./shim\");\n"
},
{
"path": "math/clz32/is-implemented.js",
"chars": 150,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar clz32 = Math.clz32;\n\tif (typeof clz32 !== \"function\") return false;\n\t"
},
{
"path": "math/clz32/shim.js",
"chars": 161,
"preview": "\"use strict\";\n\nmodule.exports = function (value) {\n\t// eslint-disable-next-line no-bitwise\n\tvalue >>>= 0;\n\treturn value "
},
{
"path": "math/cosh/implement.js",
"chars": 187,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Math, \"cosh\", {\n\t\tvalue: require(\"./shim\"),\n"
},
{
"path": "math/cosh/index.js",
"chars": 95,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Math.cosh : require(\"./shim\");\n"
},
{
"path": "math/cosh/is-implemented.js",
"chars": 159,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar cosh = Math.cosh;\n\tif (typeof cosh !== \"function\") return false;\n\tret"
},
{
"path": "math/cosh/shim.js",
"chars": 238,
"preview": "\"use strict\";\n\nvar exp = Math.exp;\n\nmodule.exports = function (value) {\n\tif (isNaN(value)) return NaN;\n\tvalue = Number(v"
},
{
"path": "math/expm1/implement.js",
"chars": 188,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Math, \"expm1\", {\n\t\tvalue: require(\"./shim\"),"
},
{
"path": "math/expm1/index.js",
"chars": 96,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Math.expm1 : require(\"./shim\");\n"
},
{
"path": "math/expm1/is-implemented.js",
"chars": 176,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar expm1 = Math.expm1;\n\tif (typeof expm1 !== \"function\") return false;\n\t"
},
{
"path": "math/expm1/shim.js",
"chars": 397,
"preview": "// Thanks: https://github.com/monolithed/ECMAScript-6\n\n\"use strict\";\n\nvar exp = Math.exp;\n\nmodule.exports = function (va"
},
{
"path": "math/floor-10.js",
"chars": 71,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./_decimal-adjust\")(\"floor\");\n"
},
{
"path": "math/fround/implement.js",
"chars": 189,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Math, \"fround\", {\n\t\tvalue: require(\"./shim\")"
},
{
"path": "math/fround/index.js",
"chars": 97,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Math.fround : require(\"./shim\");\n"
},
{
"path": "math/fround/is-implemented.js",
"chars": 171,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar fround = Math.fround;\n\tif (typeof fround !== \"function\") return false"
},
{
"path": "math/fround/shim.js",
"chars": 736,
"preview": "/* global Float32Array */\n\n// Credit: https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js\n\n\"use strict\";\n\nvar "
},
{
"path": "math/hypot/implement.js",
"chars": 188,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Math, \"hypot\", {\n\t\tvalue: require(\"./shim\"),"
},
{
"path": "math/hypot/index.js",
"chars": 96,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Math.hypot : require(\"./shim\");\n"
},
{
"path": "math/hypot/is-implemented.js",
"chars": 149,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar hypot = Math.hypot;\n\tif (typeof hypot !== \"function\") return false;\n\t"
},
{
"path": "math/hypot/shim.js",
"chars": 999,
"preview": "// Thanks for hints: https://github.com/paulmillr/es6-shim\n\n\"use strict\";\n\nvar some = Array.prototype.some\n , abs = Mat"
},
{
"path": "math/imul/implement.js",
"chars": 187,
"preview": "\"use strict\";\n\nif (!require(\"./is-implemented\")()) {\n\tObject.defineProperty(Math, \"imul\", {\n\t\tvalue: require(\"./shim\"),\n"
},
{
"path": "math/imul/index.js",
"chars": 95,
"preview": "\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Math.imul : require(\"./shim\");\n"
},
{
"path": "math/imul/is-implemented.js",
"chars": 147,
"preview": "\"use strict\";\n\nmodule.exports = function () {\n\tvar imul = Math.imul;\n\tif (typeof imul !== \"function\") return false;\n\tret"
}
]
// ... and 647 more files (download for full content)
About this extraction
This page contains the full source code of the medikoo/es5-ext GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 847 files (513.7 KB), approximately 211.5k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.