Migration datamodels !
This commit is contained in:
89
node_modules/ext/CHANGELOG.md
generated
vendored
Normal file
89
node_modules/ext/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
# 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.
|
||||
|
||||
## [1.7.0](https://github.com/medikoo/es5-ext/compare/v1.6.0...v1.7.0) (2022-08-31)
|
||||
|
||||
### Features
|
||||
|
||||
- `string.camelToHyphen` method ([b8ea4ab](https://github.com/medikoo/es5-ext/commit/b8ea4ab6c8b920ecdff224f9c92092e1c7f8cdfc))
|
||||
- `string.capitalize` method ([32e7360](https://github.com/medikoo/es5-ext/commit/32e736034bd27ed25d4566b22aa93aa66c7901cf))
|
||||
|
||||
## [1.6.0](https://github.com/medikoo/es5-ext/compare/v1.5.0...v1.6.0) (2021-09-24)
|
||||
|
||||
### Features
|
||||
|
||||
- `Object.clear` util ([a955da4](https://github.com/medikoo/es5-ext/commit/a955da41e65a25ad87a46234bae065f096abd1d2))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix `Object.entries` to not return non enumerable properties ([44fb872](https://github.com/medikoo/es5-ext/commit/44fb87266617378d2f47a1a5baad6280bf6298a8))
|
||||
|
||||
## [1.5.0](https://github.com/medikoo/es5-ext/compare/v1.3.0...v1.5.0) (2021-08-23)
|
||||
|
||||
### Features
|
||||
|
||||
- `Promise.limit` ([060a05d](https://github.com/medikoo/es5-ext/commit/060a05d4751cd291c6dd7641f5a73ba9338ea7ab))
|
||||
- `String.prototype.includes` ([ceebe8d](https://github.com/medikoo/es5-ext/commit/ceebe8dfd6f479d6a7e7b6cd79369291869ee2dd))
|
||||
- `charset` option for `String.random` ([2a20eeb](https://github.com/medikoo/es5-ext/commit/2a20eebc5ae784e5c1aacd2c54433fe92a9464c9))
|
||||
|
||||
## [1.4.0](https://github.com///compare/v1.3.0...v1.4.0) (2019-11-29)
|
||||
|
||||
### Features
|
||||
|
||||
- `charset` option for `String.random` ([2a20eeb](https://github.com///commit/2a20eebc5ae784e5c1aacd2c54433fe92a9464c9))
|
||||
- `String.prototype.includes` implementation ([ceebe8d](https://github.com///commit/ceebe8dfd6f479d6a7e7b6cd79369291869ee2dd))
|
||||
|
||||
## [1.3.0](https://github.com///compare/v1.2.1...v1.3.0) (2019-11-28)
|
||||
|
||||
### Features
|
||||
|
||||
- `String.random` util ([5b5860a](https://github.com///commit/5b5860ac545b05f00527e00295fdb4f97e4a4e5b))
|
||||
|
||||
### [1.2.1](https://github.com///compare/v1.2.0...v1.2.1) (2019-11-26)
|
||||
|
||||
## [1.2.0](https://github.com/medikoo/ext/compare/v1.1.2...v1.2.0) (2019-11-07)
|
||||
|
||||
### Features
|
||||
|
||||
- ceil10, floor10 and round10 for Math ([6a2bc4b](https://github.com/medikoo/ext/commit/6a2bc4b))
|
||||
|
||||
### [1.1.2](https://github.com/medikoo/ext/compare/v1.1.1...v1.1.2) (2019-10-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Improve globalThis detection ([470862d](https://github.com/medikoo/ext/commit/470862d))
|
||||
|
||||
### [1.1.1](https://github.com/medikoo/ext/compare/v1.1.0...v1.1.1) (2019-10-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Provide naive fallback for sealed Object.prototype case ([a8d528b](https://github.com/medikoo/ext/commit/a8d528b))
|
||||
- Workaournd Safari incompatibility case ([0b051e6](https://github.com/medikoo/ext/commit/0b051e6))
|
||||
|
||||
## [1.1.0](https://github.com/medikoo/ext/compare/v1.0.3...v1.1.0) (2019-10-21)
|
||||
|
||||
### Features
|
||||
|
||||
- Object.entries implementation ([cf51e45](https://github.com/medikoo/ext/commit/cf51e45))
|
||||
|
||||
### [1.0.3](https://github.com/medikoo/ext/compare/v1.0.1...v1.0.3) (2019-07-03)
|
||||
|
||||
Remove obsolete files from publication
|
||||
|
||||
### [1.0.2](https://github.com/medikoo/ext/compare/v1.0.1...v1.0.2) (2019-07-03)
|
||||
|
||||
(no changes)
|
||||
|
||||
### [1.0.1](https://github.com/medikoo/ext/compare/v1.0.0...v1.0.1) (2019-07-03)
|
||||
|
||||
Prettify
|
||||
|
||||
## 1.0.0 (2019-07-03)
|
||||
|
||||
### Features
|
||||
|
||||
- `function/identity` (adapted from `es5-ext`) ([f0102af](https://github.com/medikoo/ext/commit/f0102af))
|
||||
- `thenable/finally` (adapted from `es5-ext`) ([a8494ac](https://github.com/medikoo/ext/commit/a8494ac))
|
||||
- `global-this/is-implemented` ([3a80904](https://github.com/medikoo/ext/commit/3a80904))
|
||||
- `globalThis` (mostly adapted from `es5-ext`) ([6559bd3](https://github.com/medikoo/ext/commit/6559bd3))
|
||||
15
node_modules/ext/LICENSE
generated
vendored
Normal file
15
node_modules/ext/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
ISC License
|
||||
|
||||
Copyright (c) 2011-2022, 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.
|
||||
46
node_modules/ext/README.md
generated
vendored
Normal file
46
node_modules/ext/README.md
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
[![Build status][build-image]][build-url]
|
||||
[![npm version][npm-image]][npm-url]
|
||||
|
||||
# ext
|
||||
|
||||
_(Previously known as `es5-ext`)_
|
||||
|
||||
## JavaScript language extensions (with respect to evolving standard)
|
||||
|
||||
Non-standard or soon to be standard language utilities in a future proof, non-invasive form.
|
||||
|
||||
Doesn't enforce transpilation step. Where it's applicable utilities/extensions are safe to use in all ES3+ implementations.
|
||||
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
npm install ext
|
||||
```
|
||||
|
||||
### Utilities
|
||||
|
||||
- [`globalThis`](docs/global-this.md)
|
||||
- `Function`
|
||||
- [`identity`](docs/function/identity.md)
|
||||
- `Math`
|
||||
- [`ceil10`](docs/math/ceil-10.md)
|
||||
- [`floor10`](docs/math/floor-10.md)
|
||||
- [`round10`](docs/math/round-10.md)
|
||||
- `Object`
|
||||
- [`clear`](docs/object/clear.md)
|
||||
- [`entries`](docs/object/entries.md)
|
||||
- `Promise`
|
||||
- [`limit`](docs/promise/limit.md)
|
||||
- `String`
|
||||
- [`random`](docs/string/random.md)
|
||||
- `String.prototype`
|
||||
- [`campelToHyphen`](docs/string_/camel-to-hyphen.md)
|
||||
- [`capitalize`](docs/string_/capitalize.md)
|
||||
- [`includes`](docs/string_/includes.md)
|
||||
- `Thenable.prototype`
|
||||
- [`finally`](docs/thenable_/finally.md)
|
||||
|
||||
[build-image]: https://github.com/medikoo/es5-ext/workflows/Integrate%20[ext]/badge.svg
|
||||
[build-url]: https://github.com/medikoo/es5-ext/actions?query=workflow%3AIntegrate%20[ext]
|
||||
[npm-image]: https://img.shields.io/npm/v/ext.svg
|
||||
[npm-url]: https://www.npmjs.com/package/ext
|
||||
9
node_modules/ext/docs/function/identity.md
generated
vendored
Normal file
9
node_modules/ext/docs/function/identity.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# `Function.identity` _(ext/function/identity)_
|
||||
|
||||
Returns input argument.
|
||||
|
||||
```javascript
|
||||
const identity = require("ext/function/identity");
|
||||
|
||||
identity("foo"); // "foo"
|
||||
```
|
||||
9
node_modules/ext/docs/global-this.md
generated
vendored
Normal file
9
node_modules/ext/docs/global-this.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# `globalThis` _(ext/global-this)_
|
||||
|
||||
Returns global object. Resolve native [globalThis](https://github.com/tc39/proposal-global) if implemented, otherwise fallback to internal resolution of a global object.
|
||||
|
||||
```javascript
|
||||
const globalThis = require("ext/global-this");
|
||||
|
||||
globalThis.Array === Array; // true
|
||||
```
|
||||
10
node_modules/ext/docs/math/ceil-10.md
generated
vendored
Normal file
10
node_modules/ext/docs/math/ceil-10.md
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# `Math.ceil10` _(ext/math/ceil-10)_
|
||||
|
||||
Decimal ceil
|
||||
|
||||
```javascript
|
||||
const ceil10 = require("ext/math/ceil-10");
|
||||
|
||||
ceil10(55.51, -1); // 55.6
|
||||
ceil10(-59, 1); // -50;
|
||||
```
|
||||
10
node_modules/ext/docs/math/floor-10.md
generated
vendored
Normal file
10
node_modules/ext/docs/math/floor-10.md
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# `Math.floor10` _(ext/math/floor-10)_
|
||||
|
||||
Decimal floor
|
||||
|
||||
```javascript
|
||||
const floor10 = require("ext/math/floor-10");
|
||||
|
||||
floor10(55.59, -1); // 55.5
|
||||
floor10(59, 1); // 50
|
||||
```
|
||||
10
node_modules/ext/docs/math/round-10.md
generated
vendored
Normal file
10
node_modules/ext/docs/math/round-10.md
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# `Math.round10` _(ext/math/round-10)_
|
||||
|
||||
Decimal round
|
||||
|
||||
```javascript
|
||||
const round10 = require("ext/math/round-10");
|
||||
|
||||
round10(55.549, -1); // 55.5
|
||||
round10(1.005, -2); // 1.01
|
||||
```
|
||||
12
node_modules/ext/docs/object/clear.md
generated
vendored
Normal file
12
node_modules/ext/docs/object/clear.md
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# `Object.clear` _(ext/object/clear)_
|
||||
|
||||
Deletes all own, enumerable, non-symbol properties in the object
|
||||
|
||||
```javascript
|
||||
const clear = require("ext/object/clear");
|
||||
|
||||
const obj = { foo: "bar" };
|
||||
|
||||
clear(obj);
|
||||
Object.keys(obj); // []
|
||||
```
|
||||
11
node_modules/ext/docs/object/entries.md
generated
vendored
Normal file
11
node_modules/ext/docs/object/entries.md
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# `Object.entries` _(ext/object/entries)_
|
||||
|
||||
[Object.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries) implementation.
|
||||
|
||||
Returns native `Object.entries` if it's implemented, otherwise library implementation is returned
|
||||
|
||||
```javascript
|
||||
const entries = require("ext/object/entries");
|
||||
|
||||
entries({ foo: "bar" }); // [["foo", "bar"]]
|
||||
```
|
||||
13
node_modules/ext/docs/promise/limit.md
generated
vendored
Normal file
13
node_modules/ext/docs/promise/limit.md
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# `Promise.limit` _(ext/promise/limit)_
|
||||
|
||||
Helps to limit concurrency of asynchronous operations.
|
||||
|
||||
```javascript
|
||||
const limit = require("ext/promise/limit").bind(Promise);
|
||||
|
||||
const limittedAsyncFunction = limit(2, asyncFunction);
|
||||
|
||||
imittedAsyncFunction(); // Async operation started
|
||||
imittedAsyncFunction(); // Async operation started
|
||||
imittedAsyncFunction(); // On hold until one of previously started finalizes
|
||||
```
|
||||
31
node_modules/ext/docs/string/random.md
generated
vendored
Normal file
31
node_modules/ext/docs/string/random.md
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# `String.random(options = { ... })` _(ext/string/random)_
|
||||
|
||||
Returns generated random string, contained only of ascii cars `a-z` and `0-1`.
|
||||
By default returns string of length `10`.
|
||||
|
||||
```javascript
|
||||
const random = require("ext/string/random");
|
||||
|
||||
random(); // "upcfns0i4t"
|
||||
random({ length: 3 }); // "5tw"
|
||||
```
|
||||
|
||||
## Supported options:
|
||||
|
||||
### `isUnique: false`
|
||||
|
||||
Ensures generated string is unique among ones already returned.
|
||||
|
||||
_Note: When not applying this setting, accidental generation of same string is still highly unlikely. Provided option is just to provide a mean to eliminate possibility of an edge case of duplicate string being returned_
|
||||
|
||||
### `length: 10`
|
||||
|
||||
Desired length of result string
|
||||
|
||||
### `charset: null`
|
||||
|
||||
Fixed list of possible characters
|
||||
|
||||
```javascript
|
||||
random({ charset: "abc" }); // "bacbccbbac"
|
||||
```
|
||||
9
node_modules/ext/docs/string_/camel-to-hyphen.md
generated
vendored
Normal file
9
node_modules/ext/docs/string_/camel-to-hyphen.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# `string.camelToHyphen()` _(ext/string\_/camel-to-hyphen)_
|
||||
|
||||
Convert camelCase string to hyphen separated, e.g. `oneTwoThree` into `one-to-three`. Useful when converting names from js property convention into filename convention.
|
||||
|
||||
```javascript
|
||||
const camelToHyphen = require("ext/string_/camelToHyphen");
|
||||
|
||||
camelToHyphen.call("razDwaTrzy"); // raz-dwa-trzy
|
||||
```
|
||||
9
node_modules/ext/docs/string_/capitalize.md
generated
vendored
Normal file
9
node_modules/ext/docs/string_/capitalize.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# `string.capitalize()` _(ext/string\_/capitalize)_
|
||||
|
||||
Capitalize input string, e.g. convert `this is a test` into `This is a test`.
|
||||
|
||||
```javascript
|
||||
const capitalize = require("ext/string_/capitalize");
|
||||
|
||||
capitalize.call("this is a test"); // This is a test
|
||||
```
|
||||
10
node_modules/ext/docs/string_/includes.md
generated
vendored
Normal file
10
node_modules/ext/docs/string_/includes.md
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# `string.includes(position = 0)` _(ext/string\_/includes)_
|
||||
|
||||
`includes` method for strings. Resolve native [includes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) if implemented, otherwise fallback to shim implementation.
|
||||
|
||||
```javascript
|
||||
const includes = require("ext/string_/includes");
|
||||
|
||||
includes.call("razdwa", "raz"); // true
|
||||
includes.call("razdwa", "trzy"); // false
|
||||
```
|
||||
9
node_modules/ext/docs/thenable_/finally.md
generated
vendored
Normal file
9
node_modules/ext/docs/thenable_/finally.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# `thenable.finally` _(ext/thenable\_/finally)_
|
||||
|
||||
`finally` method for any _thenable_ input
|
||||
|
||||
```javascript
|
||||
const finally = require("ext/thenable_/finally");
|
||||
|
||||
finally.call(thenable, () => console.log("Thenable resolved"));
|
||||
```
|
||||
3
node_modules/ext/function/identity.js
generated
vendored
Normal file
3
node_modules/ext/function/identity.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function (value) { return value; };
|
||||
31
node_modules/ext/global-this/implementation.js
generated
vendored
Normal file
31
node_modules/ext/global-this/implementation.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
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)
|
||||
|
||||
// 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 Object.prototype being sealed (via preventExtensions, seal or freeze)
|
||||
return naiveFallback();
|
||||
}
|
||||
try {
|
||||
// Safari case (window.__global__ is resolved with global context, but __global__ does not)
|
||||
if (!__global__) return naiveFallback();
|
||||
return __global__;
|
||||
} finally {
|
||||
delete Object.prototype.__global__;
|
||||
}
|
||||
})();
|
||||
3
node_modules/ext/global-this/index.js
generated
vendored
Normal file
3
node_modules/ext/global-this/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")() ? globalThis : require("./implementation");
|
||||
7
node_modules/ext/global-this/is-implemented.js
generated
vendored
Normal file
7
node_modules/ext/global-this/is-implemented.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function () {
|
||||
if (typeof globalThis !== "object") return false;
|
||||
if (!globalThis) return false;
|
||||
return globalThis.Array === Array;
|
||||
};
|
||||
29
node_modules/ext/lib/private/decimal-adjust.js
generated
vendored
Normal file
29
node_modules/ext/lib/private/decimal-adjust.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
// Credit:
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round
|
||||
// #Decimal_rounding
|
||||
|
||||
"use strict";
|
||||
|
||||
var isValue = require("type/object/is")
|
||||
, ensureInteger = require("type/integer/ensure");
|
||||
|
||||
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));
|
||||
};
|
||||
};
|
||||
56
node_modules/ext/lib/private/define-function-length.js
generated
vendored
Normal file
56
node_modules/ext/lib/private/define-function-length.js
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
"use strict";
|
||||
|
||||
var test = function (arg1, arg2) { return arg2; };
|
||||
|
||||
try {
|
||||
Object.defineProperty(test, "length", {
|
||||
configurable: true,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
value: 1
|
||||
});
|
||||
}
|
||||
catch (ignore) {}
|
||||
|
||||
if (test.length === 1) {
|
||||
// ES2015+
|
||||
var desc = { configurable: true, writable: false, enumerable: false };
|
||||
module.exports = function (length, fn) {
|
||||
if (fn.length === length) return fn;
|
||||
desc.value = length;
|
||||
return Object.defineProperty(fn, "length", desc);
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
module.exports = function (length, fn) {
|
||||
if (fn.length === length) return fn;
|
||||
switch (length) {
|
||||
case 0:
|
||||
return function () { return fn.apply(this, arguments); };
|
||||
case 1:
|
||||
return function (ignored1) { return fn.apply(this, arguments); };
|
||||
case 2:
|
||||
return function (ignored1, ignored2) { return fn.apply(this, arguments); };
|
||||
case 3:
|
||||
return function (ignored1, ignored2, ignored3) { return fn.apply(this, arguments); };
|
||||
case 4:
|
||||
return function (ignored1, ignored2, ignored3, ignored4) {
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
case 5:
|
||||
return function (ignored1, ignored2, ignored3, ignored4, ignored5) {
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
case 6:
|
||||
return function (ignored1, ignored2, ignored3, ignored4, ignored5, ignored6) {
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
case 7:
|
||||
return function (ignored1, ignored2, ignored3, ignored4, ignored5, ignored6, ignored7) {
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
default:
|
||||
throw new Error("Usupported function length");
|
||||
}
|
||||
};
|
||||
3
node_modules/ext/math/ceil-10.js
generated
vendored
Normal file
3
node_modules/ext/math/ceil-10.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = require("../lib/private/decimal-adjust")("ceil");
|
||||
3
node_modules/ext/math/floor-10.js
generated
vendored
Normal file
3
node_modules/ext/math/floor-10.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = require("../lib/private/decimal-adjust")("floor");
|
||||
3
node_modules/ext/math/round-10.js
generated
vendored
Normal file
3
node_modules/ext/math/round-10.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = require("../lib/private/decimal-adjust")("round");
|
||||
15
node_modules/ext/object/clear.js
generated
vendored
Normal file
15
node_modules/ext/object/clear.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
var ensureObject = require("type/object/ensure")
|
||||
, ensure = require("type/ensure");
|
||||
|
||||
var objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
|
||||
module.exports = function (object) {
|
||||
ensure(["object", object, ensureObject]);
|
||||
for (var key in object) {
|
||||
if (!objPropertyIsEnumerable.call(object, key)) continue;
|
||||
delete object[key];
|
||||
}
|
||||
return object;
|
||||
};
|
||||
10
node_modules/ext/object/entries/implement.js
generated
vendored
Normal file
10
node_modules/ext/object/entries/implement.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
if (!require("./is-implemented")()) {
|
||||
Object.defineProperty(Object, "entries", {
|
||||
value: require("./implementation"),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
15
node_modules/ext/object/entries/implementation.js
generated
vendored
Normal file
15
node_modules/ext/object/entries/implementation.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
var ensureValue = require("type/value/ensure");
|
||||
|
||||
var objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
|
||||
module.exports = function (object) {
|
||||
object = Object(ensureValue(object));
|
||||
var result = [];
|
||||
for (var key in object) {
|
||||
if (!objPropertyIsEnumerable.call(object, key)) continue;
|
||||
result.push([key, object[key]]);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
3
node_modules/ext/object/entries/index.js
generated
vendored
Normal file
3
node_modules/ext/object/entries/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")() ? Object.entries : require("./implementation");
|
||||
6
node_modules/ext/object/entries/is-implemented.js
generated
vendored
Normal file
6
node_modules/ext/object/entries/is-implemented.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function () {
|
||||
try { return Object.entries({ foo: 12 })[0][0] === "foo"; }
|
||||
catch (e) { return false; }
|
||||
};
|
||||
152
node_modules/ext/package.json
generated
vendored
Normal file
152
node_modules/ext/package.json
generated
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
{
|
||||
"name": "ext",
|
||||
"version": "1.7.0",
|
||||
"description": "JavaScript utilities with respect to emerging standard",
|
||||
"author": "Mariusz Nowak <medyk@medikoo.com> (http://www.medikoo.com/)",
|
||||
"keywords": [
|
||||
"ecmascript",
|
||||
"es",
|
||||
"es6",
|
||||
"extensions",
|
||||
"ext",
|
||||
"addons",
|
||||
"lodash",
|
||||
"extras",
|
||||
"harmony",
|
||||
"javascript",
|
||||
"polyfill",
|
||||
"shim",
|
||||
"util",
|
||||
"utils",
|
||||
"utilities"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/medikoo/es5-ext#ext"
|
||||
},
|
||||
"dependencies": {
|
||||
"type": "^2.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^4.3.6",
|
||||
"eslint": "^8.23.0",
|
||||
"eslint-config-medikoo": "^4.1.2",
|
||||
"git-list-updated": "^1.2.1",
|
||||
"github-release-from-cc-changelog": "^2.3.0",
|
||||
"husky": "^4.3.8",
|
||||
"lint-staged": "^13.0.3",
|
||||
"mocha": "^6.2.3",
|
||||
"nyc": "^15.1.0",
|
||||
"prettier-elastic": "^2.2.1",
|
||||
"sinon": "^8.1.1",
|
||||
"timers-ext": "^0.1.7"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"eslint"
|
||||
],
|
||||
"*.{css,html,js,json,md,yaml,yml}": [
|
||||
"prettier -c"
|
||||
]
|
||||
},
|
||||
"eslintIgnore": [
|
||||
"_es5-ext"
|
||||
],
|
||||
"eslintConfig": {
|
||||
"extends": "medikoo/es3",
|
||||
"root": true,
|
||||
"overrides": [
|
||||
{
|
||||
"files": "global-this/implementation.js",
|
||||
"globals": {
|
||||
"__global__": true,
|
||||
"self": true,
|
||||
"window": true
|
||||
},
|
||||
"rules": {
|
||||
"no-extend-native": "off",
|
||||
"strict": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"global-this/is-implemented.js",
|
||||
"global-this/index.js"
|
||||
],
|
||||
"globals": {
|
||||
"globalThis": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": "string_/camel-to-hyphen.js",
|
||||
"rules": {
|
||||
"id-length": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": "test/**/*.js",
|
||||
"env": {
|
||||
"mocha": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"test/promise/limit.js",
|
||||
"test/thenable_/finally.js"
|
||||
],
|
||||
"globals": {
|
||||
"Promise": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"prettier": {
|
||||
"printWidth": 100,
|
||||
"tabWidth": 4,
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"*.md",
|
||||
"*.yml"
|
||||
],
|
||||
"options": {
|
||||
"tabWidth": 2
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"mocha": {
|
||||
"recursive": true
|
||||
},
|
||||
"nyc": {
|
||||
"all": true,
|
||||
"exclude": [
|
||||
".github",
|
||||
"_es5-ext",
|
||||
"coverage/**",
|
||||
"test/**",
|
||||
"*.config.js"
|
||||
],
|
||||
"reporter": [
|
||||
"lcov",
|
||||
"html",
|
||||
"text-summary"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "nyc npm test",
|
||||
"lint": "eslint .",
|
||||
"lint:updated": "pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'",
|
||||
"prettier-check": "prettier -c --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
|
||||
"prettier-check:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c",
|
||||
"prettify": "prettier --write --ignore-path .gitignore '**/*.{css,html,js,json,md,yaml,yml}'",
|
||||
"prettify:updated": "pipe-git-updated ---base=main -ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier --write",
|
||||
"test": "mocha"
|
||||
},
|
||||
"license": "ISC"
|
||||
}
|
||||
62
node_modules/ext/promise/limit.js
generated
vendored
Normal file
62
node_modules/ext/promise/limit.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
|
||||
var ensureNaturalNumber = require("type/natural-number/ensure")
|
||||
, ensurePlainFunction = require("type/plain-function/ensure")
|
||||
, ensure = require("type/ensure")
|
||||
, defineFunctionLength = require("../lib/private/define-function-length");
|
||||
|
||||
module.exports = function (limit, callback) {
|
||||
limit = ensure(
|
||||
["limit", limit, ensureNaturalNumber, { min: 1 }],
|
||||
["callback", callback, ensurePlainFunction]
|
||||
)[0];
|
||||
|
||||
var Promise = this, ongoingCount = 0, pending = [];
|
||||
var onSuccess, onFailure;
|
||||
|
||||
var release = function () {
|
||||
--ongoingCount;
|
||||
if (ongoingCount >= limit) return;
|
||||
var next = pending.shift();
|
||||
if (!next) return;
|
||||
++ongoingCount;
|
||||
try {
|
||||
next.resolve(
|
||||
Promise.resolve(callback.apply(next.context, next.arguments)).then(
|
||||
onSuccess, onFailure
|
||||
)
|
||||
);
|
||||
} catch (exception) {
|
||||
release();
|
||||
next.reject(exception);
|
||||
}
|
||||
};
|
||||
|
||||
onSuccess = function (value) {
|
||||
release();
|
||||
return value;
|
||||
};
|
||||
|
||||
onFailure = function (exception) {
|
||||
release();
|
||||
throw exception;
|
||||
};
|
||||
|
||||
return defineFunctionLength(callback.length, function () {
|
||||
if (ongoingCount >= limit) {
|
||||
var context = this, args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
pending.push({
|
||||
context: context,
|
||||
arguments: args,
|
||||
resolve: resolve,
|
||||
reject: reject
|
||||
});
|
||||
});
|
||||
}
|
||||
++ongoingCount;
|
||||
try {
|
||||
return Promise.resolve(callback.apply(this, arguments)).then(onSuccess, onFailure);
|
||||
} catch (exception) { return onFailure(exception); }
|
||||
});
|
||||
};
|
||||
50
node_modules/ext/string/random.js
generated
vendored
Normal file
50
node_modules/ext/string/random.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
|
||||
var isObject = require("type/object/is")
|
||||
, ensureNaturalNumber = require("type/natural-number/ensure")
|
||||
, ensureString = require("type/string/ensure");
|
||||
|
||||
var generated = Object.create(null), random = Math.random, uniqTryLimit = 100;
|
||||
|
||||
var getChunk = function () { return random().toString(36).slice(2); };
|
||||
|
||||
var getString = function (length, charset) {
|
||||
var str;
|
||||
if (charset) {
|
||||
var charsetLength = charset.length;
|
||||
str = "";
|
||||
for (var i = 0; i < length; ++i) {
|
||||
str += charset.charAt(Math.floor(Math.random() * charsetLength));
|
||||
}
|
||||
return str;
|
||||
}
|
||||
str = getChunk();
|
||||
if (length === null) return str;
|
||||
while (str.length < length) str += getChunk();
|
||||
return str.slice(0, length);
|
||||
};
|
||||
|
||||
module.exports = function (/* options */) {
|
||||
var options = arguments[0];
|
||||
if (!isObject(options)) options = {};
|
||||
var length = ensureNaturalNumber(options.length, { "default": 10 })
|
||||
, isUnique = options.isUnique
|
||||
, charset = ensureString(options.charset, { isOptional: true });
|
||||
|
||||
var str = getString(length, charset);
|
||||
if (isUnique) {
|
||||
var count = 0;
|
||||
while (generated[str]) {
|
||||
if (++count === uniqTryLimit) {
|
||||
throw new Error(
|
||||
"Cannot generate random string.\n" +
|
||||
"String.random is not designed to effectively generate many short and " +
|
||||
"unique random strings"
|
||||
);
|
||||
}
|
||||
str = getString(length);
|
||||
}
|
||||
generated[str] = true;
|
||||
}
|
||||
return str;
|
||||
};
|
||||
49
node_modules/ext/string_/camel-to-hyphen.js
generated
vendored
Normal file
49
node_modules/ext/string_/camel-to-hyphen.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
|
||||
var ensureString = require("type/string/ensure")
|
||||
, objHasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
var capitalLetters = {
|
||||
A: true,
|
||||
B: true,
|
||||
C: true,
|
||||
D: true,
|
||||
E: true,
|
||||
F: true,
|
||||
G: true,
|
||||
H: true,
|
||||
I: true,
|
||||
J: true,
|
||||
K: true,
|
||||
L: true,
|
||||
M: true,
|
||||
N: true,
|
||||
O: true,
|
||||
P: true,
|
||||
Q: true,
|
||||
R: true,
|
||||
S: true,
|
||||
T: true,
|
||||
U: true,
|
||||
V: true,
|
||||
W: true,
|
||||
X: true,
|
||||
Y: true,
|
||||
Z: true
|
||||
};
|
||||
|
||||
module.exports = function () {
|
||||
var input = ensureString(this);
|
||||
if (!input) return input;
|
||||
var outputLetters = [];
|
||||
for (var index = 0, letter; (letter = input[index]); ++index) {
|
||||
if (objHasOwnProperty.call(capitalLetters, letter)) {
|
||||
if (index) outputLetters.push("-");
|
||||
outputLetters.push(letter.toLowerCase());
|
||||
} else {
|
||||
outputLetters.push(letter);
|
||||
}
|
||||
}
|
||||
|
||||
return outputLetters.join("");
|
||||
};
|
||||
9
node_modules/ext/string_/capitalize.js
generated
vendored
Normal file
9
node_modules/ext/string_/capitalize.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
var ensureString = require("type/string/ensure");
|
||||
|
||||
module.exports = function () {
|
||||
var input = ensureString(this);
|
||||
if (!input) return input;
|
||||
return input.charAt(0).toUpperCase() + input.slice(1);
|
||||
};
|
||||
7
node_modules/ext/string_/includes/implementation.js
generated
vendored
Normal file
7
node_modules/ext/string_/includes/implementation.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
var indexOf = String.prototype.indexOf;
|
||||
|
||||
module.exports = function (searchString/*, position*/) {
|
||||
return indexOf.call(this, searchString, arguments[1]) > -1;
|
||||
};
|
||||
5
node_modules/ext/string_/includes/index.js
generated
vendored
Normal file
5
node_modules/ext/string_/includes/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")()
|
||||
? String.prototype.includes
|
||||
: require("./implementation");
|
||||
8
node_modules/ext/string_/includes/is-implemented.js
generated
vendored
Normal file
8
node_modules/ext/string_/includes/is-implemented.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
var str = "razdwatrzy";
|
||||
|
||||
module.exports = function () {
|
||||
if (typeof str.includes !== "function") return false;
|
||||
return str.includes("dwa") === true && str.includes("foo") === false;
|
||||
};
|
||||
24
node_modules/ext/thenable_/finally.js
generated
vendored
Normal file
24
node_modules/ext/thenable_/finally.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
var ensurePlainFunction = require("type/plain-function/ensure")
|
||||
, isThenable = require("type/thenable/is")
|
||||
, ensureThenable = require("type/thenable/ensure");
|
||||
|
||||
var resolveCallback = function (callback, next) {
|
||||
var callbackResult = callback();
|
||||
if (!isThenable(callbackResult)) return next();
|
||||
return callbackResult.then(next);
|
||||
};
|
||||
|
||||
module.exports = function (callback) {
|
||||
ensureThenable(this);
|
||||
ensurePlainFunction(callback);
|
||||
return this.then(
|
||||
function (result) {
|
||||
return resolveCallback(callback, function () { return result; });
|
||||
},
|
||||
function (error) {
|
||||
return resolveCallback(callback, function () { throw error; });
|
||||
}
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user