new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
export default function toColorValue(maybeFunction) {
|
||||
return typeof maybeFunction === 'function' ? maybeFunction({}) : maybeFunction
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/internal/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,YAMpB,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;;;OAQG;IACH,gBAAgB,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IAE9C;;;;;;;;;OASG;IACH,qBAAqB,EAAE,CAAC,CAAC,YAAY,EAAE,sBAAsB,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IAEjH;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,sBAAsB,CAAC;IAEjC;;;;;;;;;;;OAWG;IACH,qCAAqC,EAAE,OAAO,CAAC;IAE/C;;;;;;;;;;;;;OAaG;IACH,wBAAwB,EAAE,OAAO,CAAC;CACnC"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"timeInterval.js","sourceRoot":"","sources":["../../../../src/internal/operators/timeInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAyChE,MAAM,UAAU,YAAY,CAAI,SAAyC;IAAzC,0BAAA,EAAA,0BAAyC;IACvE,OAAO,OAAO,CAAC,UAAC,MAAM,EAAE,UAAU;QAChC,IAAI,IAAI,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC;QAC3B,MAAM,CAAC,SAAS,CACd,wBAAwB,CAAC,UAAU,EAAE,UAAC,KAAK;YACzC,IAAM,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC;YAC5B,IAAM,QAAQ,GAAG,GAAG,GAAG,IAAI,CAAC;YAC5B,IAAI,GAAG,GAAG,CAAC;YACX,UAAU,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;QACrD,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAKD;IAIE,sBAAmB,KAAQ,EAAS,QAAgB;QAAjC,UAAK,GAAL,KAAK,CAAG;QAAS,aAAQ,GAAR,QAAQ,CAAQ;IAAG,CAAC;IAC1D,mBAAC;AAAD,CAAC,AALD,IAKC"}
|
||||
@@ -0,0 +1,36 @@
|
||||
var baseIsArguments = require('./_baseIsArguments'),
|
||||
isObjectLike = require('./isObjectLike');
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/** Built-in value references. */
|
||||
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
||||
|
||||
/**
|
||||
* Checks if `value` is likely an `arguments` object.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 0.1.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
||||
* else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isArguments(function() { return arguments; }());
|
||||
* // => true
|
||||
*
|
||||
* _.isArguments([1, 2, 3]);
|
||||
* // => false
|
||||
*/
|
||||
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
||||
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
|
||||
!propertyIsEnumerable.call(value, 'callee');
|
||||
};
|
||||
|
||||
module.exports = isArguments;
|
||||
@@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
|
||||
var forEach = require('es5-ext/object/for-each')
|
||||
, validValue = require('es5-ext/object/valid-object')
|
||||
|
||||
, push = Array.prototype.apply, defineProperty = Object.defineProperty
|
||||
, create = Object.create, hasOwnProperty = Object.prototype.hasOwnProperty
|
||||
, d = { configurable: true, enumerable: false, writable: true };
|
||||
|
||||
module.exports = function (e1, e2) {
|
||||
var data;
|
||||
(validValue(e1) && validValue(e2));
|
||||
if (!hasOwnProperty.call(e1, '__ee__')) {
|
||||
if (!hasOwnProperty.call(e2, '__ee__')) {
|
||||
d.value = create(null);
|
||||
defineProperty(e1, '__ee__', d);
|
||||
defineProperty(e2, '__ee__', d);
|
||||
d.value = null;
|
||||
return;
|
||||
}
|
||||
d.value = e2.__ee__;
|
||||
defineProperty(e1, '__ee__', d);
|
||||
d.value = null;
|
||||
return;
|
||||
}
|
||||
data = d.value = e1.__ee__;
|
||||
if (!hasOwnProperty.call(e2, '__ee__')) {
|
||||
defineProperty(e2, '__ee__', d);
|
||||
d.value = null;
|
||||
return;
|
||||
}
|
||||
if (data === e2.__ee__) return;
|
||||
forEach(e2.__ee__, function (listener, name) {
|
||||
if (!data[name]) {
|
||||
data[name] = listener;
|
||||
return;
|
||||
}
|
||||
if (typeof data[name] === 'object') {
|
||||
if (typeof listener === 'object') push.apply(data[name], listener);
|
||||
else data[name].push(listener);
|
||||
} else if (typeof listener === 'object') {
|
||||
listener.unshift(data[name]);
|
||||
data[name] = listener;
|
||||
} else {
|
||||
data[name] = [data[name], listener];
|
||||
}
|
||||
});
|
||||
defineProperty(e2, '__ee__', d);
|
||||
d.value = null;
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Subscriber } from './Subscriber';
|
||||
import { TeardownLogic } from './types';
|
||||
|
||||
/***
|
||||
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
|
||||
*/
|
||||
export interface Operator<T, R> {
|
||||
call(subscriber: Subscriber<R>, source: any): TeardownLogic;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
import Renderer from '../Renderer';
|
||||
import Block from '../Block';
|
||||
import Wrapper from './shared/Wrapper';
|
||||
import EachBlock from '../../nodes/EachBlock';
|
||||
import FragmentWrapper from './Fragment';
|
||||
import ElseBlock from '../../nodes/ElseBlock';
|
||||
import { Identifier, Node } from 'estree';
|
||||
export declare class ElseBlockWrapper extends Wrapper {
|
||||
node: ElseBlock;
|
||||
block: Block;
|
||||
fragment: FragmentWrapper;
|
||||
is_dynamic: boolean;
|
||||
var: any;
|
||||
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: ElseBlock, strip_whitespace: boolean, next_sibling: Wrapper);
|
||||
}
|
||||
export default class EachBlockWrapper extends Wrapper {
|
||||
block: Block;
|
||||
node: EachBlock;
|
||||
fragment: FragmentWrapper;
|
||||
else?: ElseBlockWrapper;
|
||||
vars: {
|
||||
create_each_block: Identifier;
|
||||
each_block_value: Identifier;
|
||||
get_each_context: Identifier;
|
||||
iterations: Identifier;
|
||||
fixed_length: number;
|
||||
data_length: Node | number;
|
||||
view_length: Node | number;
|
||||
};
|
||||
context_props: Array<Node | Node[]>;
|
||||
index_name: Identifier;
|
||||
updates: Array<Node | Node[]>;
|
||||
dependencies: Set<string>;
|
||||
var: Identifier;
|
||||
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: EachBlock, strip_whitespace: boolean, next_sibling: Wrapper);
|
||||
render(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
|
||||
render_keyed({ block, parent_node, parent_nodes, snippet, initial_anchor_node, initial_mount_node, update_anchor_node, update_mount_node }: {
|
||||
block: Block;
|
||||
parent_node: Identifier;
|
||||
parent_nodes: Identifier;
|
||||
snippet: Node;
|
||||
initial_anchor_node: Identifier;
|
||||
initial_mount_node: Identifier;
|
||||
update_anchor_node: Identifier;
|
||||
update_mount_node: Identifier;
|
||||
}): void;
|
||||
render_unkeyed({ block, parent_nodes, snippet, initial_anchor_node, initial_mount_node, update_anchor_node, update_mount_node }: {
|
||||
block: Block;
|
||||
parent_nodes: Identifier;
|
||||
snippet: Node;
|
||||
initial_anchor_node: Identifier;
|
||||
initial_mount_node: Identifier;
|
||||
update_anchor_node: Identifier;
|
||||
update_mount_node: Identifier;
|
||||
}): void;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
ISC License
|
||||
|
||||
Copyright (c) 2019, 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.
|
||||
@@ -0,0 +1,69 @@
|
||||
# plugin-request-log.js
|
||||
|
||||
> Log all requests and request errors
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/plugin-request-log)
|
||||
[](https://github.com/octokit/plugin-request-log.js/actions?workflow=Test)
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
|
||||
Load `@octokit/plugin-request-log` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.skypack.dev](https://cdn.skypack.dev)
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { Octokit } from "https://cdn.skypack.dev/@octokit/core";
|
||||
import { requestLog } from "https://cdn.skypack.dev/@octokit/plugin-request-log";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with `npm install @octokit/core @octokit/plugin-request-log`. Optionally replace `@octokit/core` with a core-compatible module
|
||||
|
||||
```js
|
||||
const { Octokit } = require("@octokit/core");
|
||||
const { requestLog } = require("@octokit/plugin-request-log");
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
```js
|
||||
const MyOctokit = Octokit.plugin(requestLog);
|
||||
const octokit = new MyOctokit({ auth: "secret123" });
|
||||
|
||||
octokit.request("GET /");
|
||||
// logs "GET / - 200 in 123ms
|
||||
|
||||
octokit.request("GET /oops");
|
||||
// logs "GET / - 404 in 123ms
|
||||
```
|
||||
|
||||
In order to log all request options, the `log.debug` option needs to be set. We recommend the [console-log-level](https://github.com/watson/console-log-level) package for a configurable log level
|
||||
|
||||
```js
|
||||
const octokit = new MyOctokit({
|
||||
log: require("console-log-level")({
|
||||
auth: "secret123",
|
||||
level: "info",
|
||||
}),
|
||||
});
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = { safeStringify: require("./safe-stringify") };
|
||||
@@ -0,0 +1,45 @@
|
||||
var arrayMap = require('./_arrayMap'),
|
||||
baseIntersection = require('./_baseIntersection'),
|
||||
baseIteratee = require('./_baseIteratee'),
|
||||
baseRest = require('./_baseRest'),
|
||||
castArrayLikeObject = require('./_castArrayLikeObject'),
|
||||
last = require('./last');
|
||||
|
||||
/**
|
||||
* This method is like `_.intersection` except that it accepts `iteratee`
|
||||
* which is invoked for each element of each `arrays` to generate the criterion
|
||||
* by which they're compared. The order and references of result values are
|
||||
* determined by the first array. The iteratee is invoked with one argument:
|
||||
* (value).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
|
||||
* @returns {Array} Returns the new array of intersecting values.
|
||||
* @example
|
||||
*
|
||||
* _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
|
||||
* // => [2.1]
|
||||
*
|
||||
* // The `_.property` iteratee shorthand.
|
||||
* _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
|
||||
* // => [{ 'x': 1 }]
|
||||
*/
|
||||
var intersectionBy = baseRest(function(arrays) {
|
||||
var iteratee = last(arrays),
|
||||
mapped = arrayMap(arrays, castArrayLikeObject);
|
||||
|
||||
if (iteratee === last(mapped)) {
|
||||
iteratee = undefined;
|
||||
} else {
|
||||
mapped.pop();
|
||||
}
|
||||
return (mapped.length && mapped[0] === arrays[0])
|
||||
? baseIntersection(mapped, baseIteratee(iteratee, 2))
|
||||
: [];
|
||||
});
|
||||
|
||||
module.exports = intersectionBy;
|
||||
@@ -0,0 +1,350 @@
|
||||
# js-codepage
|
||||
|
||||
[Codepages](https://en.wikipedia.org/wiki/Codepage) are character encodings. In
|
||||
many contexts, single- or double-byte character sets are used in lieu of Unicode
|
||||
encodings. The codepages map between characters and numbers.
|
||||
|
||||
## Setup
|
||||
|
||||
In node:
|
||||
|
||||
```js
|
||||
var cptable = require('codepage');
|
||||
```
|
||||
|
||||
In the browser:
|
||||
|
||||
```html
|
||||
<script src="cptable.js"></script>
|
||||
<script src="cputils.js"></script>
|
||||
```
|
||||
|
||||
Alternatively, use the full version in the dist folder:
|
||||
|
||||
```html
|
||||
<script src="cptable.full.js"></script>
|
||||
```
|
||||
|
||||
The complete set of codepages is large due to some Double Byte Character Set
|
||||
encodings. A much smaller file that only includes SBCS codepages is provided in
|
||||
this repo (`sbcs.js`), as well as a file for other projects (`cpexcel.js`)
|
||||
|
||||
If you know which codepages you need, you can include individual scripts for
|
||||
each codepage. The individual files are provided in the `bits/` directory.
|
||||
For example, to include only the Mac codepages:
|
||||
|
||||
```html
|
||||
<script src="bits/10000.js"></script>
|
||||
<script src="bits/10006.js"></script>
|
||||
<script src="bits/10007.js"></script>
|
||||
<script src="bits/10029.js"></script>
|
||||
<script src="bits/10079.js"></script>
|
||||
<script src="bits/10081.js"></script>
|
||||
```
|
||||
|
||||
All of the browser scripts define and append to the `cptable` object. To rename
|
||||
the object, edit the `JSVAR` shell variable in `make.sh` and run the script.
|
||||
|
||||
The utilities functions are contained in `cputils.js`, which assumes that the
|
||||
appropriate codepage scripts were loaded.
|
||||
|
||||
The script will manipulate `module.exports` if available . This is not always
|
||||
desirable. To prevent the behavior, define `DO_NOT_EXPORT_CODEPAGE`.
|
||||
|
||||
## Usage
|
||||
|
||||
Most codepages are indexed by number. To get the Unicode character for a given
|
||||
codepoint, use the `dec` property:
|
||||
|
||||
```js
|
||||
var unicode_cp10000_255 = cptable[10000].dec[255]; // ˇ
|
||||
```
|
||||
|
||||
To get the codepoint for a given character, use the `enc` property:
|
||||
|
||||
```js
|
||||
var cp10000_711 = cptable[10000].enc[String.fromCharCode(711)]; // 255
|
||||
```
|
||||
|
||||
There are a few utilities that deal with strings and buffers:
|
||||
|
||||
```js
|
||||
var 汇总 = cptable.utils.decode(936, [0xbb,0xe3,0xd7,0xdc]);
|
||||
var buf = cptable.utils.encode(936, 汇总);
|
||||
var sushi= cptable.utils.decode(65001, [0xf0,0x9f,0x8d,0xa3]); // 🍣
|
||||
var sbuf = cptable.utils.encode(65001, sushi);
|
||||
```
|
||||
|
||||
`cptable.utils.encode(CP, data, ofmt)` accepts a String or Array of characters
|
||||
and returns a representation controlled by `ofmt`:
|
||||
|
||||
- Default output is a Buffer (or Array) of bytes (integers between 0 and 255)
|
||||
- If `ofmt == 'str'`, return a binary String (byte `i` is `o.charCodeAt(i)`)
|
||||
- If `ofmt == 'arr'`, return an Array of bytes
|
||||
|
||||
`cptable.utils.decode(CP, data)` accepts a byte String or Array of numbers or
|
||||
Buffer and returns a JS string.
|
||||
|
||||
## Known Excel Codepages
|
||||
|
||||
A much smaller script, including only the codepages known to be used in Excel,
|
||||
is available under the name `cpexcel`. It exposes the same variable `cptable`
|
||||
and is suitable as a drop-in replacement when the full codepage tables are not
|
||||
needed.
|
||||
|
||||
In node:
|
||||
|
||||
```js
|
||||
var cptable = require('codepage/dist/cpexcel.full');
|
||||
```
|
||||
|
||||
## Rolling your own script
|
||||
|
||||
The `make.sh` script in the repo can take a manifest and generate JS source.
|
||||
|
||||
Usage:
|
||||
|
||||
```bash
|
||||
$ bash make.sh path_to_manifest output_file_name JSVAR
|
||||
```
|
||||
|
||||
where
|
||||
|
||||
- `JSVAR` is the name of the exported variable (generally `cptable`)
|
||||
- `output_file_name` is the output file (`cpexcel.js`, `cptable.js`, ...)
|
||||
- `path_to_manifest` is the path to the manifest file.
|
||||
|
||||
The manifest file is expected to be a CSV with 3 columns:
|
||||
|
||||
```
|
||||
<codepage number>,<source>,<size>
|
||||
```
|
||||
|
||||
If a source is specified, it will try to download the specified file and parse.
|
||||
The file format is expected to follow the format from the unicode.org site.
|
||||
The size should be `1` for a single-byte codepage and `2` for a double-byte
|
||||
codepage. For mixed codepages (which use some single- and some double-byte
|
||||
codes), the script assumes the mapping is a prefix code and generates efficient
|
||||
JS code.
|
||||
|
||||
Generated scripts only include the mapping. `cat` a mapping with `cputils.js`
|
||||
to produce a complete script like `cpexcel.full.js`.
|
||||
|
||||
## Building the complete script
|
||||
|
||||
This script uses [voc](npm.im/voc). The script to build the codepage tables and
|
||||
the JS source is `codepage.md`, so building involves `voc codepage.md`.
|
||||
|
||||
## Generated Codepages
|
||||
|
||||
The complete list of codepages can be found in the file `pages.csv`.
|
||||
|
||||
Some codepages are easier to implement algorithmically. Since those character
|
||||
tables are not generated, there is no corresponding entry (they are "magic").
|
||||
|
||||
| CP# | Source | Description |
|
||||
|--------:|:-----------:|:-----------------------------------------------------|
|
||||
| ` 37` | unicode.org | IBM EBCDIC US-Canada |
|
||||
| ` 437` | unicode.org | OEM United States |
|
||||
| ` 500` | unicode.org | IBM EBCDIC International |
|
||||
| ` 620` | NLS | Mazovia (Polish) MS-DOS |
|
||||
| ` 708` | Windows 7 | Arabic (ASMO 708) |
|
||||
| ` 720` | Windows 7 | Arabic (Transparent ASMO); Arabic (DOS) |
|
||||
| ` 737` | unicode.org | OEM Greek (formerly 437G); Greek (DOS) |
|
||||
| ` 775` | unicode.org | OEM Baltic; Baltic (DOS) |
|
||||
| ` 808` | unicode.org | OEM Russian; Cyrillic + Euro symbol |
|
||||
| ` 850` | unicode.org | OEM Multilingual Latin 1; Western European (DOS) |
|
||||
| ` 852` | unicode.org | OEM Latin 2; Central European (DOS) |
|
||||
| ` 855` | unicode.org | OEM Cyrillic (primarily Russian) |
|
||||
| ` 857` | unicode.org | OEM Turkish; Turkish (DOS) |
|
||||
| ` 858` | Windows 7 | OEM Multilingual Latin 1 + Euro symbol |
|
||||
| ` 860` | unicode.org | OEM Portuguese; Portuguese (DOS) |
|
||||
| ` 861` | unicode.org | OEM Icelandic; Icelandic (DOS) |
|
||||
| ` 862` | unicode.org | OEM Hebrew; Hebrew (DOS) |
|
||||
| ` 863` | unicode.org | OEM French Canadian; French Canadian (DOS) |
|
||||
| ` 864` | unicode.org | OEM Arabic; Arabic (864) |
|
||||
| ` 865` | unicode.org | OEM Nordic; Nordic (DOS) |
|
||||
| ` 866` | unicode.org | OEM Russian; Cyrillic (DOS) |
|
||||
| ` 869` | unicode.org | OEM Modern Greek; Greek, Modern (DOS) |
|
||||
| ` 870` | Windows 7 | IBM EBCDIC Multilingual/ROECE (Latin 2) |
|
||||
| ` 872` | unicode.org | OEM Cyrillic (primarily Russian) + Euro Symbol |
|
||||
| ` 874` | unicode.org | Windows Thai |
|
||||
| ` 875` | unicode.org | IBM EBCDIC Greek Modern |
|
||||
| ` 895` | NLS | Kamenický (Czech) MS-DOS |
|
||||
| ` 932` | unicode.org | Japanese Shift-JIS |
|
||||
| ` 936` | unicode.org | Simplified Chinese GBK |
|
||||
| ` 949` | unicode.org | Korean |
|
||||
| ` 950` | unicode.org | Traditional Chinese Big5 |
|
||||
| ` 1010` | IBM | IBM EBCDIC French |
|
||||
| ` 1026` | unicode.org | IBM EBCDIC Turkish (Latin 5) |
|
||||
| ` 1047` | Windows 7 | IBM EBCDIC Latin 1/Open System |
|
||||
| ` 1132` | IBM | IBM EBCDIC Lao (1132 / 1133 / 1341) |
|
||||
| ` 1140` | Windows 7 | IBM EBCDIC US-Canada (037 + Euro symbol) |
|
||||
| ` 1141` | Windows 7 | IBM EBCDIC Germany (20273 + Euro symbol) |
|
||||
| ` 1142` | Windows 7 | IBM EBCDIC Denmark-Norway (20277 + Euro symbol) |
|
||||
| ` 1143` | Windows 7 | IBM EBCDIC Finland-Sweden (20278 + Euro symbol) |
|
||||
| ` 1144` | Windows 7 | IBM EBCDIC Italy (20280 + Euro symbol) |
|
||||
| ` 1145` | Windows 7 | IBM EBCDIC Latin America-Spain (20284 + Euro symbol) |
|
||||
| ` 1146` | Windows 7 | IBM EBCDIC United Kingdom (20285 + Euro symbol) |
|
||||
| ` 1147` | Windows 7 | IBM EBCDIC France (20297 + Euro symbol) |
|
||||
| ` 1148` | Windows 7 | IBM EBCDIC International (500 + Euro symbol) |
|
||||
| ` 1149` | Windows 7 | IBM EBCDIC Icelandic (20871 + Euro symbol) |
|
||||
| ` 1200` | magic | Unicode UTF-16, little endian (BMP of ISO 10646) |
|
||||
| ` 1201` | magic | Unicode UTF-16, big endian |
|
||||
| ` 1250` | unicode.org | Windows Central Europe |
|
||||
| ` 1251` | unicode.org | Windows Cyrillic |
|
||||
| ` 1252` | unicode.org | Windows Latin I |
|
||||
| ` 1253` | unicode.org | Windows Greek |
|
||||
| ` 1254` | unicode.org | Windows Turkish |
|
||||
| ` 1255` | unicode.org | Windows Hebrew |
|
||||
| ` 1256` | unicode.org | Windows Arabic |
|
||||
| ` 1257` | unicode.org | Windows Baltic |
|
||||
| ` 1258` | unicode.org | Windows Vietnam |
|
||||
| ` 1361` | Windows 7 | Korean (Johab) |
|
||||
| `10000` | unicode.org | MAC Roman |
|
||||
| `10001` | Windows 7 | Japanese (Mac) |
|
||||
| `10002` | Windows 7 | MAC Traditional Chinese (Big5) |
|
||||
| `10003` | Windows 7 | Korean (Mac) |
|
||||
| `10004` | Windows 7 | Arabic (Mac) |
|
||||
| `10005` | Windows 7 | Hebrew (Mac) |
|
||||
| `10006` | unicode.org | Greek (Mac) |
|
||||
| `10007` | unicode.org | Cyrillic (Mac) |
|
||||
| `10008` | Windows 7 | MAC Simplified Chinese (GB 2312) |
|
||||
| `10010` | Windows 7 | Romanian (Mac) |
|
||||
| `10017` | Windows 7 | Ukrainian (Mac) |
|
||||
| `10021` | Windows 7 | Thai (Mac) |
|
||||
| `10029` | unicode.org | MAC Latin 2 (Central European) |
|
||||
| `10079` | unicode.org | Icelandic (Mac) |
|
||||
| `10081` | unicode.org | Turkish (Mac) |
|
||||
| `10082` | Windows 7 | Croatian (Mac) |
|
||||
| `12000` | magic | Unicode UTF-32, little endian byte order |
|
||||
| `12001` | magic | Unicode UTF-32, big endian byte order |
|
||||
| `20000` | Windows 7 | CNS Taiwan (Chinese Traditional) |
|
||||
| `20001` | Windows 7 | TCA Taiwan |
|
||||
| `20002` | Windows 7 | ETEN Taiwan (Chinese Traditional) |
|
||||
| `20003` | Windows 7 | IBM5550 Taiwan |
|
||||
| `20004` | Windows 7 | TeleText Taiwan |
|
||||
| `20005` | Windows 7 | Wang Taiwan |
|
||||
| `20105` | Windows 7 | Western European IA5 (IRV International Alphabet 5) |
|
||||
| `20106` | Windows 7 | IA5 German (7-bit) |
|
||||
| `20107` | Windows 7 | IA5 Swedish (7-bit) |
|
||||
| `20108` | Windows 7 | IA5 Norwegian (7-bit) |
|
||||
| `20127` | magic | US-ASCII (7-bit) |
|
||||
| `20261` | Windows 7 | T.61 |
|
||||
| `20269` | Windows 7 | ISO 6937 Non-Spacing Accent |
|
||||
| `20273` | Windows 7 | IBM EBCDIC Germany |
|
||||
| `20277` | Windows 7 | IBM EBCDIC Denmark-Norway |
|
||||
| `20278` | Windows 7 | IBM EBCDIC Finland-Sweden |
|
||||
| `20280` | Windows 7 | IBM EBCDIC Italy |
|
||||
| `20284` | Windows 7 | IBM EBCDIC Latin America-Spain |
|
||||
| `20285` | Windows 7 | IBM EBCDIC United Kingdom |
|
||||
| `20290` | Windows 7 | IBM EBCDIC Japanese Katakana Extended |
|
||||
| `20297` | Windows 7 | IBM EBCDIC France |
|
||||
| `20420` | Windows 7 | IBM EBCDIC Arabic |
|
||||
| `20423` | Windows 7 | IBM EBCDIC Greek |
|
||||
| `20424` | Windows 7 | IBM EBCDIC Hebrew |
|
||||
| `20833` | Windows 7 | IBM EBCDIC Korean Extended |
|
||||
| `20838` | Windows 7 | IBM EBCDIC Thai |
|
||||
| `20866` | Windows 7 | Russian Cyrillic (KOI8-R) |
|
||||
| `20871` | Windows 7 | IBM EBCDIC Icelandic |
|
||||
| `20880` | Windows 7 | IBM EBCDIC Cyrillic Russian |
|
||||
| `20905` | Windows 7 | IBM EBCDIC Turkish |
|
||||
| `20924` | Windows 7 | IBM EBCDIC Latin 1/Open System (1047 + Euro symbol) |
|
||||
| `20932` | Windows 7 | Japanese (JIS 0208-1990 and 0212-1990) |
|
||||
| `20936` | Windows 7 | Simplified Chinese (GB2312-80) |
|
||||
| `20949` | Windows 7 | Korean Wansung |
|
||||
| `21025` | Windows 7 | IBM EBCDIC Cyrillic Serbian-Bulgarian |
|
||||
| `21027` | NLS | Extended/Ext Alpha Lowercase |
|
||||
| `21866` | Windows 7 | Ukrainian Cyrillic (KOI8-U) |
|
||||
| `28591` | unicode.org | ISO 8859-1 Latin 1 (Western European) |
|
||||
| `28592` | unicode.org | ISO 8859-2 Latin 2 (Central European) |
|
||||
| `28593` | unicode.org | ISO 8859-3 Latin 3 |
|
||||
| `28594` | unicode.org | ISO 8859-4 Baltic |
|
||||
| `28595` | unicode.org | ISO 8859-5 Cyrillic |
|
||||
| `28596` | unicode.org | ISO 8859-6 Arabic |
|
||||
| `28597` | unicode.org | ISO 8859-7 Greek |
|
||||
| `28598` | unicode.org | ISO 8859-8 Hebrew (ISO-Visual) |
|
||||
| `28599` | unicode.org | ISO 8859-9 Turkish |
|
||||
| `28600` | unicode.org | ISO 8859-10 Latin 6 |
|
||||
| `28601` | unicode.org | ISO 8859-11 Latin (Thai) |
|
||||
| `28603` | unicode.org | ISO 8859-13 Latin 7 (Estonian) |
|
||||
| `28604` | unicode.org | ISO 8859-14 Latin 8 (Celtic) |
|
||||
| `28605` | unicode.org | ISO 8859-15 Latin 9 |
|
||||
| `28606` | unicode.org | ISO 8859-15 Latin 10 |
|
||||
| `29001` | Windows 7 | Europa 3 |
|
||||
| `38598` | Windows 7 | ISO 8859-8 Hebrew (ISO-Logical) |
|
||||
| `47451` | unicode.org | Atari ST/TT |
|
||||
| `50220` | magic | ISO 2022 JIS Japanese with no halfwidth Katakana |
|
||||
| `50221` | magic | ISO 2022 JIS Japanese with halfwidth Katakana |
|
||||
| `50222` | magic | ISO 2022 Japanese JIS X 0201-1989 (1 byte Kana-SO/SI)|
|
||||
| `50225` | magic | ISO 2022 Korean |
|
||||
| `50227` | magic | ISO 2022 Simplified Chinese |
|
||||
| `51932` | Windows 7 | EUC Japanese |
|
||||
| `51936` | Windows 7 | EUC Simplified Chinese |
|
||||
| `51949` | Windows 7 | EUC Korean |
|
||||
| `52936` | Windows 7 | HZ-GB2312 Simplified Chinese |
|
||||
| `54936` | Windows 7 | GB18030 Simplified Chinese (4 byte) |
|
||||
| `57002` | Windows 7 | ISCII Devanagari |
|
||||
| `57003` | Windows 7 | ISCII Bengali |
|
||||
| `57004` | Windows 7 | ISCII Tamil |
|
||||
| `57005` | Windows 7 | ISCII Telugu |
|
||||
| `57006` | Windows 7 | ISCII Assamese |
|
||||
| `57007` | Windows 7 | ISCII Oriya |
|
||||
| `57008` | Windows 7 | ISCII Kannada |
|
||||
| `57009` | Windows 7 | ISCII Malayalam |
|
||||
| `57010` | Windows 7 | ISCII Gujarati |
|
||||
| `57011` | Windows 7 | ISCII Punjabi |
|
||||
| `65000` | magic | Unicode (UTF-7) |
|
||||
| `65001` | magic | Unicode (UTF-8) |
|
||||
|
||||
`unicode.org` refers to the Unicode Consortium Public Mappings, a database of
|
||||
various mappings between Unicode characters and respective character sets. The
|
||||
tables are processed by a few scripts in the build process.
|
||||
|
||||
`IBM` refers to the IBM coded character set database. Even though IBM uses a
|
||||
different numbering scheme from Windows, the IBM numbers are used when there is
|
||||
no conflict. The tables are manually generated from the symbol manifests.
|
||||
|
||||
`Windows 7` refers to direct inspection of Windows 7 machines using .NET class
|
||||
`System.Text.Encoding`. The enclosed `MakeEncoding.cs` C# program brute-forces
|
||||
code pages. `MakeEncoding.cs` deviates from unicode.org in some cases. When they
|
||||
map a given code to different characters, unicode.org value is used. When
|
||||
unicode.org does not prescribe a value, `MakeEncoding.cs` value is used.
|
||||
|
||||
`NLS` refers to the National Language Support files supplied in various versions
|
||||
of Windows. In older versions of Windows (like Windows 98) these files followed
|
||||
the name pattern `CP_#.NLS`, but newer versions use the name pattern `C_#.NLS`.
|
||||
|
||||
## Testing
|
||||
|
||||
`make test` will run the nodejs-based test.
|
||||
|
||||
To run the in-browser tests, run a local server and go to the `ctest` directory.
|
||||
`make ctestserv` will start a python `SimpleHTTPServer` server on port 8000.
|
||||
|
||||
To update the browser artifacts, run `make ctest`.
|
||||
|
||||
## Sources
|
||||
|
||||
- [Unicode Consortium Public Mappings](http://www.unicode.org/Public/MAPPINGS/)
|
||||
- [Windows Code Page Enumeration](http://msdn.microsoft.com/en-us/library/cc195051.aspx)
|
||||
- [Windows Code Page Identifiers](http://msdn.microsoft.com/en-us/library/windows/desktop/dd317756.aspx)
|
||||
- [IBM Coded Character Sets](https://www-01.ibm.com/software/globalization/ccsid/ccsid_registered.html)
|
||||
- [ISO/IEC 2022 / ECMA-35](https://www.ecma-international.org/publications/files/ECMA-ST/Ecma-035.pdf)
|
||||
- [International Register of Coded Character Sets To Be Used With Escape Sequences](https://www.itscj.ipsj.or.jp/itscj_english/iso-ir/ISO-IR.pdf)
|
||||
- [Japanese Character Encoding for Internet Messages](https://tools.ietf.org/html/rfc1468)
|
||||
|
||||
## License
|
||||
|
||||
Please consult the attached LICENSE file for details. All rights not explicitly
|
||||
granted by the Apache 2.0 license are reserved by the Original Author.
|
||||
|
||||
## Badges
|
||||
|
||||
[](https://saucelabs.com/u/codepage)
|
||||
|
||||
[](https://travis-ci.org/SheetJS/js-codepage)
|
||||
|
||||
[](https://coveralls.io/r/SheetJS/js-codepage?branch=master)
|
||||
|
||||
[](https://github.com/SheetJS/js-codepage)
|
||||
@@ -0,0 +1,64 @@
|
||||
import type {BuiltIns, HasMultipleCallSignatures} from './internal';
|
||||
import type {Writable} from './writable.js';
|
||||
|
||||
/**
|
||||
Create a deeply mutable version of an `object`/`ReadonlyMap`/`ReadonlySet`/`ReadonlyArray` type. The inverse of `ReadonlyDeep<T>`. Use `Writable<T>` if you only need one level deep.
|
||||
|
||||
This can be used to [store and mutate options within a class](https://github.com/sindresorhus/pageres/blob/4a5d05fca19a5fbd2f53842cbf3eb7b1b63bddd2/source/index.ts#L72), [edit `readonly` objects within tests](https://stackoverflow.com/questions/50703834), [construct a `readonly` object within a function](https://github.com/Microsoft/TypeScript/issues/24509), or to define a single model where the only thing that changes is whether or not some of the keys are writable.
|
||||
|
||||
@example
|
||||
```
|
||||
import type {WritableDeep} from 'type-fest';
|
||||
|
||||
type Foo = {
|
||||
readonly a: number;
|
||||
readonly b: readonly string[]; // To show that mutability is deeply affected.
|
||||
readonly c: boolean;
|
||||
};
|
||||
|
||||
const writableDeepFoo: WritableDeep<Foo> = {a: 1, b: ['2'], c: true};
|
||||
writableDeepFoo.a = 3;
|
||||
writableDeepFoo.b[0] = 'new value';
|
||||
writableDeepFoo.b = ['something'];
|
||||
```
|
||||
|
||||
Note that types containing overloaded functions are not made deeply writable due to a [TypeScript limitation](https://github.com/microsoft/TypeScript/issues/29732).
|
||||
|
||||
@see Writable
|
||||
@category Object
|
||||
@category Array
|
||||
@category Set
|
||||
@category Map
|
||||
*/
|
||||
export type WritableDeep<T> = T extends BuiltIns
|
||||
? T
|
||||
: T extends (...arguments: any[]) => unknown
|
||||
? {} extends WritableObjectDeep<T>
|
||||
? T
|
||||
: HasMultipleCallSignatures<T> extends true
|
||||
? T
|
||||
: ((...arguments: Parameters<T>) => ReturnType<T>) & WritableObjectDeep<T>
|
||||
: T extends Readonly<ReadonlyMap<infer KeyType, infer ValueType>>
|
||||
? WritableMapDeep<KeyType, ValueType>
|
||||
: T extends Readonly<ReadonlySet<infer ItemType>>
|
||||
? WritableSetDeep<ItemType>
|
||||
: T extends object
|
||||
? WritableObjectDeep<T>
|
||||
: unknown;
|
||||
|
||||
/**
|
||||
Same as `WritableDeep`, but accepts only `Map`s as inputs. Internal helper for `WritableDeep`.
|
||||
*/
|
||||
type WritableMapDeep<KeyType, ValueType> = {} & Writable<Map<WritableDeep<KeyType>, WritableDeep<ValueType>>>;
|
||||
|
||||
/**
|
||||
Same as `WritableDeep`, but accepts only `Set`s as inputs. Internal helper for `WritableDeep`.
|
||||
*/
|
||||
type WritableSetDeep<ItemType> = {} & Writable<Set<WritableDeep<ItemType>>>;
|
||||
|
||||
/**
|
||||
Same as `WritableDeep`, but accepts only `object`s as inputs. Internal helper for `WritableDeep`.
|
||||
*/
|
||||
type WritableObjectDeep<ObjectType extends object> = {
|
||||
-readonly [KeyType in keyof ObjectType]: WritableDeep<ObjectType[KeyType]>
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
var createWrap = require('./_createWrap');
|
||||
|
||||
/** Used to compose bitmasks for function metadata. */
|
||||
var WRAP_ARY_FLAG = 128;
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func`, with up to `n` arguments,
|
||||
* ignoring any additional arguments.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 3.0.0
|
||||
* @category Function
|
||||
* @param {Function} func The function to cap arguments for.
|
||||
* @param {number} [n=func.length] The arity cap.
|
||||
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
|
||||
* @returns {Function} Returns the new capped function.
|
||||
* @example
|
||||
*
|
||||
* _.map(['6', '8', '10'], _.ary(parseInt, 1));
|
||||
* // => [6, 8, 10]
|
||||
*/
|
||||
function ary(func, n, guard) {
|
||||
n = guard ? undefined : n;
|
||||
n = (func && n == null) ? func.length : n;
|
||||
return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
|
||||
}
|
||||
|
||||
module.exports = ary;
|
||||
@@ -0,0 +1,102 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for csv2json/libs/core/linesToJson.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../../index.html">All files</a> / <a href="index.html">csv2json/libs/core</a> linesToJson.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>0/121</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>0/88</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>0/16</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>0/121</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line low'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a></td><td class="line-coverage quiet"><span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span></td><td class="text"><pre class="prettyprint lang-js">Unable to lookup source: /Users/kxiang/work/projects/csv2json/libs/core/linesToJson.js(ENOENT: no such file or directory, open '/Users/kxiang/work/projects/csv2json/libs/core/linesToJson.js')
|
||||
Error: Unable to lookup source: /Users/kxiang/work/projects/csv2json/libs/core/linesToJson.js(ENOENT: no such file or directory, open '/Users/kxiang/work/projects/csv2json/libs/core/linesToJson.js')
|
||||
at Context.defaultSourceLookup [as sourceFinder] (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/context.js:15:15)
|
||||
at Context.getSource (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/context.js:74:17)
|
||||
at Object.annotateSourceCode (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-reports/lib/html/annotator.js:172:38)
|
||||
at HtmlReport.onDetail (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-reports/lib/html/index.js:237:39)
|
||||
at Visitor.(anonymous function) [as onDetail] (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:34:30)
|
||||
at ReportNode.Node.visit (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:123:17)
|
||||
at /Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:116:23
|
||||
at Array.forEach (native)
|
||||
at visitChildren (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:115:32)
|
||||
at ReportNode.Node.visit (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:126:5)</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri May 11 2018 21:36:07 GMT+0100 (IST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../../sorter.js"></script>
|
||||
<script src="../../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,98 @@
|
||||
import { slice } from './util';
|
||||
import options from './options';
|
||||
|
||||
let vnodeId = 0;
|
||||
|
||||
/**
|
||||
* Create an virtual node (used for JSX)
|
||||
* @param {import('./internal').VNode["type"]} type The node name or Component
|
||||
* constructor for this virtual node
|
||||
* @param {object | null | undefined} [props] The properties of the virtual node
|
||||
* @param {Array<import('.').ComponentChildren>} [children] The children of the virtual node
|
||||
* @returns {import('./internal').VNode}
|
||||
*/
|
||||
export function createElement(type, props, children) {
|
||||
let normalizedProps = {},
|
||||
key,
|
||||
ref,
|
||||
i;
|
||||
for (i in props) {
|
||||
if (i == 'key') key = props[i];
|
||||
else if (i == 'ref') ref = props[i];
|
||||
else normalizedProps[i] = props[i];
|
||||
}
|
||||
|
||||
if (arguments.length > 2) {
|
||||
normalizedProps.children =
|
||||
arguments.length > 3 ? slice.call(arguments, 2) : children;
|
||||
}
|
||||
|
||||
// If a Component VNode, check for and apply defaultProps
|
||||
// Note: type may be undefined in development, must never error here.
|
||||
if (typeof type == 'function' && type.defaultProps != null) {
|
||||
for (i in type.defaultProps) {
|
||||
if (normalizedProps[i] === undefined) {
|
||||
normalizedProps[i] = type.defaultProps[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return createVNode(type, normalizedProps, key, ref, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a VNode (used internally by Preact)
|
||||
* @param {import('./internal').VNode["type"]} type The node name or Component
|
||||
* Constructor for this virtual node
|
||||
* @param {object | string | number | null} props The properties of this virtual node.
|
||||
* If this virtual node represents a text node, this is the text of the node (string or number).
|
||||
* @param {string | number | null} key The key for this virtual node, used when
|
||||
* diffing it against its children
|
||||
* @param {import('./internal').VNode["ref"]} ref The ref property that will
|
||||
* receive a reference to its created child
|
||||
* @returns {import('./internal').VNode}
|
||||
*/
|
||||
export function createVNode(type, props, key, ref, original) {
|
||||
// V8 seems to be better at detecting type shapes if the object is allocated from the same call site
|
||||
// Do not inline into createElement and coerceToVNode!
|
||||
const vnode = {
|
||||
type,
|
||||
props,
|
||||
key,
|
||||
ref,
|
||||
_children: null,
|
||||
_parent: null,
|
||||
_depth: 0,
|
||||
_dom: null,
|
||||
// _nextDom must be initialized to undefined b/c it will eventually
|
||||
// be set to dom.nextSibling which can return `null` and it is important
|
||||
// to be able to distinguish between an uninitialized _nextDom and
|
||||
// a _nextDom that has been set to `null`
|
||||
_nextDom: undefined,
|
||||
_component: null,
|
||||
_hydrating: null,
|
||||
constructor: undefined,
|
||||
_original: original == null ? ++vnodeId : original
|
||||
};
|
||||
|
||||
// Only invoke the vnode hook if this was *not* a direct copy:
|
||||
if (original == null && options.vnode != null) options.vnode(vnode);
|
||||
|
||||
return vnode;
|
||||
}
|
||||
|
||||
export function createRef() {
|
||||
return { current: null };
|
||||
}
|
||||
|
||||
export function Fragment(props) {
|
||||
return props.children;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a the argument is a valid Preact VNode.
|
||||
* @param {*} vnode
|
||||
* @returns {vnode is import('./internal').VNode}
|
||||
*/
|
||||
export const isValidElement = vnode =>
|
||||
vnode != null && vnode.constructor === undefined;
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "dtslint/dtslint.json",
|
||||
"rules": {
|
||||
"whitespace": false,
|
||||
"no-sparse-arrays": false,
|
||||
"only-arrow-functions": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"one-variable-per-declaration": false
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,41 @@
|
||||
var apply = require('./_apply'),
|
||||
baseEach = require('./_baseEach'),
|
||||
baseInvoke = require('./_baseInvoke'),
|
||||
baseRest = require('./_baseRest'),
|
||||
isArrayLike = require('./isArrayLike');
|
||||
|
||||
/**
|
||||
* Invokes the method at `path` of each element in `collection`, returning
|
||||
* an array of the results of each invoked method. Any additional arguments
|
||||
* are provided to each invoked method. If `path` is a function, it's invoked
|
||||
* for, and `this` bound to, each element in `collection`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Collection
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Array|Function|string} path The path of the method to invoke or
|
||||
* the function invoked per iteration.
|
||||
* @param {...*} [args] The arguments to invoke each method with.
|
||||
* @returns {Array} Returns the array of results.
|
||||
* @example
|
||||
*
|
||||
* _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
|
||||
* // => [[1, 5, 7], [1, 2, 3]]
|
||||
*
|
||||
* _.invokeMap([123, 456], String.prototype.split, '');
|
||||
* // => [['1', '2', '3'], ['4', '5', '6']]
|
||||
*/
|
||||
var invokeMap = baseRest(function(collection, path, args) {
|
||||
var index = -1,
|
||||
isFunc = typeof path == 'function',
|
||||
result = isArrayLike(collection) ? Array(collection.length) : [];
|
||||
|
||||
baseEach(collection, function(value) {
|
||||
result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
|
||||
});
|
||||
return result;
|
||||
});
|
||||
|
||||
module.exports = invokeMap;
|
||||
@@ -0,0 +1,566 @@
|
||||
semver(1) -- The semantic versioner for npm
|
||||
===========================================
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
npm install semver
|
||||
````
|
||||
|
||||
## Usage
|
||||
|
||||
As a node module:
|
||||
|
||||
```js
|
||||
const semver = require('semver')
|
||||
|
||||
semver.valid('1.2.3') // '1.2.3'
|
||||
semver.valid('a.b.c') // null
|
||||
semver.clean(' =v1.2.3 ') // '1.2.3'
|
||||
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
|
||||
semver.gt('1.2.3', '9.8.7') // false
|
||||
semver.lt('1.2.3', '9.8.7') // true
|
||||
semver.minVersion('>=1.0.0') // '1.0.0'
|
||||
semver.valid(semver.coerce('v2')) // '2.0.0'
|
||||
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
|
||||
```
|
||||
|
||||
You can also just load the module for the function that you care about, if
|
||||
you'd like to minimize your footprint.
|
||||
|
||||
```js
|
||||
// load the whole API at once in a single object
|
||||
const semver = require('semver')
|
||||
|
||||
// or just load the bits you need
|
||||
// all of them listed here, just pick and choose what you want
|
||||
|
||||
// classes
|
||||
const SemVer = require('semver/classes/semver')
|
||||
const Comparator = require('semver/classes/comparator')
|
||||
const Range = require('semver/classes/range')
|
||||
|
||||
// functions for working with versions
|
||||
const semverParse = require('semver/functions/parse')
|
||||
const semverValid = require('semver/functions/valid')
|
||||
const semverClean = require('semver/functions/clean')
|
||||
const semverInc = require('semver/functions/inc')
|
||||
const semverDiff = require('semver/functions/diff')
|
||||
const semverMajor = require('semver/functions/major')
|
||||
const semverMinor = require('semver/functions/minor')
|
||||
const semverPatch = require('semver/functions/patch')
|
||||
const semverPrerelease = require('semver/functions/prerelease')
|
||||
const semverCompare = require('semver/functions/compare')
|
||||
const semverRcompare = require('semver/functions/rcompare')
|
||||
const semverCompareLoose = require('semver/functions/compare-loose')
|
||||
const semverCompareBuild = require('semver/functions/compare-build')
|
||||
const semverSort = require('semver/functions/sort')
|
||||
const semverRsort = require('semver/functions/rsort')
|
||||
|
||||
// low-level comparators between versions
|
||||
const semverGt = require('semver/functions/gt')
|
||||
const semverLt = require('semver/functions/lt')
|
||||
const semverEq = require('semver/functions/eq')
|
||||
const semverNeq = require('semver/functions/neq')
|
||||
const semverGte = require('semver/functions/gte')
|
||||
const semverLte = require('semver/functions/lte')
|
||||
const semverCmp = require('semver/functions/cmp')
|
||||
const semverCoerce = require('semver/functions/coerce')
|
||||
|
||||
// working with ranges
|
||||
const semverSatisfies = require('semver/functions/satisfies')
|
||||
const semverMaxSatisfying = require('semver/ranges/max-satisfying')
|
||||
const semverMinSatisfying = require('semver/ranges/min-satisfying')
|
||||
const semverToComparators = require('semver/ranges/to-comparators')
|
||||
const semverMinVersion = require('semver/ranges/min-version')
|
||||
const semverValidRange = require('semver/ranges/valid')
|
||||
const semverOutside = require('semver/ranges/outside')
|
||||
const semverGtr = require('semver/ranges/gtr')
|
||||
const semverLtr = require('semver/ranges/ltr')
|
||||
const semverIntersects = require('semver/ranges/intersects')
|
||||
const simplifyRange = require('semver/ranges/simplify')
|
||||
const rangeSubset = require('semver/ranges/subset')
|
||||
```
|
||||
|
||||
As a command-line utility:
|
||||
|
||||
```
|
||||
$ semver -h
|
||||
|
||||
A JavaScript implementation of the https://semver.org/ specification
|
||||
Copyright Isaac Z. Schlueter
|
||||
|
||||
Usage: semver [options] <version> [<version> [...]]
|
||||
Prints valid versions sorted by SemVer precedence
|
||||
|
||||
Options:
|
||||
-r --range <range>
|
||||
Print versions that match the specified range.
|
||||
|
||||
-i --increment [<level>]
|
||||
Increment a version by the specified level. Level can
|
||||
be one of: major, minor, patch, premajor, preminor,
|
||||
prepatch, or prerelease. Default level is 'patch'.
|
||||
Only one version may be specified.
|
||||
|
||||
--preid <identifier>
|
||||
Identifier to be used to prefix premajor, preminor,
|
||||
prepatch or prerelease version increments.
|
||||
|
||||
-l --loose
|
||||
Interpret versions and ranges loosely
|
||||
|
||||
-p --include-prerelease
|
||||
Always include prerelease versions in range matching
|
||||
|
||||
-c --coerce
|
||||
Coerce a string into SemVer if possible
|
||||
(does not imply --loose)
|
||||
|
||||
--rtl
|
||||
Coerce version strings right to left
|
||||
|
||||
--ltr
|
||||
Coerce version strings left to right (default)
|
||||
|
||||
Program exits successfully if any valid version satisfies
|
||||
all supplied ranges, and prints all satisfying versions.
|
||||
|
||||
If no satisfying versions are found, then exits failure.
|
||||
|
||||
Versions are printed in ascending order, so supplying
|
||||
multiple versions to the utility will just sort them.
|
||||
```
|
||||
|
||||
## Versions
|
||||
|
||||
A "version" is described by the `v2.0.0` specification found at
|
||||
<https://semver.org/>.
|
||||
|
||||
A leading `"="` or `"v"` character is stripped off and ignored.
|
||||
|
||||
## Ranges
|
||||
|
||||
A `version range` is a set of `comparators` which specify versions
|
||||
that satisfy the range.
|
||||
|
||||
A `comparator` is composed of an `operator` and a `version`. The set
|
||||
of primitive `operators` is:
|
||||
|
||||
* `<` Less than
|
||||
* `<=` Less than or equal to
|
||||
* `>` Greater than
|
||||
* `>=` Greater than or equal to
|
||||
* `=` Equal. If no operator is specified, then equality is assumed,
|
||||
so this operator is optional, but MAY be included.
|
||||
|
||||
For example, the comparator `>=1.2.7` would match the versions
|
||||
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
|
||||
or `1.1.0`.
|
||||
|
||||
Comparators can be joined by whitespace to form a `comparator set`,
|
||||
which is satisfied by the **intersection** of all of the comparators
|
||||
it includes.
|
||||
|
||||
A range is composed of one or more comparator sets, joined by `||`. A
|
||||
version matches a range if and only if every comparator in at least
|
||||
one of the `||`-separated comparator sets is satisfied by the version.
|
||||
|
||||
For example, the range `>=1.2.7 <1.3.0` would match the versions
|
||||
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
|
||||
or `1.1.0`.
|
||||
|
||||
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
|
||||
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
|
||||
|
||||
### Prerelease Tags
|
||||
|
||||
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
|
||||
it will only be allowed to satisfy comparator sets if at least one
|
||||
comparator with the same `[major, minor, patch]` tuple also has a
|
||||
prerelease tag.
|
||||
|
||||
For example, the range `>1.2.3-alpha.3` would be allowed to match the
|
||||
version `1.2.3-alpha.7`, but it would *not* be satisfied by
|
||||
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
|
||||
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
|
||||
range only accepts prerelease tags on the `1.2.3` version. The
|
||||
version `3.4.5` *would* satisfy the range, because it does not have a
|
||||
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
|
||||
|
||||
The purpose for this behavior is twofold. First, prerelease versions
|
||||
frequently are updated very quickly, and contain many breaking changes
|
||||
that are (by the author's design) not yet fit for public consumption.
|
||||
Therefore, by default, they are excluded from range matching
|
||||
semantics.
|
||||
|
||||
Second, a user who has opted into using a prerelease version has
|
||||
clearly indicated the intent to use *that specific* set of
|
||||
alpha/beta/rc versions. By including a prerelease tag in the range,
|
||||
the user is indicating that they are aware of the risk. However, it
|
||||
is still not appropriate to assume that they have opted into taking a
|
||||
similar risk on the *next* set of prerelease versions.
|
||||
|
||||
Note that this behavior can be suppressed (treating all prerelease
|
||||
versions as if they were normal versions, for the purpose of range
|
||||
matching) by setting the `includePrerelease` flag on the options
|
||||
object to any
|
||||
[functions](https://github.com/npm/node-semver#functions) that do
|
||||
range matching.
|
||||
|
||||
#### Prerelease Identifiers
|
||||
|
||||
The method `.inc` takes an additional `identifier` string argument that
|
||||
will append the value of the string as a prerelease identifier:
|
||||
|
||||
```javascript
|
||||
semver.inc('1.2.3', 'prerelease', 'beta')
|
||||
// '1.2.4-beta.0'
|
||||
```
|
||||
|
||||
command-line example:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.3 -i prerelease --preid beta
|
||||
1.2.4-beta.0
|
||||
```
|
||||
|
||||
Which then can be used to increment further:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.4-beta.0 -i prerelease
|
||||
1.2.4-beta.1
|
||||
```
|
||||
|
||||
### Advanced Range Syntax
|
||||
|
||||
Advanced range syntax desugars to primitive comparators in
|
||||
deterministic ways.
|
||||
|
||||
Advanced ranges may be combined in the same way as primitive
|
||||
comparators using white space or `||`.
|
||||
|
||||
#### Hyphen Ranges `X.Y.Z - A.B.C`
|
||||
|
||||
Specifies an inclusive set.
|
||||
|
||||
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the first version in the inclusive
|
||||
range, then the missing pieces are replaced with zeroes.
|
||||
|
||||
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the second version in the
|
||||
inclusive range, then all versions that start with the supplied parts
|
||||
of the tuple are accepted, but nothing that would be greater than the
|
||||
provided tuple parts.
|
||||
|
||||
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0`
|
||||
* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0`
|
||||
|
||||
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
|
||||
|
||||
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
|
||||
numeric values in the `[major, minor, patch]` tuple.
|
||||
|
||||
* `*` := `>=0.0.0` (Any version satisfies)
|
||||
* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version)
|
||||
* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions)
|
||||
|
||||
A partial version range is treated as an X-Range, so the special
|
||||
character is in fact optional.
|
||||
|
||||
* `""` (empty string) := `*` := `>=0.0.0`
|
||||
* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0`
|
||||
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0`
|
||||
|
||||
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
|
||||
|
||||
Allows patch-level changes if a minor version is specified on the
|
||||
comparator. Allows minor-level changes if not.
|
||||
|
||||
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0`
|
||||
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`)
|
||||
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`)
|
||||
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0`
|
||||
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`)
|
||||
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`)
|
||||
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
|
||||
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
|
||||
|
||||
Allows changes that do not modify the left-most non-zero element in the
|
||||
`[major, minor, patch]` tuple. In other words, this allows patch and
|
||||
minor updates for versions `1.0.0` and above, patch updates for
|
||||
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
|
||||
|
||||
Many authors treat a `0.x` version as if the `x` were the major
|
||||
"breaking-change" indicator.
|
||||
|
||||
Caret ranges are ideal when an author may make breaking changes
|
||||
between `0.2.4` and `0.3.0` releases, which is a common practice.
|
||||
However, it presumes that there will *not* be breaking changes between
|
||||
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
|
||||
additive (but non-breaking), according to commonly observed practices.
|
||||
|
||||
* `^1.2.3` := `>=1.2.3 <2.0.0-0`
|
||||
* `^0.2.3` := `>=0.2.3 <0.3.0-0`
|
||||
* `^0.0.3` := `>=0.0.3 <0.0.4-0`
|
||||
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the
|
||||
`0.0.3` version *only* will be allowed, if they are greater than or
|
||||
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
|
||||
|
||||
When parsing caret ranges, a missing `patch` value desugars to the
|
||||
number `0`, but will allow flexibility within that value, even if the
|
||||
major and minor versions are both `0`.
|
||||
|
||||
* `^1.2.x` := `>=1.2.0 <2.0.0-0`
|
||||
* `^0.0.x` := `>=0.0.0 <0.1.0-0`
|
||||
* `^0.0` := `>=0.0.0 <0.1.0-0`
|
||||
|
||||
A missing `minor` and `patch` values will desugar to zero, but also
|
||||
allow flexibility within those values, even if the major version is
|
||||
zero.
|
||||
|
||||
* `^1.x` := `>=1.0.0 <2.0.0-0`
|
||||
* `^0.x` := `>=0.0.0 <1.0.0-0`
|
||||
|
||||
### Range Grammar
|
||||
|
||||
Putting all this together, here is a Backus-Naur grammar for ranges,
|
||||
for the benefit of parser authors:
|
||||
|
||||
```bnf
|
||||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
All methods and classes take a final `options` object argument. All
|
||||
options in this object are `false` by default. The options supported
|
||||
are:
|
||||
|
||||
- `loose` Be more forgiving about not-quite-valid semver strings.
|
||||
(Any resulting output will always be 100% strict compliant, of
|
||||
course.) For backwards compatibility reasons, if the `options`
|
||||
argument is a boolean value instead of an object, it is interpreted
|
||||
to be the `loose` param.
|
||||
- `includePrerelease` Set to suppress the [default
|
||||
behavior](https://github.com/npm/node-semver#prerelease-tags) of
|
||||
excluding prerelease tagged versions from ranges unless they are
|
||||
explicitly opted into.
|
||||
|
||||
Strict-mode Comparators and Ranges will be strict about the SemVer
|
||||
strings that they parse.
|
||||
|
||||
* `valid(v)`: Return the parsed version, or null if it's not valid.
|
||||
* `inc(v, release)`: Return the version incremented by the release
|
||||
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
|
||||
`prepatch`, or `prerelease`), or null if it's not valid
|
||||
* `premajor` in one call will bump the version up to the next major
|
||||
version and down to a prerelease of that major version.
|
||||
`preminor`, and `prepatch` work the same way.
|
||||
* If called from a non-prerelease version, the `prerelease` will work the
|
||||
same as `prepatch`. It increments the patch version, then makes a
|
||||
prerelease. If the input version is already a prerelease it simply
|
||||
increments it.
|
||||
* `prerelease(v)`: Returns an array of prerelease components, or null
|
||||
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
|
||||
* `major(v)`: Return the major version number.
|
||||
* `minor(v)`: Return the minor version number.
|
||||
* `patch(v)`: Return the patch version number.
|
||||
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
|
||||
or comparators intersect.
|
||||
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
|
||||
a `SemVer` object or `null`.
|
||||
|
||||
### Comparison
|
||||
|
||||
* `gt(v1, v2)`: `v1 > v2`
|
||||
* `gte(v1, v2)`: `v1 >= v2`
|
||||
* `lt(v1, v2)`: `v1 < v2`
|
||||
* `lte(v1, v2)`: `v1 <= v2`
|
||||
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
|
||||
even if they're not the exact same string. You already know how to
|
||||
compare strings.
|
||||
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
|
||||
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
|
||||
the corresponding function above. `"==="` and `"!=="` do simple
|
||||
string comparison, but are included for completeness. Throws if an
|
||||
invalid comparison string is provided.
|
||||
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
|
||||
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||
* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
|
||||
in descending order when passed to `Array.sort()`.
|
||||
* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
|
||||
are equal. Sorts in ascending order if passed to `Array.sort()`.
|
||||
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||
* `diff(v1, v2)`: Returns difference between two versions by the release type
|
||||
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
|
||||
or null if the versions are the same.
|
||||
|
||||
### Comparators
|
||||
|
||||
* `intersects(comparator)`: Return true if the comparators intersect
|
||||
|
||||
### Ranges
|
||||
|
||||
* `validRange(range)`: Return the valid range or null if it's not valid
|
||||
* `satisfies(version, range)`: Return true if the version satisfies the
|
||||
range.
|
||||
* `maxSatisfying(versions, range)`: Return the highest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minSatisfying(versions, range)`: Return the lowest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minVersion(range)`: Return the lowest version that can possibly match
|
||||
the given range.
|
||||
* `gtr(version, range)`: Return `true` if version is greater than all the
|
||||
versions possible in the range.
|
||||
* `ltr(version, range)`: Return `true` if version is less than all the
|
||||
versions possible in the range.
|
||||
* `outside(version, range, hilo)`: Return true if the version is outside
|
||||
the bounds of the range in either the high or low direction. The
|
||||
`hilo` argument must be either the string `'>'` or `'<'`. (This is
|
||||
the function called by `gtr` and `ltr`.)
|
||||
* `intersects(range)`: Return true if any of the ranges comparators intersect
|
||||
* `simplifyRange(versions, range)`: Return a "simplified" range that
|
||||
matches the same items in `versions` list as the range specified. Note
|
||||
that it does *not* guarantee that it would match the same versions in all
|
||||
cases, only for the set of versions provided. This is useful when
|
||||
generating ranges by joining together multiple versions with `||`
|
||||
programmatically, to provide the user with something a bit more
|
||||
ergonomic. If the provided range is shorter in string-length than the
|
||||
generated range, then that is returned.
|
||||
* `subset(subRange, superRange)`: Return `true` if the `subRange` range is
|
||||
entirely contained by the `superRange` range.
|
||||
|
||||
Note that, since ranges may be non-contiguous, a version might not be
|
||||
greater than a range, less than a range, *or* satisfy a range! For
|
||||
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
|
||||
until `2.0.0`, so the version `1.2.10` would not be greater than the
|
||||
range (because `2.0.1` satisfies, which is higher), nor less than the
|
||||
range (since `1.2.8` satisfies, which is lower), and it also does not
|
||||
satisfy the range.
|
||||
|
||||
If you want to know if a version satisfies or does not satisfy a
|
||||
range, use the `satisfies(version, range)` function.
|
||||
|
||||
### Coercion
|
||||
|
||||
* `coerce(version, options)`: Coerces a string to semver if possible
|
||||
|
||||
This aims to provide a very forgiving translation of a non-semver string to
|
||||
semver. It looks for the first digit in a string, and consumes all
|
||||
remaining characters which satisfy at least a partial semver (e.g., `1`,
|
||||
`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
|
||||
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
|
||||
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
|
||||
`3.4.0`). Only text which lacks digits will fail coercion (`version one`
|
||||
is not valid). The maximum length for any semver component considered for
|
||||
coercion is 16 characters; longer components will be ignored
|
||||
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
|
||||
semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
|
||||
components are invalid (`9999999999999999.4.7.4` is likely invalid).
|
||||
|
||||
If the `options.rtl` flag is set, then `coerce` will return the right-most
|
||||
coercible tuple that does not share an ending index with a longer coercible
|
||||
tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
|
||||
`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
|
||||
any other overlapping SemVer tuple.
|
||||
|
||||
### Clean
|
||||
|
||||
* `clean(version)`: Clean a string to be a valid semver if possible
|
||||
|
||||
This will return a cleaned and trimmed semver version. If the provided
|
||||
version is not valid a null will be returned. This does not work for
|
||||
ranges.
|
||||
|
||||
ex.
|
||||
* `s.clean(' = v 2.1.5foo')`: `null`
|
||||
* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
|
||||
* `s.clean(' = v 2.1.5-foo')`: `null`
|
||||
* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
|
||||
* `s.clean('=v2.1.5')`: `'2.1.5'`
|
||||
* `s.clean(' =v2.1.5')`: `2.1.5`
|
||||
* `s.clean(' 2.1.5 ')`: `'2.1.5'`
|
||||
* `s.clean('~1.0.0')`: `null`
|
||||
|
||||
## Exported Modules
|
||||
|
||||
<!--
|
||||
TODO: Make sure that all of these items are documented (classes aren't,
|
||||
eg), and then pull the module name into the documentation for that specific
|
||||
thing.
|
||||
-->
|
||||
|
||||
You may pull in just the part of this semver utility that you need, if you
|
||||
are sensitive to packing and tree-shaking concerns. The main
|
||||
`require('semver')` export uses getter functions to lazily load the parts
|
||||
of the API that are used.
|
||||
|
||||
The following modules are available:
|
||||
|
||||
* `require('semver')`
|
||||
* `require('semver/classes')`
|
||||
* `require('semver/classes/comparator')`
|
||||
* `require('semver/classes/range')`
|
||||
* `require('semver/classes/semver')`
|
||||
* `require('semver/functions/clean')`
|
||||
* `require('semver/functions/cmp')`
|
||||
* `require('semver/functions/coerce')`
|
||||
* `require('semver/functions/compare')`
|
||||
* `require('semver/functions/compare-build')`
|
||||
* `require('semver/functions/compare-loose')`
|
||||
* `require('semver/functions/diff')`
|
||||
* `require('semver/functions/eq')`
|
||||
* `require('semver/functions/gt')`
|
||||
* `require('semver/functions/gte')`
|
||||
* `require('semver/functions/inc')`
|
||||
* `require('semver/functions/lt')`
|
||||
* `require('semver/functions/lte')`
|
||||
* `require('semver/functions/major')`
|
||||
* `require('semver/functions/minor')`
|
||||
* `require('semver/functions/neq')`
|
||||
* `require('semver/functions/parse')`
|
||||
* `require('semver/functions/patch')`
|
||||
* `require('semver/functions/prerelease')`
|
||||
* `require('semver/functions/rcompare')`
|
||||
* `require('semver/functions/rsort')`
|
||||
* `require('semver/functions/satisfies')`
|
||||
* `require('semver/functions/sort')`
|
||||
* `require('semver/functions/valid')`
|
||||
* `require('semver/ranges/gtr')`
|
||||
* `require('semver/ranges/intersects')`
|
||||
* `require('semver/ranges/ltr')`
|
||||
* `require('semver/ranges/max-satisfying')`
|
||||
* `require('semver/ranges/min-satisfying')`
|
||||
* `require('semver/ranges/min-version')`
|
||||
* `require('semver/ranges/outside')`
|
||||
* `require('semver/ranges/to-comparators')`
|
||||
* `require('semver/ranges/valid')`
|
||||
@@ -0,0 +1,326 @@
|
||||
// https://github.com/microsoft/TypeScript/issues/40462#issuecomment-689879308
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
|
||||
import { Observable } from './Observable';
|
||||
import { Subscription } from './Subscription';
|
||||
|
||||
/**
|
||||
* Note: This will add Symbol.observable globally for all TypeScript users,
|
||||
* however, we are no longer polyfilling Symbol.observable
|
||||
*/
|
||||
declare global {
|
||||
interface SymbolConstructor {
|
||||
readonly observable: symbol;
|
||||
}
|
||||
}
|
||||
|
||||
/** OPERATOR INTERFACES */
|
||||
|
||||
export interface UnaryFunction<T, R> {
|
||||
(source: T): R;
|
||||
}
|
||||
|
||||
export interface OperatorFunction<T, R> extends UnaryFunction<Observable<T>, Observable<R>> {}
|
||||
|
||||
export type FactoryOrValue<T> = T | (() => T);
|
||||
|
||||
export interface MonoTypeOperatorFunction<T> extends OperatorFunction<T, T> {}
|
||||
|
||||
/**
|
||||
* A value and the time at which it was emitted.
|
||||
*
|
||||
* Emitted by the `timestamp` operator
|
||||
*
|
||||
* @see {@link timestamp}
|
||||
*/
|
||||
export interface Timestamp<T> {
|
||||
value: T;
|
||||
/**
|
||||
* The timestamp. By default, this is in epoch milliseconds.
|
||||
* Could vary based on the timestamp provider passed to the operator.
|
||||
*/
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* A value emitted and the amount of time since the last value was emitted.
|
||||
*
|
||||
* Emitted by the `timeInterval` operator.
|
||||
*
|
||||
* @see {@link timeInterval}
|
||||
*/
|
||||
export interface TimeInterval<T> {
|
||||
value: T;
|
||||
|
||||
/**
|
||||
* The amount of time between this value's emission and the previous value's emission.
|
||||
* If this is the first emitted value, then it will be the amount of time since subscription
|
||||
* started.
|
||||
*/
|
||||
interval: number;
|
||||
}
|
||||
|
||||
/** SUBSCRIPTION INTERFACES */
|
||||
|
||||
export interface Unsubscribable {
|
||||
unsubscribe(): void;
|
||||
}
|
||||
|
||||
export type TeardownLogic = Subscription | Unsubscribable | (() => void) | void;
|
||||
|
||||
export interface SubscriptionLike extends Unsubscribable {
|
||||
unsubscribe(): void;
|
||||
readonly closed: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Do not use. Most likely you want to use `ObservableInput`. Will be removed in v8.
|
||||
*/
|
||||
export type SubscribableOrPromise<T> = Subscribable<T> | Subscribable<never> | PromiseLike<T> | InteropObservable<T>;
|
||||
|
||||
/** OBSERVABLE INTERFACES */
|
||||
|
||||
export interface Subscribable<T> {
|
||||
subscribe(observer: Partial<Observer<T>>): Unsubscribable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Valid types that can be converted to observables.
|
||||
*/
|
||||
export type ObservableInput<T> =
|
||||
| Observable<T>
|
||||
| InteropObservable<T>
|
||||
| AsyncIterable<T>
|
||||
| PromiseLike<T>
|
||||
| ArrayLike<T>
|
||||
| Iterable<T>
|
||||
| ReadableStreamLike<T>;
|
||||
|
||||
/**
|
||||
* @deprecated Renamed to {@link InteropObservable }. Will be removed in v8.
|
||||
*/
|
||||
export type ObservableLike<T> = InteropObservable<T>;
|
||||
|
||||
/**
|
||||
* An object that implements the `Symbol.observable` interface.
|
||||
*/
|
||||
export interface InteropObservable<T> {
|
||||
[Symbol.observable]: () => Subscribable<T>;
|
||||
}
|
||||
|
||||
/** NOTIFICATIONS */
|
||||
|
||||
/**
|
||||
* A notification representing a "next" from an observable.
|
||||
* Can be used with {@link dematerialize}.
|
||||
*/
|
||||
export interface NextNotification<T> {
|
||||
/** The kind of notification. Always "N" */
|
||||
kind: 'N';
|
||||
/** The value of the notification. */
|
||||
value: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* A notification representing an "error" from an observable.
|
||||
* Can be used with {@link dematerialize}.
|
||||
*/
|
||||
export interface ErrorNotification {
|
||||
/** The kind of notification. Always "E" */
|
||||
kind: 'E';
|
||||
error: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* A notification representing a "completion" from an observable.
|
||||
* Can be used with {@link dematerialize}.
|
||||
*/
|
||||
export interface CompleteNotification {
|
||||
kind: 'C';
|
||||
}
|
||||
|
||||
/**
|
||||
* Valid observable notification types.
|
||||
*/
|
||||
export type ObservableNotification<T> = NextNotification<T> | ErrorNotification | CompleteNotification;
|
||||
|
||||
/** OBSERVER INTERFACES */
|
||||
|
||||
export interface NextObserver<T> {
|
||||
closed?: boolean;
|
||||
next: (value: T) => void;
|
||||
error?: (err: any) => void;
|
||||
complete?: () => void;
|
||||
}
|
||||
|
||||
export interface ErrorObserver<T> {
|
||||
closed?: boolean;
|
||||
next?: (value: T) => void;
|
||||
error: (err: any) => void;
|
||||
complete?: () => void;
|
||||
}
|
||||
|
||||
export interface CompletionObserver<T> {
|
||||
closed?: boolean;
|
||||
next?: (value: T) => void;
|
||||
error?: (err: any) => void;
|
||||
complete: () => void;
|
||||
}
|
||||
|
||||
export type PartialObserver<T> = NextObserver<T> | ErrorObserver<T> | CompletionObserver<T>;
|
||||
|
||||
export interface Observer<T> {
|
||||
next: (value: T) => void;
|
||||
error: (err: any) => void;
|
||||
complete: () => void;
|
||||
}
|
||||
|
||||
export interface SubjectLike<T> extends Observer<T>, Subscribable<T> {}
|
||||
|
||||
/** SCHEDULER INTERFACES */
|
||||
|
||||
export interface SchedulerLike extends TimestampProvider {
|
||||
schedule<T>(work: (this: SchedulerAction<T>, state: T) => void, delay: number, state: T): Subscription;
|
||||
schedule<T>(work: (this: SchedulerAction<T>, state?: T) => void, delay: number, state?: T): Subscription;
|
||||
schedule<T>(work: (this: SchedulerAction<T>, state?: T) => void, delay?: number, state?: T): Subscription;
|
||||
}
|
||||
|
||||
export interface SchedulerAction<T> extends Subscription {
|
||||
schedule(state?: T, delay?: number): Subscription;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a type that provides a method to allow RxJS to create a numeric timestamp
|
||||
*/
|
||||
export interface TimestampProvider {
|
||||
/**
|
||||
* Returns a timestamp as a number.
|
||||
*
|
||||
* This is used by types like `ReplaySubject` or operators like `timestamp` to calculate
|
||||
* the amount of time passed between events.
|
||||
*/
|
||||
now(): number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the type from an `ObservableInput<any>`. If you have
|
||||
* `O extends ObservableInput<any>` and you pass in `Observable<number>`, or
|
||||
* `Promise<number>`, etc, it will type as `number`.
|
||||
*/
|
||||
export type ObservedValueOf<O> = O extends ObservableInput<infer T> ? T : never;
|
||||
|
||||
/**
|
||||
* Extracts a union of element types from an `ObservableInput<any>[]`.
|
||||
* If you have `O extends ObservableInput<any>[]` and you pass in
|
||||
* `Observable<string>[]` or `Promise<string>[]` you would get
|
||||
* back a type of `string`.
|
||||
* If you pass in `[Observable<string>, Observable<number>]` you would
|
||||
* get back a type of `string | number`.
|
||||
*/
|
||||
export type ObservedValueUnionFromArray<X> = X extends Array<ObservableInput<infer T>> ? T : never;
|
||||
|
||||
/**
|
||||
* @deprecated Renamed to {@link ObservedValueUnionFromArray}. Will be removed in v8.
|
||||
*/
|
||||
export type ObservedValuesFromArray<X> = ObservedValueUnionFromArray<X>;
|
||||
|
||||
/**
|
||||
* Extracts a tuple of element types from an `ObservableInput<any>[]`.
|
||||
* If you have `O extends ObservableInput<any>[]` and you pass in
|
||||
* `[Observable<string>, Observable<number>]` you would get back a type
|
||||
* of `[string, number]`.
|
||||
*/
|
||||
export type ObservedValueTupleFromArray<X> = { [K in keyof X]: ObservedValueOf<X[K]> };
|
||||
|
||||
/**
|
||||
* Used to infer types from arguments to functions like {@link forkJoin}.
|
||||
* So that you can have `forkJoin([Observable<A>, PromiseLike<B>]): Observable<[A, B]>`
|
||||
* et al.
|
||||
*/
|
||||
export type ObservableInputTuple<T> = {
|
||||
[K in keyof T]: ObservableInput<T[K]>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs a new tuple with the specified type at the head.
|
||||
* If you declare `Cons<A, [B, C]>` you will get back `[A, B, C]`.
|
||||
*/
|
||||
export type Cons<X, Y extends readonly any[]> = ((arg: X, ...rest: Y) => any) extends (...args: infer U) => any ? U : never;
|
||||
|
||||
/**
|
||||
* Extracts the head of a tuple.
|
||||
* If you declare `Head<[A, B, C]>` you will get back `A`.
|
||||
*/
|
||||
export type Head<X extends readonly any[]> = ((...args: X) => any) extends (arg: infer U, ...rest: any[]) => any ? U : never;
|
||||
|
||||
/**
|
||||
* Extracts the tail of a tuple.
|
||||
* If you declare `Tail<[A, B, C]>` you will get back `[B, C]`.
|
||||
*/
|
||||
export type Tail<X extends readonly any[]> = ((...args: X) => any) extends (arg: any, ...rest: infer U) => any ? U : never;
|
||||
|
||||
/**
|
||||
* Extracts the generic value from an Array type.
|
||||
* If you have `T extends Array<any>`, and pass a `string[]` to it,
|
||||
* `ValueFromArray<T>` will return the actual type of `string`.
|
||||
*/
|
||||
export type ValueFromArray<A extends readonly unknown[]> = A extends Array<infer T> ? T : never;
|
||||
|
||||
/**
|
||||
* Gets the value type from an {@link ObservableNotification}, if possible.
|
||||
*/
|
||||
export type ValueFromNotification<T> = T extends { kind: 'N' | 'E' | 'C' }
|
||||
? T extends NextNotification<any>
|
||||
? T extends { value: infer V }
|
||||
? V
|
||||
: undefined
|
||||
: never
|
||||
: never;
|
||||
|
||||
/**
|
||||
* A simple type to represent a gamut of "falsy" values... with a notable exception:
|
||||
* `NaN` is "falsy" however, it is not and cannot be typed via TypeScript. See
|
||||
* comments here: https://github.com/microsoft/TypeScript/issues/28682#issuecomment-707142417
|
||||
*/
|
||||
export type Falsy = null | undefined | false | 0 | -0 | 0n | '';
|
||||
|
||||
export type TruthyTypesOf<T> = T extends Falsy ? never : T;
|
||||
|
||||
// We shouldn't rely on this type definition being available globally yet since it's
|
||||
// not necessarily available in every TS environment.
|
||||
interface ReadableStreamDefaultReaderLike<T> {
|
||||
// HACK: As of TS 4.2.2, The provided types for the iterator results of a `ReadableStreamDefaultReader`
|
||||
// are significantly different enough from `IteratorResult` as to cause compilation errors.
|
||||
// The type at the time is `ReadableStreamDefaultReadResult`.
|
||||
read(): PromiseLike<
|
||||
| {
|
||||
done: false;
|
||||
value: T;
|
||||
}
|
||||
| { done: true; value?: undefined }
|
||||
>;
|
||||
releaseLock(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* The base signature RxJS will look for to identify and use
|
||||
* a [ReadableStream](https://streams.spec.whatwg.org/#rs-class)
|
||||
* as an {@link ObservableInput} source.
|
||||
*/
|
||||
export interface ReadableStreamLike<T> {
|
||||
getReader(): ReadableStreamDefaultReaderLike<T>;
|
||||
}
|
||||
|
||||
/**
|
||||
* An observable with a `connect` method that is used to create a subscription
|
||||
* to an underlying source, connecting it with all consumers via a multicast.
|
||||
*/
|
||||
export interface Connectable<T> extends Observable<T> {
|
||||
/**
|
||||
* (Idempotent) Calling this method will connect the underlying source observable to all subscribed consumers
|
||||
* through an underlying {@link Subject}.
|
||||
* @returns A subscription, that when unsubscribed, will "disconnect" the source from the connector subject,
|
||||
* severing notifications to all consumers.
|
||||
*/
|
||||
connect(): Subscription;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
if(typeof cptable === 'undefined') cptable = {};
|
||||
cptable[10017] = (function(){ var d = "¤¤\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "wordwrap",
|
||||
"description": "Wrap those words. Show them at what columns to start and stop.",
|
||||
"version": "1.0.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/substack/node-wordwrap.git"
|
||||
},
|
||||
"main": "./index.js",
|
||||
"keywords": [
|
||||
"word",
|
||||
"wrap",
|
||||
"rule",
|
||||
"format",
|
||||
"column"
|
||||
],
|
||||
"directories": {
|
||||
"lib": ".",
|
||||
"example": "example",
|
||||
"test": "test"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "expresso"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tape": "^4.0.0"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
"name": "James Halliday",
|
||||
"email": "mail@substack.net",
|
||||
"url": "http://substack.net"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
var baseIteratee = require('./_baseIteratee'),
|
||||
baseSortedIndexBy = require('./_baseSortedIndexBy');
|
||||
|
||||
/**
|
||||
* This method is like `_.sortedIndex` except that it accepts `iteratee`
|
||||
* which is invoked for `value` and each element of `array` to compute their
|
||||
* sort ranking. The iteratee is invoked with one argument: (value).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Array
|
||||
* @param {Array} array The sorted array to inspect.
|
||||
* @param {*} value The value to evaluate.
|
||||
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
|
||||
* @returns {number} Returns the index at which `value` should be inserted
|
||||
* into `array`.
|
||||
* @example
|
||||
*
|
||||
* var objects = [{ 'x': 4 }, { 'x': 5 }];
|
||||
*
|
||||
* _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
|
||||
* // => 0
|
||||
*
|
||||
* // The `_.property` iteratee shorthand.
|
||||
* _.sortedIndexBy(objects, { 'x': 4 }, 'x');
|
||||
* // => 0
|
||||
*/
|
||||
function sortedIndexBy(array, value, iteratee) {
|
||||
return baseSortedIndexBy(array, value, baseIteratee(iteratee, 2));
|
||||
}
|
||||
|
||||
module.exports = sortedIndexBy;
|
||||
@@ -0,0 +1,68 @@
|
||||
import type { CreateScan } from '../models/CreateScan';
|
||||
import type { CreateTrackScan } from '../models/CreateTrackScan';
|
||||
import type { ResponseEmpty } from '../models/ResponseEmpty';
|
||||
import type { ResponseScan } from '../models/ResponseScan';
|
||||
import type { ResponseTrackScan } from '../models/ResponseTrackScan';
|
||||
import type { UpdateScan } from '../models/UpdateScan';
|
||||
import type { UpdateTrackScan } from '../models/UpdateTrackScan';
|
||||
export declare class ScanService {
|
||||
/**
|
||||
* Get all
|
||||
* Lists all scans (normal or track) from all runners. <br> This includes the scan's runner's distance ran.
|
||||
* @result any
|
||||
* @throws ApiError
|
||||
*/
|
||||
static scanControllerGetAll(): Promise<(Array<ResponseScan> | Array<ResponseTrackScan>)>;
|
||||
/**
|
||||
* Post
|
||||
* Create a new scan (not track scan - use /scans/trackscans instead). <br> Please rmemember to provide the scan's runner's id and distance.
|
||||
* @param requestBody CreateScan
|
||||
* @result ResponseScan
|
||||
* @throws ApiError
|
||||
*/
|
||||
static scanControllerPost(requestBody?: CreateScan): Promise<ResponseScan>;
|
||||
/**
|
||||
* Get one
|
||||
* Lists all information about the scan whose id got provided. This includes the scan's runner's distance ran.
|
||||
* @param id
|
||||
* @result any
|
||||
* @throws ApiError
|
||||
*/
|
||||
static scanControllerGetOne(id: number): Promise<(ResponseScan | ResponseTrackScan)>;
|
||||
/**
|
||||
* Put
|
||||
* Update the scan (not track scan use /scans/trackscans/:id instead) whose id you provided. <br> Please remember that ids can't be changed and distances must be positive.
|
||||
* @param id
|
||||
* @param requestBody UpdateScan
|
||||
* @result ResponseScan
|
||||
* @throws ApiError
|
||||
*/
|
||||
static scanControllerPut(id: number, requestBody?: UpdateScan): Promise<ResponseScan>;
|
||||
/**
|
||||
* Remove
|
||||
* Delete the scan whose id you provided. <br> If no scan with this id exists it will just return 204(no content).
|
||||
* @param id
|
||||
* @param force
|
||||
* @result ResponseScan
|
||||
* @result ResponseEmpty
|
||||
* @throws ApiError
|
||||
*/
|
||||
static scanControllerRemove(id: number, force?: boolean): Promise<ResponseScan | ResponseEmpty>;
|
||||
/**
|
||||
* Post track scans
|
||||
* Create a new track scan (for "normal" scans use /scans instead). <br> Please remember that to provide the scan's card's station's id.
|
||||
* @param requestBody CreateTrackScan
|
||||
* @result ResponseTrackScan
|
||||
* @throws ApiError
|
||||
*/
|
||||
static scanControllerPostTrackScans(requestBody?: CreateTrackScan): Promise<ResponseTrackScan>;
|
||||
/**
|
||||
* Put track scan
|
||||
* Update the track scan (not "normal" scan use /scans/trackscans/:id instead) whose id you provided. <br> Please remember that only the validity, runner and track can be changed.
|
||||
* @param id
|
||||
* @param requestBody UpdateTrackScan
|
||||
* @result ResponseTrackScan
|
||||
* @throws ApiError
|
||||
*/
|
||||
static scanControllerPutTrackScan(id: number, requestBody?: UpdateTrackScan): Promise<ResponseTrackScan>;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export default function getCallback() {
|
||||
if (
|
||||
arguments.length &&
|
||||
typeof arguments[arguments.length - 1] === 'function'
|
||||
) {
|
||||
return arguments[arguments.length - 1];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
// @ts-check
|
||||
/**
|
||||
* We must remap all the old bits to new bits for each set variant
|
||||
* Only arbitrary variants are considered as those are the only
|
||||
* ones that need to be re-sorted at this time
|
||||
*
|
||||
* An iterated process that removes and sets individual bits simultaneously
|
||||
* will not work because we may have a new bit that is also a later old bit
|
||||
* This means that we would be removing a previously set bit which we don't
|
||||
* want to do
|
||||
*
|
||||
* For example (assume `bN` = `1<<N`)
|
||||
* Given the "total" mapping `[[b1, b3], [b2, b4], [b3, b1], [b4, b2]]`
|
||||
* The mapping is "total" because:
|
||||
* 1. Every input and output is accounted for
|
||||
* 2. All combinations are unique
|
||||
* 3. No one input maps to multiple outputs and vice versa
|
||||
* And, given an offset with all bits set:
|
||||
* V = b1 | b2 | b3 | b4
|
||||
*
|
||||
* Let's explore the issue with removing and setting bits simultaneously:
|
||||
* V & ~b1 | b3 = b2 | b3 | b4
|
||||
* V & ~b2 | b4 = b3 | b4
|
||||
* V & ~b3 | b1 = b1 | b4
|
||||
* V & ~b4 | b2 = b1 | b2
|
||||
*
|
||||
* As you can see, we end up with the wrong result.
|
||||
* This is because we're removing a bit that was previously set.
|
||||
* And, thus the final result is missing b3 and b4.
|
||||
*
|
||||
* Now, let's explore the issue with removing the bits first:
|
||||
* V & ~b1 = b2 | b3 | b4
|
||||
* V & ~b2 = b3 | b4
|
||||
* V & ~b3 = b4
|
||||
* V & ~b4 = 0
|
||||
*
|
||||
* And then setting the bits:
|
||||
* V | b3 = b3
|
||||
* V | b4 = b3 | b4
|
||||
* V | b1 = b1 | b3 | b4
|
||||
* V | b2 = b1 | b2 | b3 | b4
|
||||
*
|
||||
* We get the correct result because we're not removing any bits that were
|
||||
* previously set thus properly remapping the bits to the new order
|
||||
*
|
||||
* To collect this into a single operation that can be done simultaneously
|
||||
* we must first create a mask for the old bits that are set and a mask for
|
||||
* the new bits that are set. Then we can remove the old bits and set the new
|
||||
* bits simultaneously in a "single" operation like so:
|
||||
* OldMask = b1 | b2 | b3 | b4
|
||||
* NewMask = b3 | b4 | b1 | b2
|
||||
*
|
||||
* So this:
|
||||
* V & ~oldMask | newMask
|
||||
*
|
||||
* Expands to this:
|
||||
* V & ~b1 & ~b2 & ~b3 & ~b4 | b3 | b4 | b1 | b2
|
||||
*
|
||||
* Which becomes this:
|
||||
* b1 | b2 | b3 | b4
|
||||
*
|
||||
* Which is the correct result!
|
||||
*
|
||||
* @param {bigint} num
|
||||
* @param {[bigint, bigint][]} mapping
|
||||
*/ "use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "remapBitfield", {
|
||||
enumerable: true,
|
||||
get: ()=>remapBitfield
|
||||
});
|
||||
function remapBitfield(num, mapping) {
|
||||
// Create masks for the old and new bits that are set
|
||||
let oldMask = 0n;
|
||||
let newMask = 0n;
|
||||
for (let [oldBit, newBit] of mapping){
|
||||
if (num & oldBit) {
|
||||
oldMask = oldMask | oldBit;
|
||||
newMask = newMask | newBit;
|
||||
}
|
||||
}
|
||||
// Remove all old bits
|
||||
// Set all new bits
|
||||
return num & ~oldMask | newMask;
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isIdentifierChar = isIdentifierChar;
|
||||
exports.isIdentifierName = isIdentifierName;
|
||||
exports.isIdentifierStart = isIdentifierStart;
|
||||
let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
|
||||
let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
|
||||
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
||||
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
||||
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
||||
const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191];
|
||||
const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
||||
|
||||
function isInAstralSet(code, set) {
|
||||
let pos = 0x10000;
|
||||
|
||||
for (let i = 0, length = set.length; i < length; i += 2) {
|
||||
pos += set[i];
|
||||
if (pos > code) return false;
|
||||
pos += set[i + 1];
|
||||
if (pos >= code) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function isIdentifierStart(code) {
|
||||
if (code < 65) return code === 36;
|
||||
if (code <= 90) return true;
|
||||
if (code < 97) return code === 95;
|
||||
if (code <= 122) return true;
|
||||
|
||||
if (code <= 0xffff) {
|
||||
return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
|
||||
}
|
||||
|
||||
return isInAstralSet(code, astralIdentifierStartCodes);
|
||||
}
|
||||
|
||||
function isIdentifierChar(code) {
|
||||
if (code < 48) return code === 36;
|
||||
if (code < 58) return true;
|
||||
if (code < 65) return false;
|
||||
if (code <= 90) return true;
|
||||
if (code < 97) return code === 95;
|
||||
if (code <= 122) return true;
|
||||
|
||||
if (code <= 0xffff) {
|
||||
return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
|
||||
}
|
||||
|
||||
return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
|
||||
}
|
||||
|
||||
function isIdentifierName(name) {
|
||||
let isFirst = true;
|
||||
|
||||
for (let i = 0; i < name.length; i++) {
|
||||
let cp = name.charCodeAt(i);
|
||||
|
||||
if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
|
||||
const trail = name.charCodeAt(++i);
|
||||
|
||||
if ((trail & 0xfc00) === 0xdc00) {
|
||||
cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
|
||||
}
|
||||
}
|
||||
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
|
||||
if (!isIdentifierStart(cp)) {
|
||||
return false;
|
||||
}
|
||||
} else if (!isIdentifierChar(cp)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return !isFirst;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=identifier.js.map
|
||||
@@ -0,0 +1,217 @@
|
||||
"use strict";
|
||||
var Buffer = require("buffer").Buffer;
|
||||
// Note: not polyfilled with safer-buffer on a purpose, as overrides Buffer
|
||||
|
||||
// == Extend Node primitives to use iconv-lite =================================
|
||||
|
||||
module.exports = function (iconv) {
|
||||
var original = undefined; // Place to keep original methods.
|
||||
|
||||
// Node authors rewrote Buffer internals to make it compatible with
|
||||
// Uint8Array and we cannot patch key functions since then.
|
||||
// Note: this does use older Buffer API on a purpose
|
||||
iconv.supportsNodeEncodingsExtension = !(Buffer.from || new Buffer(0) instanceof Uint8Array);
|
||||
|
||||
iconv.extendNodeEncodings = function extendNodeEncodings() {
|
||||
if (original) return;
|
||||
original = {};
|
||||
|
||||
if (!iconv.supportsNodeEncodingsExtension) {
|
||||
console.error("ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node");
|
||||
console.error("See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility");
|
||||
return;
|
||||
}
|
||||
|
||||
var nodeNativeEncodings = {
|
||||
'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true,
|
||||
'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true,
|
||||
};
|
||||
|
||||
Buffer.isNativeEncoding = function(enc) {
|
||||
return enc && nodeNativeEncodings[enc.toLowerCase()];
|
||||
}
|
||||
|
||||
// -- SlowBuffer -----------------------------------------------------------
|
||||
var SlowBuffer = require('buffer').SlowBuffer;
|
||||
|
||||
original.SlowBufferToString = SlowBuffer.prototype.toString;
|
||||
SlowBuffer.prototype.toString = function(encoding, start, end) {
|
||||
encoding = String(encoding || 'utf8').toLowerCase();
|
||||
|
||||
// Use native conversion when possible
|
||||
if (Buffer.isNativeEncoding(encoding))
|
||||
return original.SlowBufferToString.call(this, encoding, start, end);
|
||||
|
||||
// Otherwise, use our decoding method.
|
||||
if (typeof start == 'undefined') start = 0;
|
||||
if (typeof end == 'undefined') end = this.length;
|
||||
return iconv.decode(this.slice(start, end), encoding);
|
||||
}
|
||||
|
||||
original.SlowBufferWrite = SlowBuffer.prototype.write;
|
||||
SlowBuffer.prototype.write = function(string, offset, length, encoding) {
|
||||
// Support both (string, offset, length, encoding)
|
||||
// and the legacy (string, encoding, offset, length)
|
||||
if (isFinite(offset)) {
|
||||
if (!isFinite(length)) {
|
||||
encoding = length;
|
||||
length = undefined;
|
||||
}
|
||||
} else { // legacy
|
||||
var swap = encoding;
|
||||
encoding = offset;
|
||||
offset = length;
|
||||
length = swap;
|
||||
}
|
||||
|
||||
offset = +offset || 0;
|
||||
var remaining = this.length - offset;
|
||||
if (!length) {
|
||||
length = remaining;
|
||||
} else {
|
||||
length = +length;
|
||||
if (length > remaining) {
|
||||
length = remaining;
|
||||
}
|
||||
}
|
||||
encoding = String(encoding || 'utf8').toLowerCase();
|
||||
|
||||
// Use native conversion when possible
|
||||
if (Buffer.isNativeEncoding(encoding))
|
||||
return original.SlowBufferWrite.call(this, string, offset, length, encoding);
|
||||
|
||||
if (string.length > 0 && (length < 0 || offset < 0))
|
||||
throw new RangeError('attempt to write beyond buffer bounds');
|
||||
|
||||
// Otherwise, use our encoding method.
|
||||
var buf = iconv.encode(string, encoding);
|
||||
if (buf.length < length) length = buf.length;
|
||||
buf.copy(this, offset, 0, length);
|
||||
return length;
|
||||
}
|
||||
|
||||
// -- Buffer ---------------------------------------------------------------
|
||||
|
||||
original.BufferIsEncoding = Buffer.isEncoding;
|
||||
Buffer.isEncoding = function(encoding) {
|
||||
return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding);
|
||||
}
|
||||
|
||||
original.BufferByteLength = Buffer.byteLength;
|
||||
Buffer.byteLength = SlowBuffer.byteLength = function(str, encoding) {
|
||||
encoding = String(encoding || 'utf8').toLowerCase();
|
||||
|
||||
// Use native conversion when possible
|
||||
if (Buffer.isNativeEncoding(encoding))
|
||||
return original.BufferByteLength.call(this, str, encoding);
|
||||
|
||||
// Slow, I know, but we don't have a better way yet.
|
||||
return iconv.encode(str, encoding).length;
|
||||
}
|
||||
|
||||
original.BufferToString = Buffer.prototype.toString;
|
||||
Buffer.prototype.toString = function(encoding, start, end) {
|
||||
encoding = String(encoding || 'utf8').toLowerCase();
|
||||
|
||||
// Use native conversion when possible
|
||||
if (Buffer.isNativeEncoding(encoding))
|
||||
return original.BufferToString.call(this, encoding, start, end);
|
||||
|
||||
// Otherwise, use our decoding method.
|
||||
if (typeof start == 'undefined') start = 0;
|
||||
if (typeof end == 'undefined') end = this.length;
|
||||
return iconv.decode(this.slice(start, end), encoding);
|
||||
}
|
||||
|
||||
original.BufferWrite = Buffer.prototype.write;
|
||||
Buffer.prototype.write = function(string, offset, length, encoding) {
|
||||
var _offset = offset, _length = length, _encoding = encoding;
|
||||
// Support both (string, offset, length, encoding)
|
||||
// and the legacy (string, encoding, offset, length)
|
||||
if (isFinite(offset)) {
|
||||
if (!isFinite(length)) {
|
||||
encoding = length;
|
||||
length = undefined;
|
||||
}
|
||||
} else { // legacy
|
||||
var swap = encoding;
|
||||
encoding = offset;
|
||||
offset = length;
|
||||
length = swap;
|
||||
}
|
||||
|
||||
encoding = String(encoding || 'utf8').toLowerCase();
|
||||
|
||||
// Use native conversion when possible
|
||||
if (Buffer.isNativeEncoding(encoding))
|
||||
return original.BufferWrite.call(this, string, _offset, _length, _encoding);
|
||||
|
||||
offset = +offset || 0;
|
||||
var remaining = this.length - offset;
|
||||
if (!length) {
|
||||
length = remaining;
|
||||
} else {
|
||||
length = +length;
|
||||
if (length > remaining) {
|
||||
length = remaining;
|
||||
}
|
||||
}
|
||||
|
||||
if (string.length > 0 && (length < 0 || offset < 0))
|
||||
throw new RangeError('attempt to write beyond buffer bounds');
|
||||
|
||||
// Otherwise, use our encoding method.
|
||||
var buf = iconv.encode(string, encoding);
|
||||
if (buf.length < length) length = buf.length;
|
||||
buf.copy(this, offset, 0, length);
|
||||
return length;
|
||||
|
||||
// TODO: Set _charsWritten.
|
||||
}
|
||||
|
||||
|
||||
// -- Readable -------------------------------------------------------------
|
||||
if (iconv.supportsStreams) {
|
||||
var Readable = require('stream').Readable;
|
||||
|
||||
original.ReadableSetEncoding = Readable.prototype.setEncoding;
|
||||
Readable.prototype.setEncoding = function setEncoding(enc, options) {
|
||||
// Use our own decoder, it has the same interface.
|
||||
// We cannot use original function as it doesn't handle BOM-s.
|
||||
this._readableState.decoder = iconv.getDecoder(enc, options);
|
||||
this._readableState.encoding = enc;
|
||||
}
|
||||
|
||||
Readable.prototype.collect = iconv._collect;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove iconv-lite Node primitive extensions.
|
||||
iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() {
|
||||
if (!iconv.supportsNodeEncodingsExtension)
|
||||
return;
|
||||
if (!original)
|
||||
throw new Error("require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called.")
|
||||
|
||||
delete Buffer.isNativeEncoding;
|
||||
|
||||
var SlowBuffer = require('buffer').SlowBuffer;
|
||||
|
||||
SlowBuffer.prototype.toString = original.SlowBufferToString;
|
||||
SlowBuffer.prototype.write = original.SlowBufferWrite;
|
||||
|
||||
Buffer.isEncoding = original.BufferIsEncoding;
|
||||
Buffer.byteLength = original.BufferByteLength;
|
||||
Buffer.prototype.toString = original.BufferToString;
|
||||
Buffer.prototype.write = original.BufferWrite;
|
||||
|
||||
if (iconv.supportsStreams) {
|
||||
var Readable = require('stream').Readable;
|
||||
|
||||
Readable.prototype.setEncoding = original.ReadableSetEncoding;
|
||||
delete Readable.prototype.collect;
|
||||
}
|
||||
|
||||
original = undefined;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
import { SafeSubscriber, Subscriber } from './Subscriber';
|
||||
import { isSubscription } from './Subscription';
|
||||
import { observable as Symbol_observable } from './symbol/observable';
|
||||
import { pipeFromArray } from './util/pipe';
|
||||
import { config } from './config';
|
||||
import { isFunction } from './util/isFunction';
|
||||
import { errorContext } from './util/errorContext';
|
||||
var Observable = (function () {
|
||||
function Observable(subscribe) {
|
||||
if (subscribe) {
|
||||
this._subscribe = subscribe;
|
||||
}
|
||||
}
|
||||
Observable.prototype.lift = function (operator) {
|
||||
var observable = new Observable();
|
||||
observable.source = this;
|
||||
observable.operator = operator;
|
||||
return observable;
|
||||
};
|
||||
Observable.prototype.subscribe = function (observerOrNext, error, complete) {
|
||||
var _this = this;
|
||||
var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);
|
||||
errorContext(function () {
|
||||
var _a = _this, operator = _a.operator, source = _a.source;
|
||||
subscriber.add(operator
|
||||
?
|
||||
operator.call(subscriber, source)
|
||||
: source
|
||||
?
|
||||
_this._subscribe(subscriber)
|
||||
:
|
||||
_this._trySubscribe(subscriber));
|
||||
});
|
||||
return subscriber;
|
||||
};
|
||||
Observable.prototype._trySubscribe = function (sink) {
|
||||
try {
|
||||
return this._subscribe(sink);
|
||||
}
|
||||
catch (err) {
|
||||
sink.error(err);
|
||||
}
|
||||
};
|
||||
Observable.prototype.forEach = function (next, promiseCtor) {
|
||||
var _this = this;
|
||||
promiseCtor = getPromiseCtor(promiseCtor);
|
||||
return new promiseCtor(function (resolve, reject) {
|
||||
var subscriber = new SafeSubscriber({
|
||||
next: function (value) {
|
||||
try {
|
||||
next(value);
|
||||
}
|
||||
catch (err) {
|
||||
reject(err);
|
||||
subscriber.unsubscribe();
|
||||
}
|
||||
},
|
||||
error: reject,
|
||||
complete: resolve,
|
||||
});
|
||||
_this.subscribe(subscriber);
|
||||
});
|
||||
};
|
||||
Observable.prototype._subscribe = function (subscriber) {
|
||||
var _a;
|
||||
return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
|
||||
};
|
||||
Observable.prototype[Symbol_observable] = function () {
|
||||
return this;
|
||||
};
|
||||
Observable.prototype.pipe = function () {
|
||||
var operations = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
operations[_i] = arguments[_i];
|
||||
}
|
||||
return pipeFromArray(operations)(this);
|
||||
};
|
||||
Observable.prototype.toPromise = function (promiseCtor) {
|
||||
var _this = this;
|
||||
promiseCtor = getPromiseCtor(promiseCtor);
|
||||
return new promiseCtor(function (resolve, reject) {
|
||||
var value;
|
||||
_this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });
|
||||
});
|
||||
};
|
||||
Observable.create = function (subscribe) {
|
||||
return new Observable(subscribe);
|
||||
};
|
||||
return Observable;
|
||||
}());
|
||||
export { Observable };
|
||||
function getPromiseCtor(promiseCtor) {
|
||||
var _a;
|
||||
return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
|
||||
}
|
||||
function isObserver(value) {
|
||||
return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
|
||||
}
|
||||
function isSubscriber(value) {
|
||||
return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));
|
||||
}
|
||||
//# sourceMappingURL=Observable.js.map
|
||||
@@ -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
|
||||
@@ -0,0 +1,28 @@
|
||||
import { createErrorClass } from './createErrorClass';
|
||||
|
||||
export interface NotFoundError extends Error {}
|
||||
|
||||
export interface NotFoundErrorCtor {
|
||||
/**
|
||||
* @deprecated Internal implementation detail. Do not construct error instances.
|
||||
* Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269
|
||||
*/
|
||||
new (message: string): NotFoundError;
|
||||
}
|
||||
|
||||
/**
|
||||
* An error thrown when a value or values are missing from an
|
||||
* observable sequence.
|
||||
*
|
||||
* @see {@link operators/single}
|
||||
*
|
||||
* @class NotFoundError
|
||||
*/
|
||||
export const NotFoundError: NotFoundErrorCtor = createErrorClass(
|
||||
(_super) =>
|
||||
function NotFoundErrorImpl(this: any, message: string) {
|
||||
_super(this);
|
||||
this.name = 'NotFoundError';
|
||||
this.message = message;
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../../../src/internal/operators/retry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AA4EpD,MAAM,UAAU,KAAK,CAAI,gBAAsC,QAAQ;IACrE,IAAI,MAAmB,CAAC;IACxB,IAAI,aAAa,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;QACtD,MAAM,GAAG,aAAa,CAAC;KACxB;SAAM;QACL,MAAM,GAAG;YACP,KAAK,EAAE,aAAuB;SAC/B,CAAC;KACH;IACD,MAAM,EAAE,KAAK,GAAG,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;IAEnF,OAAO,KAAK,IAAI,CAAC;QACf,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;YAC7B,IAAI,KAAK,GAAG,CAAC,CAAC;YACd,IAAI,QAA6B,CAAC;YAClC,MAAM,iBAAiB,GAAG,GAAG,EAAE;gBAC7B,IAAI,SAAS,GAAG,KAAK,CAAC;gBACtB,QAAQ,GAAG,MAAM,CAAC,SAAS,CACzB,wBAAwB,CACtB,UAAU,EACV,CAAC,KAAK,EAAE,EAAE;oBAER,IAAI,cAAc,EAAE;wBAClB,KAAK,GAAG,CAAC,CAAC;qBACX;oBACD,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACzB,CAAC,EAED,SAAS,EACT,CAAC,GAAG,EAAE,EAAE;oBACN,IAAI,KAAK,EAAE,GAAG,KAAK,EAAE;wBAEnB,MAAM,KAAK,GAAG,GAAG,EAAE;4BACjB,IAAI,QAAQ,EAAE;gCACZ,QAAQ,CAAC,WAAW,EAAE,CAAC;gCACvB,QAAQ,GAAG,IAAI,CAAC;gCAChB,iBAAiB,EAAE,CAAC;6BACrB;iCAAM;gCACL,SAAS,GAAG,IAAI,CAAC;6BAClB;wBACH,CAAC,CAAC;wBAEF,IAAI,KAAK,IAAI,IAAI,EAAE;4BAIjB,MAAM,QAAQ,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;4BACzF,MAAM,kBAAkB,GAAG,wBAAwB,CACjD,UAAU,EACV,GAAG,EAAE;gCAIH,kBAAkB,CAAC,WAAW,EAAE,CAAC;gCACjC,KAAK,EAAE,CAAC;4BACV,CAAC,EACD,GAAG,EAAE;gCAGH,UAAU,CAAC,QAAQ,EAAE,CAAC;4BACxB,CAAC,CACF,CAAC;4BACF,QAAQ,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;yBACxC;6BAAM;4BAEL,KAAK,EAAE,CAAC;yBACT;qBACF;yBAAM;wBAGL,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;qBACvB;gBACH,CAAC,CACF,CACF,CAAC;gBACF,IAAI,SAAS,EAAE;oBACb,QAAQ,CAAC,WAAW,EAAE,CAAC;oBACvB,QAAQ,GAAG,IAAI,CAAC;oBAChB,iBAAiB,EAAE,CAAC;iBACrB;YACH,CAAC,CAAC;YACF,iBAAiB,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;AACT,CAAC"}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { NodeEventHandler } from './fromEvent';
|
||||
export declare function fromEventPattern<T>(addHandler: (handler: NodeEventHandler) => any, removeHandler?: (handler: NodeEventHandler, signal?: any) => void): Observable<T>;
|
||||
export declare function fromEventPattern<T>(addHandler: (handler: NodeEventHandler) => any, removeHandler?: (handler: NodeEventHandler, signal?: any) => void, resultSelector?: (...args: any[]) => T): Observable<T>;
|
||||
//# sourceMappingURL=fromEventPattern.d.ts.map
|
||||
@@ -0,0 +1,87 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "nesting", {
|
||||
enumerable: true,
|
||||
get: ()=>nesting
|
||||
});
|
||||
const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
|
||||
const _postcssNested = /*#__PURE__*/ _interopRequireDefault(require("postcss-nested"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function nesting(opts = _postcssNested.default) {
|
||||
return (root, result)=>{
|
||||
root.walkAtRules("screen", (rule)=>{
|
||||
rule.name = "media";
|
||||
rule.params = `screen(${rule.params})`;
|
||||
});
|
||||
root.walkAtRules("apply", (rule)=>{
|
||||
rule.before(_postcss.default.decl({
|
||||
prop: "__apply",
|
||||
value: rule.params,
|
||||
source: rule.source
|
||||
}));
|
||||
rule.remove();
|
||||
});
|
||||
let plugin = (()=>{
|
||||
var _opts_hasOwnProperty;
|
||||
if (typeof opts === "function" || typeof opts === "object" && (opts === null || opts === void 0 ? void 0 : (_opts_hasOwnProperty = opts.hasOwnProperty) === null || _opts_hasOwnProperty === void 0 ? void 0 : _opts_hasOwnProperty.call(opts, "postcssPlugin"))) {
|
||||
return opts;
|
||||
}
|
||||
if (typeof opts === "string") {
|
||||
return require(opts);
|
||||
}
|
||||
if (Object.keys(opts).length <= 0) {
|
||||
return _postcssNested.default;
|
||||
}
|
||||
throw new Error("tailwindcss/nesting should be loaded with a nesting plugin.");
|
||||
})();
|
||||
(0, _postcss.default)([
|
||||
plugin
|
||||
]).process(root, result.opts).sync();
|
||||
root.walkDecls("__apply", (decl)=>{
|
||||
decl.before(_postcss.default.atRule({
|
||||
name: "apply",
|
||||
params: decl.value,
|
||||
source: decl.source
|
||||
}));
|
||||
decl.remove();
|
||||
});
|
||||
/**
|
||||
* Use a private PostCSS API to remove the "clean" flag from the entire AST.
|
||||
* This is done because running process() on the AST will set the "clean"
|
||||
* flag on all nodes, which we don't want.
|
||||
*
|
||||
* This causes downstream plugins using the visitor API to be skipped.
|
||||
*
|
||||
* This is guarded because the PostCSS API is not public
|
||||
* and may change in future versions of PostCSS.
|
||||
*
|
||||
* See https://github.com/postcss/postcss/issues/1712 for more details
|
||||
*
|
||||
* @param {import('postcss').Node} node
|
||||
*/ function markDirty(node) {
|
||||
if (!("markDirty" in node)) {
|
||||
return;
|
||||
}
|
||||
// Traverse the tree down to the leaf nodes
|
||||
if (node.nodes) {
|
||||
node.nodes.forEach((n)=>markDirty(n));
|
||||
}
|
||||
// If it's a leaf node mark it as dirty
|
||||
// We do this here because marking a node as dirty
|
||||
// will walk up the tree and mark all parents as dirty
|
||||
// resulting in a lot of unnecessary work if we did this
|
||||
// for every single node
|
||||
if (!node.nodes) {
|
||||
node.markDirty();
|
||||
}
|
||||
}
|
||||
markDirty(root);
|
||||
return root;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"min.js","sourceRoot":"","sources":["../../../../src/internal/operators/min.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAgDhD,MAAM,UAAU,GAAG,CAAI,QAAiC;IACtD,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3G,CAAC"}
|
||||
@@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
var hasBigInts = require('has-bigints')();
|
||||
|
||||
if (hasBigInts) {
|
||||
var bigIntValueOf = BigInt.prototype.valueOf;
|
||||
var tryBigInt = function tryBigIntObject(value) {
|
||||
try {
|
||||
bigIntValueOf.call(value);
|
||||
return true;
|
||||
} catch (e) {
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
module.exports = function isBigInt(value) {
|
||||
if (
|
||||
value === null
|
||||
|| typeof value === 'undefined'
|
||||
|| typeof value === 'boolean'
|
||||
|| typeof value === 'string'
|
||||
|| typeof value === 'number'
|
||||
|| typeof value === 'symbol'
|
||||
|| typeof value === 'function'
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
if (typeof value === 'bigint') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return tryBigInt(value);
|
||||
};
|
||||
} else {
|
||||
module.exports = function isBigInt(value) {
|
||||
return false && value;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('takeRight', require('../takeRight'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,25 @@
|
||||
import { UNICODE_EXTENSION_SEQUENCE_REGEX } from './utils';
|
||||
import { BestAvailableLocale } from './BestAvailableLocale';
|
||||
/**
|
||||
* https://tc39.es/ecma402/#sec-lookupmatcher
|
||||
* @param availableLocales
|
||||
* @param requestedLocales
|
||||
* @param getDefaultLocale
|
||||
*/
|
||||
export function LookupMatcher(availableLocales, requestedLocales, getDefaultLocale) {
|
||||
var result = { locale: '' };
|
||||
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
||||
var locale = requestedLocales_1[_i];
|
||||
var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, '');
|
||||
var availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale);
|
||||
if (availableLocale) {
|
||||
result.locale = availableLocale;
|
||||
if (locale !== noExtensionLocale) {
|
||||
result.extension = locale.slice(noExtensionLocale.length + 1, locale.length);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
result.locale = getDefaultLocale();
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "findAtConfigPath", {
|
||||
enumerable: true,
|
||||
get: ()=>findAtConfigPath
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
|
||||
const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function findAtConfigPath(root, result) {
|
||||
let configPath = null;
|
||||
let relativeTo = null;
|
||||
root.walkAtRules("config", (rule)=>{
|
||||
var _rule_source;
|
||||
var _rule_source_input_file, _ref;
|
||||
relativeTo = (_ref = (_rule_source_input_file = (_rule_source = rule.source) === null || _rule_source === void 0 ? void 0 : _rule_source.input.file) !== null && _rule_source_input_file !== void 0 ? _rule_source_input_file : result.opts.from) !== null && _ref !== void 0 ? _ref : null;
|
||||
if (relativeTo === null) {
|
||||
throw rule.error("The `@config` directive cannot be used without setting `from` in your PostCSS config.");
|
||||
}
|
||||
if (configPath) {
|
||||
throw rule.error("Only one `@config` directive is allowed per file.");
|
||||
}
|
||||
let matches = rule.params.match(/(['"])(.*?)\1/);
|
||||
if (!matches) {
|
||||
throw rule.error("A path is required when using the `@config` directive.");
|
||||
}
|
||||
let inputPath = matches[2];
|
||||
if (_path.default.isAbsolute(inputPath)) {
|
||||
throw rule.error("The `@config` directive cannot be used with an absolute path.");
|
||||
}
|
||||
configPath = _path.default.resolve(_path.default.dirname(relativeTo), inputPath);
|
||||
if (!_fs.default.existsSync(configPath)) {
|
||||
throw rule.error(`The config file at "${inputPath}" does not exist. Make sure the path is correct and the file exists.`);
|
||||
}
|
||||
rule.remove();
|
||||
});
|
||||
return configPath ? configPath : null;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist
|
||||
* @param locales
|
||||
*/
|
||||
export declare function CanonicalizeLocaleList(locales?: string | string[]): string[];
|
||||
//# sourceMappingURL=CanonicalizeLocaleList.d.ts.map
|
||||
@@ -0,0 +1,102 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for csv2json/libs/core/parser.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../../index.html">All files</a> / <a href="index.html">csv2json/libs/core</a> parser.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>0/72</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>0/49</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>0/10</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>0/72</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line low'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a></td><td class="line-coverage quiet"><span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span></td><td class="text"><pre class="prettyprint lang-js">Unable to lookup source: /Users/kxiang/work/projects/csv2json/libs/core/parser.js(ENOENT: no such file or directory, open '/Users/kxiang/work/projects/csv2json/libs/core/parser.js')
|
||||
Error: Unable to lookup source: /Users/kxiang/work/projects/csv2json/libs/core/parser.js(ENOENT: no such file or directory, open '/Users/kxiang/work/projects/csv2json/libs/core/parser.js')
|
||||
at Context.defaultSourceLookup [as sourceFinder] (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/context.js:15:15)
|
||||
at Context.getSource (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/context.js:74:17)
|
||||
at Object.annotateSourceCode (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-reports/lib/html/annotator.js:172:38)
|
||||
at HtmlReport.onDetail (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-reports/lib/html/index.js:237:39)
|
||||
at Visitor.(anonymous function) [as onDetail] (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:34:30)
|
||||
at ReportNode.Node.visit (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:123:17)
|
||||
at /Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:116:23
|
||||
at Array.forEach (native)
|
||||
at visitChildren (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:115:32)
|
||||
at ReportNode.Node.visit (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:126:5)</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri May 11 2018 21:36:07 GMT+0100 (IST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../../sorter.js"></script>
|
||||
<script src="../../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"animationFrames.js","sourceRoot":"","sources":["../../../../../src/internal/observable/dom/animationFrames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAuEhF,MAAM,UAAU,eAAe,CAAC,iBAAqC;IACnE,OAAO,iBAAiB,CAAC,CAAC,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC;AAClG,CAAC;AAMD,SAAS,sBAAsB,CAAC,iBAAqC;IACnE,OAAO,IAAI,UAAU,CAAyC,UAAC,UAAU;QAIvE,IAAM,QAAQ,GAAG,iBAAiB,IAAI,4BAA4B,CAAC;QAMnE,IAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC;QAE7B,IAAI,EAAE,GAAG,CAAC,CAAC;QACX,IAAM,GAAG,GAAG;YACV,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;gBACtB,EAAE,GAAG,sBAAsB,CAAC,qBAAqB,CAAC,UAAC,SAAuC;oBACxF,EAAE,GAAG,CAAC,CAAC;oBAQP,IAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC;wBACd,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;wBAC9C,OAAO,EAAE,GAAG,GAAG,KAAK;qBACrB,CAAC,CAAC;oBACH,GAAG,EAAE,CAAC;gBACR,CAAC,CAAC,CAAC;aACJ;QACH,CAAC,CAAC;QAEF,GAAG,EAAE,CAAC;QAEN,OAAO;YACL,IAAI,EAAE,EAAE;gBACN,sBAAsB,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC;aACjD;QACH,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAMD,IAAM,wBAAwB,GAAG,sBAAsB,EAAE,CAAC"}
|
||||
@@ -0,0 +1,22 @@
|
||||
var baseIsMatch = require('./_baseIsMatch'),
|
||||
getMatchData = require('./_getMatchData'),
|
||||
matchesStrictComparable = require('./_matchesStrictComparable');
|
||||
|
||||
/**
|
||||
* The base implementation of `_.matches` which doesn't clone `source`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} source The object of property values to match.
|
||||
* @returns {Function} Returns the new spec function.
|
||||
*/
|
||||
function baseMatches(source) {
|
||||
var matchData = getMatchData(source);
|
||||
if (matchData.length == 1 && matchData[0][2]) {
|
||||
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
|
||||
}
|
||||
return function(object) {
|
||||
return object === source || baseIsMatch(object, source, matchData);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = baseMatches;
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"eastasianwidth","version":"0.2.0","files":{"package.json":{"checkedAt":1678883671316,"integrity":"sha512-GPptjbMSdStRI++1zGvaVSvQbpIFzWeTv2Bjc3Ui2ObDF00mGew/q+wgbZ9phD/5EUCizqwwhUb5MRcdk3GyXw==","mode":420,"size":390},"README.md":{"checkedAt":1678883671316,"integrity":"sha512-Ox0I1WaOzfv5XK/auf6YvGWQ7NtbRFG7N6h9n9pghZqumLYRdRXxs31/BiSwiKdaNsIF/ObH3NCGdWrOZeorPQ==","mode":420,"size":1183},"eastasianwidth.js":{"checkedAt":1678883671317,"integrity":"sha512-OkGhtuVcNizzWVt+bJpNJBpM9KFJXwzizJoskDhNHQ89Oq8DOX9Hwq1e4e4ltogLIKS5HUSTUTwCFmCBTjkLug==","mode":420,"size":12067}}}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../../../../packages/intl-messageformat/src/core.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,KAAK,EAAE,oBAAoB,EAAC,MAAM,oCAAoC,CAAA;AAE9E,OAAO,EAEL,UAAU,EACV,OAAO,EAEP,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EAElB,MAAM,cAAc,CAAA;AAsCrB,MAAM,WAAW,OAAO;IACtB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAwCD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAwB;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAC3C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAa;IAC5C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAI9B;gBAEC,OAAO,EAAE,MAAM,GAAG,oBAAoB,EAAE,EACxC,OAAO,GAAE,MAAM,GAAG,MAAM,EAAoC,EAC5D,eAAe,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,EAClC,IAAI,CAAC,EAAE,OAAO;IAkChB,MAAM,yJAyBL;IACD,aAAa,6IAWV;IACH,eAAe;;MAEb;IACF,MAAM,+BAAiB;IACvB,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAsB;IAE1D,MAAM,KAAK,aAAa,WAOvB;IACD,MAAM,CAAC,aAAa,YAAa,MAAM,GAAG,MAAM,EAAE,KAAG,KAAK,MAAM,CAO/D;IACD,MAAM,CAAC,OAAO,EAAE,OAAO,KAAK,GAAG,SAAS,CAAQ;IAIhD,MAAM,CAAC,OAAO,EAAE,OAAO,CAmEtB;CACF"}
|
||||
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
|
||||
var $replace = callBound('String.prototype.replace');
|
||||
|
||||
var RequireObjectCoercible = require('./RequireObjectCoercible');
|
||||
var ToString = require('./ToString');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://262.ecma-international.org/6.0/#sec-createhtml
|
||||
|
||||
module.exports = function CreateHTML(string, tag, attribute, value) {
|
||||
if (Type(tag) !== 'String' || Type(attribute) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings');
|
||||
}
|
||||
var str = RequireObjectCoercible(string);
|
||||
var S = ToString(str);
|
||||
var p1 = '<' + tag;
|
||||
if (attribute !== '') {
|
||||
var V = ToString(value);
|
||||
var escapedV = $replace(V, /\x22/g, '"');
|
||||
p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22';
|
||||
}
|
||||
return p1 + '>' + S + '</' + tag + '>';
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
"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")
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"restore-cursor","version":"4.0.0","files":{"license":{"checkedAt":1678883669302,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"index.js":{"checkedAt":1678883671090,"integrity":"sha512-Mx34dORB+/6Grguxqb3Jl25D5Rs0KhomE/OQ3dUpHnwPYZq+P7il6BqoUq6gS9pNCANaR8GBmetU62cxlKim4Q==","mode":420,"size":263},"package.json":{"checkedAt":1678883671090,"integrity":"sha512-JbYv0XVGEDw8Hwhgtx6HnfSPkdbPRCxhV3j1/JoMFGotcFHRwwMyMsy33cRWV0JKBMasvh36K9RXFznVKGpMPQ==","mode":420,"size":933},"readme.md":{"checkedAt":1678883671090,"integrity":"sha512-pYXSUVtsAcCKnDCqPdLy9pCxu6E37JjoaaJo98B16YVyKZK0K6BtlqOLS0Hfo5btMASdhboxThMmpwXFMMoklA==","mode":420,"size":735},"index.d.ts":{"checkedAt":1678883671090,"integrity":"sha512-O9i8xkeepnzqJnHt3+hHIF6/91eWJaOidFduHV40nPjbxGDJRLvTpA6oAxQ5vWKSb3DJNU4qQ4nKi4B7g0dw5w==","mode":420,"size":177}}}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ignoreElements.js","sourceRoot":"","sources":["../../../../src/internal/operators/ignoreElements.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAqCpC,MAAM,UAAU,cAAc;IAC5B,OAAO,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACpC,MAAM,CAAC,SAAS,CAAC,wBAAwB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"min-indent","version":"1.0.1","files":{"license":{"checkedAt":1678883673455,"integrity":"sha512-Dixy1DFiVQqV2YpQtZ3yxRbkG0oTlkmA+j+Fi1bXYJ8emtEBnpqTcDHXD7D1FWgYC5YbjC01lTYzG4ZGObgsGA==","mode":420,"size":1173},"index.js":{"checkedAt":1678883673455,"integrity":"sha512-jYhF4S2tcGK49aX/O2U7hNVojOPz0nMUrdGwXVw9182l8I/pjxCNrQmCk62PrzJrNpDRB/5b9W68MBoLzZeT1A==","mode":420,"size":191},"package.json":{"checkedAt":1678883673455,"integrity":"sha512-CFeELX4uOkhPjH1KTWMgPAU9UpaIenahNSzr3xoHspGqJTBCtLyobi1aAXTY0v4P5WuvHbSKBdAumbMJLl7OOw==","mode":420,"size":679},"readme.md":{"checkedAt":1678883673455,"integrity":"sha512-zuUVHPV9Q61maDLCkXZxrLqXY60vsFuX0oK/Z+TW8orjt3FC8m8TSSON8/qauxDMEitQR1VszhOfw4EvjoYu9w==","mode":420,"size":926}}}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{D:{"1":"Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","33":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X"},L:{"1":"H"},B:{"1":"Y Z a b c d e i j k l m n o p q r s t u f H","33":"C K L G M N O P Q R S T U V W X"},C:{"1":"wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R EC FC"},M:{"1":"H"},A:{"2":"J D E F CC","33":"A B"},F:{"1":"mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"F B C PC QC RC SC qB AC TC rB","33":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB"},K:{"1":"h","2":"A B C qB AC rB"},E:{"1":"G MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"OC","33":"I v J D E F A B C K L HC zB IC JC KC LC 0B qB rB 1B"},G:{"1":"mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","33":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC"},P:{"1":"g 5C sB 6C 7C 8C","33":"I wC xC yC zC 0C 0B 1C 2C 3C 4C"},I:{"1":"f","2":"tB I pC qC rC sC BC","33":"tC uC"}},B:6,C:"::file-selector-button CSS pseudo-element"};
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').find;
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"@formatjs/icu-skeleton-parser","version":"1.3.6","files":{"LICENSE.md":{"checkedAt":1678883668770,"integrity":"sha512-yk2UNYv66P09cmrZfyyPP55PUfEg0xPWmRDhfrdw/jfa6koIQxk7tEwAgbA67F+p2th8eepIbNnFU8q+nEhnYQ==","mode":493,"size":1065},"date-time.js":{"checkedAt":1678883668809,"integrity":"sha512-nARp3cRS8XM2iyPdXc2Vf6QI9Ok+s+5rXGwPum6bVVdtxpuOkNxCjw2OqogSOGnVmmEMSQdz4boRLmXyns9S0A==","mode":493,"size":5051},"lib/date-time.js":{"checkedAt":1678883668809,"integrity":"sha512-0anHv+q8zYnsZgXJpFGM84b7LxUMwgOPiZwiih1+IFVOfUdrL233PQcn8uijfVU0+wqC8iZOtYxxNO7MD31DLg==","mode":493,"size":4886},"index.js":{"checkedAt":1678883668809,"integrity":"sha512-IMQlU9RHj/2PKaO6ftYT/MWW7vzjIIYfbA7JKV+MJN/dW2AoXlZOveO2U3LKQTJPOJkHP1Il18cDzqngfPuIRg==","mode":493,"size":226},"lib/index.js":{"checkedAt":1678883668809,"integrity":"sha512-pxhfBiltViYEknt1oDKK2ob0ePndXiLdBq255X0jsL3iAc6Ub79/zLImnd6BpHk0HkF5EcXHpbd30NbzmJE5dQ==","mode":493,"size":55},"lib/number.js":{"checkedAt":1678883668814,"integrity":"sha512-Yk8Oz7hz9la/IMt4RlER3VjLyGgdXxL5qrNFa+K47GSa7wlzSbFjYvos7gZCqfpfTiRrN3IgWgkxHMBWjbNchg==","mode":493,"size":11141},"number.js":{"checkedAt":1678883668818,"integrity":"sha512-s+SJ5gwRPTSSoRCQwSYiNu+e/syWiQtQWQvlXtnzBMVzjeGtsV6O0rVHUuQaXj4Ox+7u7riSuHIUd9trfYqTrg==","mode":493,"size":11679},"lib/regex.generated.js":{"checkedAt":1678883668818,"integrity":"sha512-8MXAgPvqta54H2oLzzdnmN/aF1L3SSY0YpBzgCYRimNuPGSenPJJRNYhOLDnSQEfMa14XPyqvT1v64LuLSBA2g==","mode":493,"size":104},"regex.generated.js":{"checkedAt":1678883668818,"integrity":"sha512-c0obwTBJU0y7Fi5TG5QH2pc9Ezu2V8xH3MQ97zfmyVBD256CSbXWYKVZPfrxXcaapVI1agqunGUPexafw7CBZA==","mode":493,"size":214},"package.json":{"checkedAt":1678883668818,"integrity":"sha512-OP2u04ZPMWRf9kUgQRtP5bcLdlzakWn5CTX9PHh6J4lNtAyjn69r0TCv01t+U+UCFn/I4fV4X7U+ZKm7meuGmQ==","mode":493,"size":399},"date-time.d.ts.map":{"checkedAt":1678883668818,"integrity":"sha512-tvuVM+pCLP9+SdIG4y3kaLVTZ1d7erGE6l1TelEKE+/ynFp2Abd8QXuCJ040ghEqzN2pGjXFr1LcqQazb/7bQw==","mode":493,"size":231},"lib/date-time.d.ts.map":{"checkedAt":1678883668818,"integrity":"sha512-4OZ+nqhBV+y9WJkTpV90jh0RWzFg27ODs+gHRIeNJFjIxchs49p0/ATJkb7t6xH1MIe9/+mJ4JlpYsmv9fhPDA==","mode":493,"size":234},"index.d.ts.map":{"checkedAt":1678883668818,"integrity":"sha512-zhdl/qmaFW+rNq7UZMBywv+IJNpi1Ra3BSy0Kd6OpoLheSdqSTrxx5B4jOs5o92zg3AkvUtCQBwRm8HHcI6KsQ==","mode":493,"size":181},"lib/index.d.ts.map":{"checkedAt":1678883668818,"integrity":"sha512-U+PT3aM2OBM2P3t1TMAmZXLq8qTKPgx8sJ/+fT8UczTaLhbY97XMfpdDalWunWTiURZnmcPPcGQRoOMDdUjCdA==","mode":493,"size":184},"lib/number.d.ts.map":{"checkedAt":1678883668818,"integrity":"sha512-2+xy6hsFQwLNPOSRjLjNMJz/7enS5eBiWLawKlhbKm7CAUC597zIjmc4H4/zktpHkyBaSsMSzIQuLw7qtdrDkA==","mode":493,"size":487},"number.d.ts.map":{"checkedAt":1678883668818,"integrity":"sha512-4PFX7vEzO7K4aZnUpht2ND9lNZx6L1BCi77RuGc6R3UGiuocuJCP7qIFCd7vCOD6j/wXlsAM+siD9qXFsmXmSg==","mode":493,"size":484},"lib/regex.generated.d.ts.map":{"checkedAt":1678883668818,"integrity":"sha512-aS6lLLYrPBgxuYcXQZrQRNRCB0CO7DQtpTlBGw/WDBwpw2fLHCdw3xbYfNoOhA0Swrffyn71cfnqFPkGU7eaTw==","mode":493,"size":196},"regex.generated.d.ts.map":{"checkedAt":1678883668818,"integrity":"sha512-LVi/aQ8j63/IFv0rmuw1r2ykNBu+AW9yVgaJXXrWBqWXc6rK5Jn8+qX4i6Dv4alI+Hrxg2/aZ4Rdnqx+eNkFTA==","mode":493,"size":193},"README.md":{"checkedAt":1678883668824,"integrity":"sha512-FRJ1bbZYcI8eFZm6RhPjtVMEFbqeTNUHrSeYW9f119IcHoRZS5aBUPb4musyTGt1vSbd6YTG0T/7+MfywDPF5g==","mode":493,"size":22},"date-time.d.ts":{"checkedAt":1678883668824,"integrity":"sha512-QedlbSLxalnSSZe5EfJcMAbxsUAGcJGETilawaVRlgsMvMpmk+nNzmuX0yhTS6YYTpz4EH3LTBQTpycLTW6Gfw==","mode":493,"size":327},"lib/date-time.d.ts":{"checkedAt":1678883668824,"integrity":"sha512-QedlbSLxalnSSZe5EfJcMAbxsUAGcJGETilawaVRlgsMvMpmk+nNzmuX0yhTS6YYTpz4EH3LTBQTpycLTW6Gfw==","mode":493,"size":327},"lib/number.d.ts":{"checkedAt":1678883668825,"integrity":"sha512-0350y+/X1RZ9z2Jc1LEkQwuJwfHhdQL8e/mzs0N8iaJ2omJvFzGareXmPYZAe3Rt+TQwJI42XWjJ4xk1Q2FBgg==","mode":493,"size":616},"number.d.ts":{"checkedAt":1678883668825,"integrity":"sha512-0350y+/X1RZ9z2Jc1LEkQwuJwfHhdQL8e/mzs0N8iaJ2omJvFzGareXmPYZAe3Rt+TQwJI42XWjJ4xk1Q2FBgg==","mode":493,"size":616},"lib/regex.generated.d.ts":{"checkedAt":1678883668825,"integrity":"sha512-wW5fQddPeoardK2SUMxD16VMh4ffdY9n7Lr6pwyYdpwl9XsAxdWNmrvf0jJwVrEtNHyn20dsUl2wEGc/bFtD6g==","mode":493,"size":93},"regex.generated.d.ts":{"checkedAt":1678883668825,"integrity":"sha512-wW5fQddPeoardK2SUMxD16VMh4ffdY9n7Lr6pwyYdpwl9XsAxdWNmrvf0jJwVrEtNHyn20dsUl2wEGc/bFtD6g==","mode":493,"size":93},"index.d.ts":{"checkedAt":1678883668825,"integrity":"sha512-LF9lHNr9SDgs3jkvVxLYrEaxBaBS7PqWwPkVrnrSgTBk4lZ+0jt4LlDV+mUxFQtpgw/jbLKPt1BY9ydjUHiG6Q==","mode":493,"size":90},"lib/index.d.ts":{"checkedAt":1678883668825,"integrity":"sha512-LF9lHNr9SDgs3jkvVxLYrEaxBaBS7PqWwPkVrnrSgTBk4lZ+0jt4LlDV+mUxFQtpgw/jbLKPt1BY9ydjUHiG6Q==","mode":493,"size":90}}}
|
||||
@@ -0,0 +1,35 @@
|
||||
# Contributing to `auto-changelog`
|
||||
|
||||
Installing the library locally is relatively easy:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/CookPete/auto-changelog.git
|
||||
cd auto-changelog
|
||||
yarn # or npm install
|
||||
```
|
||||
|
||||
You can then run it with simply:
|
||||
|
||||
```bash
|
||||
node src/index.js
|
||||
```
|
||||
|
||||
## Linting
|
||||
|
||||
This project uses [standard](https://github.com/feross/standard) code style. Be sure to lint the code after making changes and fix any issues that come up.
|
||||
|
||||
```bash
|
||||
yarn lint # or npm run lint
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
This project uses [mocha](https://github.com/mochajs/mocha) and [chai](https://github.com/chaijs/chai) for testing. Be sure to run tests after making changes and, if you’re feeling generous, add some tests of your own.
|
||||
|
||||
```bash
|
||||
yarn test # or npm test
|
||||
```
|
||||
|
||||
## Becoming a sponsor
|
||||
|
||||
A great way to show your appreciation and get an issue bumped to a higher priority is to [become a sponsor on Patreon](https://www.patreon.com/cookpete).
|
||||
@@ -0,0 +1,64 @@
|
||||
var baseRest = require('./_baseRest'),
|
||||
eq = require('./eq'),
|
||||
isIterateeCall = require('./_isIterateeCall'),
|
||||
keysIn = require('./keysIn');
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Assigns own and inherited enumerable string keyed properties of source
|
||||
* objects to the destination object for all destination properties that
|
||||
* resolve to `undefined`. Source objects are applied from left to right.
|
||||
* Once a property is set, additional values of the same property are ignored.
|
||||
*
|
||||
* **Note:** This method mutates `object`.
|
||||
*
|
||||
* @static
|
||||
* @since 0.1.0
|
||||
* @memberOf _
|
||||
* @category Object
|
||||
* @param {Object} object The destination object.
|
||||
* @param {...Object} [sources] The source objects.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.defaultsDeep
|
||||
* @example
|
||||
*
|
||||
* _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
|
||||
* // => { 'a': 1, 'b': 2 }
|
||||
*/
|
||||
var defaults = baseRest(function(object, sources) {
|
||||
object = Object(object);
|
||||
|
||||
var index = -1;
|
||||
var length = sources.length;
|
||||
var guard = length > 2 ? sources[2] : undefined;
|
||||
|
||||
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
||||
length = 1;
|
||||
}
|
||||
|
||||
while (++index < length) {
|
||||
var source = sources[index];
|
||||
var props = keysIn(source);
|
||||
var propsIndex = -1;
|
||||
var propsLength = props.length;
|
||||
|
||||
while (++propsIndex < propsLength) {
|
||||
var key = props[propsIndex];
|
||||
var value = object[key];
|
||||
|
||||
if (value === undefined ||
|
||||
(eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
|
||||
object[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return object;
|
||||
});
|
||||
|
||||
module.exports = defaults;
|
||||
Reference in New Issue
Block a user