new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"GetOption.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/GetOption.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,EAC9D,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,QAAQ,GAAG,SAAS,EAC1B,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,SAAS,EAC1B,QAAQ,EAAE,CAAC,GACV,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAqB9B"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"11":0.00517,"34":0.00517,"52":0.02069,"54":0.01552,"59":0.00517,"66":0.01035,"78":0.10863,"81":0.00517,"83":0.00517,"87":0.03104,"91":0.01035,"94":0.04656,"102":0.05173,"103":0.02587,"104":0.00517,"105":0.00517,"106":0.03104,"107":0.04138,"108":0.08794,"109":1.38636,"110":0.96735,"111":0.00517,_:"2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 55 56 57 58 60 61 62 63 64 65 67 68 69 70 71 72 73 74 75 76 77 79 80 82 84 85 86 88 89 90 92 93 95 96 97 98 99 100 101 112 3.5 3.6"},D:{"25":0.02069,"26":0.01035,"34":0.03104,"35":0.0776,"38":0.10863,"47":0.00517,"49":0.03104,"53":0.01035,"56":0.00517,"59":0.02587,"60":0.06725,"65":0.01035,"66":0.04138,"67":0.03104,"68":0.01035,"69":0.26382,"70":0.00517,"72":0.00517,"73":0.00517,"74":0.02069,"75":0.01035,"76":0.02069,"77":0.01035,"78":0.01552,"79":0.12933,"80":0.02587,"81":0.04138,"83":0.03621,"84":0.03621,"85":0.0569,"86":0.11381,"87":0.09829,"88":0.02587,"89":0.01552,"90":0.02069,"91":0.01552,"92":0.03104,"93":0.03621,"94":0.02069,"95":0.03104,"96":0.0569,"97":0.06208,"98":0.04656,"99":0.0569,"100":0.07242,"101":0.10346,"102":0.06725,"103":0.40349,"104":0.15002,"105":0.1914,"106":0.12415,"107":0.34659,"108":1.37602,"109":15.41554,"110":9.94768,"111":0.01035,"112":0.01035,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 27 28 29 30 31 32 33 36 37 39 40 41 42 43 44 45 46 48 50 51 52 54 55 57 58 61 62 63 64 71 113"},F:{"28":0.00517,"46":0.04656,"89":0.01552,"93":0.06725,"94":0.54317,"95":0.23279,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 90 91 92 9.5-9.6 10.5 10.6 11.1 11.5 11.6 12.1","10.0-10.1":0},B:{"17":0.00517,"18":0.01035,"85":0.01035,"92":0.00517,"95":0.00517,"102":0.00517,"103":0.00517,"104":0.01552,"105":0.01552,"106":0.01035,"107":0.0776,"108":0.2483,"109":2.63306,"110":3.67283,_:"12 13 14 15 16 79 80 81 83 84 86 87 88 89 90 91 93 94 96 97 98 99 100 101"},E:{"4":0,"12":0.00517,"13":0.05173,"14":0.23279,"15":0.04656,_:"0 5 6 7 8 9 10 11 3.1 3.2 5.1 6.1 7.1 9.1 10.1 16.4","11.1":0.01552,"12.1":0.07242,"13.1":0.30521,"14.1":0.64663,"15.1":0.11898,"15.2-15.3":0.08794,"15.4":0.21209,"15.5":0.41384,"15.6":2.37441,"16.0":0.19657,"16.1":0.66214,"16.2":2.18301,"16.3":1.29842},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.01005,"6.0-6.1":0.01256,"7.0-7.1":0.01005,"8.1-8.4":0.01256,"9.0-9.2":0.01256,"9.3":0.1457,"10.0-10.2":0.00502,"10.3":0.18087,"11.0-11.2":0.03014,"11.3-11.4":0.07536,"12.0-12.1":0.04019,"12.2-12.5":0.77372,"13.0-13.1":0.01507,"13.2":0.01005,"13.3":0.05527,"13.4-13.7":0.11555,"14.0-14.4":0.32657,"14.5-14.8":0.74608,"15.0-15.1":0.17584,"15.2-15.3":0.23613,"15.4":0.28135,"15.5":0.54763,"15.6":2.3538,"16.0":2.02975,"16.1":6.41832,"16.2":6.28016,"16.3":2.83361,"16.4":0.01005},P:{"4":0.23382,"20":1.12658,"5.0-5.4":0.03188,"6.2-6.4":0.08151,"7.2-7.4":0.01063,"8.2":0.01016,"9.2":0.03097,"10.1":0.01011,"11.1-11.2":0.01063,"12.0":0.02065,"13.0":0.03188,"14.0":0.03188,"15.0":0.02126,"16.0":0.06377,"17.0":0.06377,"18.0":0.09565,"19.0":1.80678},I:{"0":0,"3":0,"4":0.00296,"2.1":0,"2.2":0.00591,"2.3":0.00197,"4.1":0.00296,"4.2-4.3":0.0069,"4.4":0,"4.4.3-4.4.4":0.02758},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"8":0.05272,"9":0.04218,"11":0.17926,_:"6 7 10 5.5"},N:{"10":0.03712,"11":0.07423},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.08206},H:{"0":0.17823},L:{"0":21.15149},R:{_:"0"},M:{"0":0.44408},Q:{"13.1":0.00483}};
|
||||
@@ -0,0 +1,16 @@
|
||||
/*! node-DOMException. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
||||
|
||||
if (!globalThis.DOMException) {
|
||||
const { MessageChannel } = require('worker_threads'),
|
||||
port = new MessageChannel().port1,
|
||||
ab = new ArrayBuffer()
|
||||
try { port.postMessage(ab, [ab, ab]) }
|
||||
catch (err) {
|
||||
console.log(err.code, err.name, err.message)
|
||||
err.constructor.name === 'DOMException' && (
|
||||
globalThis.DOMException = err.constructor
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = globalThis.DOMException
|
||||
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
var SubArray = require("../../_sub-array-dummy-safe");
|
||||
|
||||
module.exports = function () { return new SubArray().slice() instanceof SubArray; };
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('cloneDeep', require('../cloneDeep'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AnimationFrameAction.js","sourceRoot":"","sources":["../../../../src/internal/scheduler/AnimationFrameAction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,6CAA4C;AAG5C,mEAAkE;AAGlE;IAA6C,wCAAc;IACzD,8BAAsB,SAAkC,EAAY,IAAmD;QAAvH,YACE,kBAAM,SAAS,EAAE,IAAI,CAAC,SACvB;QAFqB,eAAS,GAAT,SAAS,CAAyB;QAAY,UAAI,GAAJ,IAAI,CAA+C;;IAEvH,CAAC;IAES,6CAAc,GAAxB,UAAyB,SAAkC,EAAE,EAAgB,EAAE,KAAiB;QAAjB,sBAAA,EAAA,SAAiB;QAE9F,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,GAAG,CAAC,EAAE;YAC/B,OAAO,iBAAM,cAAc,YAAC,SAAS,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;SACnD;QAED,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAI7B,OAAO,SAAS,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,UAAU,GAAG,+CAAsB,CAAC,qBAAqB,CAAC,cAAM,OAAA,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,EAA1B,CAA0B,CAAC,CAAC,CAAC;IACzI,CAAC;IAES,6CAAc,GAAxB,UAAyB,SAAkC,EAAE,EAAgB,EAAE,KAAiB;;QAAjB,sBAAA,EAAA,SAAiB;QAI9F,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE;YAC9C,OAAO,iBAAM,cAAc,YAAC,SAAS,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;SACnD;QAIO,IAAA,OAAO,GAAK,SAAS,QAAd,CAAe;QAC9B,IAAI,EAAE,IAAI,IAAI,IAAI,CAAA,MAAA,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,0CAAE,EAAE,MAAK,EAAE,EAAE;YACxD,+CAAsB,CAAC,oBAAoB,CAAC,EAAY,CAAC,CAAC;YAC1D,SAAS,CAAC,UAAU,GAAG,SAAS,CAAC;SAClC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IACH,2BAAC;AAAD,CAAC,AApCD,CAA6C,yBAAW,GAoCvD;AApCY,oDAAoB"}
|
||||
@@ -0,0 +1,2 @@
|
||||
export declare function flatten<T>(nodes: T[][], target?: T[]): T[];
|
||||
export declare function flatten<T>(nodes: T[], target?: T[]): T[];
|
||||
@@ -0,0 +1,148 @@
|
||||
# normalize-range
|
||||
|
||||
Utility for normalizing a numeric range, with a wrapping function useful for polar coordinates.
|
||||
|
||||
[](https://travis-ci.org/jamestalmage/normalize-range)
|
||||
[](https://coveralls.io/github/jamestalmage/normalize-range?branch=master)
|
||||
[](https://codeclimate.com/github/jamestalmage/normalize-range)
|
||||
[](https://david-dm.org/jamestalmage/normalize-range)
|
||||
[](https://david-dm.org/jamestalmage/normalize-range#info=devDependencies)
|
||||
|
||||
[](https://nodei.co/npm/normalize-range/)
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var nr = require('normalize-range');
|
||||
|
||||
nr.wrap(0, 360, 400);
|
||||
//=> 40
|
||||
|
||||
nr.wrap(0, 360, -90);
|
||||
//=> 270
|
||||
|
||||
nr.limit(0, 100, 500);
|
||||
//=> 100
|
||||
|
||||
nr.limit(0, 100, -20);
|
||||
//=> 0
|
||||
|
||||
// There is a convenient currying function
|
||||
var wrapAngle = nr.curry(0, 360).wrap;
|
||||
var limitTo10 = nr.curry(0, 10).limit;
|
||||
|
||||
wrapAngle(-30);
|
||||
//=> 330
|
||||
```
|
||||
## API
|
||||
|
||||
### wrap(min, max, value)
|
||||
|
||||
Normalizes a values that "wraps around". For example, in a polar coordinate system, 270˚ can also be
|
||||
represented as -90˚.
|
||||
For wrapping purposes we assume `max` is functionally equivalent to `min`, and that `wrap(max + 1) === wrap(min + 1)`.
|
||||
Wrap always assumes that `min` is *inclusive*, and `max` is *exclusive*.
|
||||
In other words, if `value === max` the function will wrap it, and return `min`, but `min` will not be wrapped.
|
||||
|
||||
```js
|
||||
nr.wrap(0, 360, 0) === 0;
|
||||
nr.wrap(0, 360, 360) === 0;
|
||||
nr.wrap(0, 360, 361) === 1;
|
||||
nr.wrap(0, 360, -1) === 359;
|
||||
```
|
||||
|
||||
You are not restricted to whole numbers, and ranges can be negative.
|
||||
|
||||
```js
|
||||
var π = Math.PI;
|
||||
var radianRange = nr.curry(-π, π);
|
||||
|
||||
redianRange.wrap(0) === 0;
|
||||
nr.wrap(π) === -π;
|
||||
nr.wrap(4 * π / 3) === -2 * π / 3;
|
||||
```
|
||||
|
||||
### limit(min, max, value)
|
||||
|
||||
Normalize the value by bringing it within the range.
|
||||
If `value` is greater than `max`, `max` will be returned.
|
||||
If `value` is less than `min`, `min` will be returned.
|
||||
Otherwise, `value` is returned unaltered.
|
||||
Both ends of this range are *inclusive*.
|
||||
|
||||
### test(min, max, value, [minExclusive], [maxExclusive])
|
||||
|
||||
Returns `true` if `value` is within the range, `false` otherwise.
|
||||
It defaults to `inclusive` on both ends of the range, but that can be
|
||||
changed by setting `minExclusive` and/or `maxExclusive` to a truthy value.
|
||||
|
||||
### validate(min, max, value, [minExclusive], [maxExclusive])
|
||||
|
||||
Returns `value` or throws an error if `value` is outside the specified range.
|
||||
|
||||
### name(min, max, value, [minExclusive], [maxExclusive])
|
||||
|
||||
Returns a string representing this range in
|
||||
[range notation](https://en.wikipedia.org/wiki/Interval_(mathematics)#Classification_of_intervals).
|
||||
|
||||
### curry(min, max, [minExclusive], [maxExclusive])
|
||||
|
||||
Convenience method for currying all method arguments except `value`.
|
||||
|
||||
```js
|
||||
var angle = require('normalize-range').curry(-180, 180, false, true);
|
||||
|
||||
angle.wrap(270)
|
||||
//=> -90
|
||||
|
||||
angle.limit(200)
|
||||
//=> 180
|
||||
|
||||
angle.test(0)
|
||||
//=> true
|
||||
|
||||
angle.validate(300)
|
||||
//=> throws an Error
|
||||
|
||||
angle.toString() // or angle.name()
|
||||
//=> "[-180,180)"
|
||||
```
|
||||
|
||||
#### min
|
||||
|
||||
*Required*
|
||||
Type: `number`
|
||||
|
||||
The minimum value (inclusive) of the range.
|
||||
|
||||
#### max
|
||||
|
||||
*Required*
|
||||
Type: `number`
|
||||
|
||||
The maximum value (exclusive) of the range.
|
||||
|
||||
#### value
|
||||
|
||||
*Required*
|
||||
Type: `number`
|
||||
|
||||
The value to be normalized.
|
||||
|
||||
#### returns
|
||||
|
||||
Type: `number`
|
||||
|
||||
The normalized value.
|
||||
|
||||
## Building and Releasing
|
||||
|
||||
- `npm test`: tests, linting, coverage and style checks.
|
||||
- `npm run watch`: autotest mode for active development.
|
||||
- `npm run debug`: run tests without coverage (istanbul can obscure line #'s)
|
||||
|
||||
Release via `cut-release` tool.
|
||||
|
||||
## License
|
||||
|
||||
MIT © [James Talmage](http://github.com/jamestalmage)
|
||||
@@ -0,0 +1,369 @@
|
||||
// Type definitions for source-map 0.7
|
||||
// Project: https://github.com/mozilla/source-map
|
||||
// Definitions by: Morten Houston Ludvigsen <https://github.com/MortenHoustonLudvigsen>,
|
||||
// Ron Buckton <https://github.com/rbuckton>,
|
||||
// John Vilk <https://github.com/jvilk>
|
||||
// Definitions: https://github.com/mozilla/source-map
|
||||
export type SourceMapUrl = string;
|
||||
|
||||
export interface StartOfSourceMap {
|
||||
file?: string;
|
||||
sourceRoot?: string;
|
||||
skipValidation?: boolean;
|
||||
}
|
||||
|
||||
export interface RawSourceMap {
|
||||
version: number;
|
||||
sources: string[];
|
||||
names: string[];
|
||||
sourceRoot?: string;
|
||||
sourcesContent?: string[];
|
||||
mappings: string;
|
||||
file: string;
|
||||
}
|
||||
|
||||
export interface RawIndexMap extends StartOfSourceMap {
|
||||
version: number;
|
||||
sections: RawSection[];
|
||||
}
|
||||
|
||||
export interface RawSection {
|
||||
offset: Position;
|
||||
map: RawSourceMap;
|
||||
}
|
||||
|
||||
export interface Position {
|
||||
line: number;
|
||||
column: number;
|
||||
}
|
||||
|
||||
export interface NullablePosition {
|
||||
line: number | null;
|
||||
column: number | null;
|
||||
lastColumn: number | null;
|
||||
}
|
||||
|
||||
export interface MappedPosition {
|
||||
source: string;
|
||||
line: number;
|
||||
column: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export interface NullableMappedPosition {
|
||||
source: string | null;
|
||||
line: number | null;
|
||||
column: number | null;
|
||||
name: string | null;
|
||||
}
|
||||
|
||||
export interface MappingItem {
|
||||
source: string;
|
||||
generatedLine: number;
|
||||
generatedColumn: number;
|
||||
originalLine: number;
|
||||
originalColumn: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface Mapping {
|
||||
generated: Position;
|
||||
original: Position;
|
||||
source: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export interface CodeWithSourceMap {
|
||||
code: string;
|
||||
map: SourceMapGenerator;
|
||||
}
|
||||
|
||||
export interface SourceMapConsumer {
|
||||
/**
|
||||
* Compute the last column for each generated mapping. The last column is
|
||||
* inclusive.
|
||||
*/
|
||||
computeColumnSpans(): void;
|
||||
|
||||
/**
|
||||
* Returns the original source, line, and column information for the generated
|
||||
* source's line and column positions provided. The only argument is an object
|
||||
* with the following properties:
|
||||
*
|
||||
* - line: The line number in the generated source.
|
||||
* - column: The column number in the generated source.
|
||||
* - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
|
||||
* 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
|
||||
* closest element that is smaller than or greater than the one we are
|
||||
* searching for, respectively, if the exact element cannot be found.
|
||||
* Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
|
||||
*
|
||||
* and an object is returned with the following properties:
|
||||
*
|
||||
* - source: The original source file, or null.
|
||||
* - line: The line number in the original source, or null.
|
||||
* - column: The column number in the original source, or null.
|
||||
* - name: The original identifier, or null.
|
||||
*/
|
||||
originalPositionFor(generatedPosition: Position & { bias?: number }): NullableMappedPosition;
|
||||
|
||||
/**
|
||||
* Returns the generated line and column information for the original source,
|
||||
* line, and column positions provided. The only argument is an object with
|
||||
* the following properties:
|
||||
*
|
||||
* - source: The filename of the original source.
|
||||
* - line: The line number in the original source.
|
||||
* - column: The column number in the original source.
|
||||
* - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
|
||||
* 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
|
||||
* closest element that is smaller than or greater than the one we are
|
||||
* searching for, respectively, if the exact element cannot be found.
|
||||
* Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
|
||||
*
|
||||
* and an object is returned with the following properties:
|
||||
*
|
||||
* - line: The line number in the generated source, or null.
|
||||
* - column: The column number in the generated source, or null.
|
||||
*/
|
||||
generatedPositionFor(originalPosition: MappedPosition & { bias?: number }): NullablePosition;
|
||||
|
||||
/**
|
||||
* Returns all generated line and column information for the original source,
|
||||
* line, and column provided. If no column is provided, returns all mappings
|
||||
* corresponding to a either the line we are searching for or the next
|
||||
* closest line that has any mappings. Otherwise, returns all mappings
|
||||
* corresponding to the given line and either the column we are searching for
|
||||
* or the next closest column that has any offsets.
|
||||
*
|
||||
* The only argument is an object with the following properties:
|
||||
*
|
||||
* - source: The filename of the original source.
|
||||
* - line: The line number in the original source.
|
||||
* - column: Optional. the column number in the original source.
|
||||
*
|
||||
* and an array of objects is returned, each with the following properties:
|
||||
*
|
||||
* - line: The line number in the generated source, or null.
|
||||
* - column: The column number in the generated source, or null.
|
||||
*/
|
||||
allGeneratedPositionsFor(originalPosition: MappedPosition): NullablePosition[];
|
||||
|
||||
/**
|
||||
* Return true if we have the source content for every source in the source
|
||||
* map, false otherwise.
|
||||
*/
|
||||
hasContentsOfAllSources(): boolean;
|
||||
|
||||
/**
|
||||
* Returns the original source content. The only argument is the url of the
|
||||
* original source file. Returns null if no original source content is
|
||||
* available.
|
||||
*/
|
||||
sourceContentFor(source: string, returnNullOnMissing?: boolean): string | null;
|
||||
|
||||
/**
|
||||
* Iterate over each mapping between an original source/line/column and a
|
||||
* generated line/column in this source map.
|
||||
*
|
||||
* @param callback
|
||||
* The function that is called with each mapping.
|
||||
* @param context
|
||||
* Optional. If specified, this object will be the value of `this` every
|
||||
* time that `aCallback` is called.
|
||||
* @param order
|
||||
* Either `SourceMapConsumer.GENERATED_ORDER` or
|
||||
* `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
|
||||
* iterate over the mappings sorted by the generated file's line/column
|
||||
* order or the original's source/line/column order, respectively. Defaults to
|
||||
* `SourceMapConsumer.GENERATED_ORDER`.
|
||||
*/
|
||||
eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
|
||||
/**
|
||||
* Free this source map consumer's associated wasm data that is manually-managed.
|
||||
* Alternatively, you can use SourceMapConsumer.with to avoid needing to remember to call destroy.
|
||||
*/
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
export interface SourceMapConsumerConstructor {
|
||||
prototype: SourceMapConsumer;
|
||||
|
||||
GENERATED_ORDER: number;
|
||||
ORIGINAL_ORDER: number;
|
||||
GREATEST_LOWER_BOUND: number;
|
||||
LEAST_UPPER_BOUND: number;
|
||||
|
||||
new (rawSourceMap: RawSourceMap, sourceMapUrl?: SourceMapUrl): Promise<BasicSourceMapConsumer>;
|
||||
new (rawSourceMap: RawIndexMap, sourceMapUrl?: SourceMapUrl): Promise<IndexedSourceMapConsumer>;
|
||||
new (rawSourceMap: RawSourceMap | RawIndexMap | string, sourceMapUrl?: SourceMapUrl): Promise<BasicSourceMapConsumer | IndexedSourceMapConsumer>;
|
||||
|
||||
/**
|
||||
* Create a BasicSourceMapConsumer from a SourceMapGenerator.
|
||||
*
|
||||
* @param sourceMap
|
||||
* The source map that will be consumed.
|
||||
*/
|
||||
fromSourceMap(sourceMap: SourceMapGenerator, sourceMapUrl?: SourceMapUrl): Promise<BasicSourceMapConsumer>;
|
||||
|
||||
/**
|
||||
* Construct a new `SourceMapConsumer` from `rawSourceMap` and `sourceMapUrl`
|
||||
* (see the `SourceMapConsumer` constructor for details. Then, invoke the `async
|
||||
* function f(SourceMapConsumer) -> T` with the newly constructed consumer, wait
|
||||
* for `f` to complete, call `destroy` on the consumer, and return `f`'s return
|
||||
* value.
|
||||
*
|
||||
* You must not use the consumer after `f` completes!
|
||||
*
|
||||
* By using `with`, you do not have to remember to manually call `destroy` on
|
||||
* the consumer, since it will be called automatically once `f` completes.
|
||||
*
|
||||
* ```js
|
||||
* const xSquared = await SourceMapConsumer.with(
|
||||
* myRawSourceMap,
|
||||
* null,
|
||||
* async function (consumer) {
|
||||
* // Use `consumer` inside here and don't worry about remembering
|
||||
* // to call `destroy`.
|
||||
*
|
||||
* const x = await whatever(consumer);
|
||||
* return x * x;
|
||||
* }
|
||||
* );
|
||||
*
|
||||
* // You may not use that `consumer` anymore out here; it has
|
||||
* // been destroyed. But you can use `xSquared`.
|
||||
* console.log(xSquared);
|
||||
* ```
|
||||
*/
|
||||
with<T>(rawSourceMap: RawSourceMap | RawIndexMap | string, sourceMapUrl: SourceMapUrl | null | undefined, callback: (consumer: BasicSourceMapConsumer | IndexedSourceMapConsumer) => Promise<T> | T): Promise<T>;
|
||||
}
|
||||
|
||||
export const SourceMapConsumer: SourceMapConsumerConstructor;
|
||||
|
||||
export interface BasicSourceMapConsumer extends SourceMapConsumer {
|
||||
file: string;
|
||||
sourceRoot: string;
|
||||
sources: string[];
|
||||
sourcesContent: string[];
|
||||
}
|
||||
|
||||
export interface BasicSourceMapConsumerConstructor {
|
||||
prototype: BasicSourceMapConsumer;
|
||||
|
||||
new (rawSourceMap: RawSourceMap | string): Promise<BasicSourceMapConsumer>;
|
||||
|
||||
/**
|
||||
* Create a BasicSourceMapConsumer from a SourceMapGenerator.
|
||||
*
|
||||
* @param sourceMap
|
||||
* The source map that will be consumed.
|
||||
*/
|
||||
fromSourceMap(sourceMap: SourceMapGenerator): Promise<BasicSourceMapConsumer>;
|
||||
}
|
||||
|
||||
export const BasicSourceMapConsumer: BasicSourceMapConsumerConstructor;
|
||||
|
||||
export interface IndexedSourceMapConsumer extends SourceMapConsumer {
|
||||
sources: string[];
|
||||
}
|
||||
|
||||
export interface IndexedSourceMapConsumerConstructor {
|
||||
prototype: IndexedSourceMapConsumer;
|
||||
|
||||
new (rawSourceMap: RawIndexMap | string): Promise<IndexedSourceMapConsumer>;
|
||||
}
|
||||
|
||||
export const IndexedSourceMapConsumer: IndexedSourceMapConsumerConstructor;
|
||||
|
||||
export class SourceMapGenerator {
|
||||
constructor(startOfSourceMap?: StartOfSourceMap);
|
||||
|
||||
/**
|
||||
* Creates a new SourceMapGenerator based on a SourceMapConsumer
|
||||
*
|
||||
* @param sourceMapConsumer The SourceMap.
|
||||
*/
|
||||
static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator;
|
||||
|
||||
/**
|
||||
* Add a single mapping from original source line and column to the generated
|
||||
* source's line and column for this source map being created. The mapping
|
||||
* object should have the following properties:
|
||||
*
|
||||
* - generated: An object with the generated line and column positions.
|
||||
* - original: An object with the original line and column positions.
|
||||
* - source: The original source file (relative to the sourceRoot).
|
||||
* - name: An optional original token name for this mapping.
|
||||
*/
|
||||
addMapping(mapping: Mapping): void;
|
||||
|
||||
/**
|
||||
* Set the source content for a source file.
|
||||
*/
|
||||
setSourceContent(sourceFile: string, sourceContent: string): void;
|
||||
|
||||
/**
|
||||
* Applies the mappings of a sub-source-map for a specific source file to the
|
||||
* source map being generated. Each mapping to the supplied source file is
|
||||
* rewritten using the supplied source map. Note: The resolution for the
|
||||
* resulting mappings is the minimium of this map and the supplied map.
|
||||
*
|
||||
* @param sourceMapConsumer The source map to be applied.
|
||||
* @param sourceFile Optional. The filename of the source file.
|
||||
* If omitted, SourceMapConsumer's file property will be used.
|
||||
* @param sourceMapPath Optional. The dirname of the path to the source map
|
||||
* to be applied. If relative, it is relative to the SourceMapConsumer.
|
||||
* This parameter is needed when the two source maps aren't in the same
|
||||
* directory, and the source map to be applied contains relative source
|
||||
* paths. If so, those relative source paths need to be rewritten
|
||||
* relative to the SourceMapGenerator.
|
||||
*/
|
||||
applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
|
||||
|
||||
toString(): string;
|
||||
|
||||
toJSON(): RawSourceMap;
|
||||
}
|
||||
|
||||
export class SourceNode {
|
||||
children: SourceNode[];
|
||||
sourceContents: any;
|
||||
line: number;
|
||||
column: number;
|
||||
source: string;
|
||||
name: string;
|
||||
|
||||
constructor();
|
||||
constructor(
|
||||
line: number | null,
|
||||
column: number | null,
|
||||
source: string | null,
|
||||
chunks?: Array<(string | SourceNode)> | SourceNode | string,
|
||||
name?: string
|
||||
);
|
||||
|
||||
static fromStringWithSourceMap(
|
||||
code: string,
|
||||
sourceMapConsumer: SourceMapConsumer,
|
||||
relativePath?: string
|
||||
): SourceNode;
|
||||
|
||||
add(chunk: Array<(string | SourceNode)> | SourceNode | string): SourceNode;
|
||||
|
||||
prepend(chunk: Array<(string | SourceNode)> | SourceNode | string): SourceNode;
|
||||
|
||||
setSourceContent(sourceFile: string, sourceContent: string): void;
|
||||
|
||||
walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
|
||||
|
||||
walkSourceContents(fn: (file: string, content: string) => void): void;
|
||||
|
||||
join(sep: string): SourceNode;
|
||||
|
||||
replaceRight(pattern: string, replacement: string): SourceNode;
|
||||
|
||||
toString(): string;
|
||||
|
||||
toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function () {
|
||||
var tanh = Math.tanh;
|
||||
if (typeof tanh !== "function") return false;
|
||||
return tanh(1) === 0.7615941559557649 && tanh(Number.MAX_VALUE) === 1;
|
||||
};
|
||||
@@ -0,0 +1,114 @@
|
||||
import type {JsonPrimitive, JsonValue} from './basic';
|
||||
import type {EmptyObject} from './empty-object';
|
||||
import type {IsAny, UndefinedToOptional} from './internal';
|
||||
import type {NegativeInfinity, PositiveInfinity} from './numeric';
|
||||
import type {TypedArray} from './typed-array';
|
||||
|
||||
// Note: The return value has to be `any` and not `unknown` so it can match `void`.
|
||||
type NotJsonable = ((...arguments_: any[]) => any) | undefined | symbol;
|
||||
|
||||
type JsonifyTuple<T extends [unknown, ...unknown[]]> = {
|
||||
[Key in keyof T]: T[Key] extends NotJsonable ? null : Jsonify<T[Key]>;
|
||||
};
|
||||
|
||||
type FilterJsonableKeys<T extends object> = {
|
||||
[Key in keyof T]: T[Key] extends NotJsonable ? never : Key;
|
||||
}[keyof T];
|
||||
|
||||
/**
|
||||
JSON serialize objects (not including arrays) and classes.
|
||||
*/
|
||||
type JsonifyObject<T extends object> = {
|
||||
[Key in keyof Pick<T, FilterJsonableKeys<T>>]: Jsonify<T[Key]>;
|
||||
};
|
||||
|
||||
/**
|
||||
Transform a type to one that is assignable to the `JsonValue` type.
|
||||
|
||||
This includes:
|
||||
1. Transforming JSON `interface` to a `type` that is assignable to `JsonValue`.
|
||||
2. Transforming non-JSON value that is *jsonable* to a type that is assignable to `JsonValue`, where *jsonable* means the non-JSON value implements the `.toJSON()` method that returns a value that is assignable to `JsonValue`.
|
||||
|
||||
@remarks
|
||||
|
||||
An interface cannot be structurally compared to `JsonValue` because an interface can be re-opened to add properties that may not be satisfy `JsonValue`.
|
||||
|
||||
@example
|
||||
```
|
||||
import type {Jsonify, JsonValue} from 'type-fest';
|
||||
|
||||
interface Geometry {
|
||||
type: 'Point' | 'Polygon';
|
||||
coordinates: [number, number];
|
||||
}
|
||||
|
||||
const point: Geometry = {
|
||||
type: 'Point',
|
||||
coordinates: [1, 1]
|
||||
};
|
||||
|
||||
const problemFn = (data: JsonValue) => {
|
||||
// Does something with data
|
||||
};
|
||||
|
||||
problemFn(point); // Error: type Geometry is not assignable to parameter of type JsonValue because it is an interface
|
||||
|
||||
const fixedFn = <T>(data: Jsonify<T>) => {
|
||||
// Does something with data
|
||||
};
|
||||
|
||||
fixedFn(point); // Good: point is assignable. Jsonify<T> transforms Geometry into value assignable to JsonValue
|
||||
fixedFn(new Date()); // Error: As expected, Date is not assignable. Jsonify<T> cannot transforms Date into value assignable to JsonValue
|
||||
```
|
||||
|
||||
Non-JSON values such as `Date` implement `.toJSON()`, so they can be transformed to a value assignable to `JsonValue`:
|
||||
|
||||
@example
|
||||
```
|
||||
import type {Jsonify} from 'type-fest';
|
||||
|
||||
const time = {
|
||||
timeValue: new Date()
|
||||
};
|
||||
|
||||
// `Jsonify<typeof time>` is equivalent to `{timeValue: string}`
|
||||
const timeJson = JSON.parse(JSON.stringify(time)) as Jsonify<typeof time>;
|
||||
```
|
||||
|
||||
@link https://github.com/Microsoft/TypeScript/issues/1897#issuecomment-710744173
|
||||
|
||||
@category JSON
|
||||
*/
|
||||
export type Jsonify<T> = IsAny<T> extends true
|
||||
? any
|
||||
: T extends PositiveInfinity | NegativeInfinity
|
||||
? null
|
||||
: T extends JsonPrimitive
|
||||
? T
|
||||
: // Instanced primitives are objects
|
||||
T extends Number
|
||||
? number
|
||||
: T extends String
|
||||
? string
|
||||
: T extends Boolean
|
||||
? boolean
|
||||
: T extends Map<any, any> | Set<any>
|
||||
? EmptyObject
|
||||
: T extends TypedArray
|
||||
? Record<string, number>
|
||||
: T extends NotJsonable
|
||||
? never // Non-JSONable type union was found not empty
|
||||
: // Any object with toJSON is special case
|
||||
T extends {toJSON(): infer J}
|
||||
? (() => J) extends () => JsonValue // Is J assignable to JsonValue?
|
||||
? J // Then T is Jsonable and its Jsonable value is J
|
||||
: Jsonify<J> // Maybe if we look a level deeper we'll find a JsonValue
|
||||
: T extends []
|
||||
? []
|
||||
: T extends [unknown, ...unknown[]]
|
||||
? JsonifyTuple<T>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? Array<U extends NotJsonable ? null : Jsonify<U>>
|
||||
: T extends object
|
||||
? JsonifyObject<UndefinedToOptional<T>> // JsonifyObject recursive call for its children
|
||||
: never; // Otherwise any other non-object is removed
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0.00377,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0.00377,"74":0,"75":0,"76":0,"77":0,"78":0.00377,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0.00753,"97":0,"98":0,"99":0.00753,"100":0,"101":0,"102":0.00753,"103":0.00377,"104":0.01506,"105":0.00377,"106":0.00377,"107":0.00753,"108":0.0113,"109":0.21084,"110":0.14307,"111":0.00377,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0.00377,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0.00377,"48":0,"49":0.0113,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0.00377,"63":0,"64":0,"65":0.00377,"66":0,"67":0,"68":0.0113,"69":0.00377,"70":0.00377,"71":0,"72":0,"73":0,"74":0.00377,"75":0.00377,"76":0.00377,"77":0.00377,"78":0.00377,"79":0.05648,"80":0.00753,"81":0.00753,"83":0.00753,"84":0.00753,"85":0.00753,"86":0.00753,"87":0.01506,"88":0.0113,"89":0.0113,"90":0.00377,"91":0.01883,"92":0.01506,"93":0.00377,"94":0.00377,"95":0.00753,"96":0.0113,"97":0.01506,"98":0.01883,"99":0.01506,"100":0.01883,"101":0.0113,"102":0.01883,"103":0.05648,"104":0.04895,"105":0.04142,"106":0.03012,"107":0.06401,"108":0.18072,"109":6.024,"110":4.03232,"111":0.00377,"112":0.00377,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0.00377,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.06777,"94":0.5384,"95":0.17696,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0.00377,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00377,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0.00377,"105":0.00377,"106":0.00377,"107":0.0113,"108":0.01506,"109":0.40286,"110":0.55346},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0.00753,"15":0.00377,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0.00377,"13.1":0.01506,"14.1":0.02636,"15.1":0.00377,"15.2-15.3":0.00377,"15.4":0.00753,"15.5":0.01883,"15.6":0.07907,"16.0":0.0113,"16.1":0.03012,"16.2":0.07907,"16.3":0.06401,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00362,"6.0-6.1":0,"7.0-7.1":0.01085,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.04461,"10.0-10.2":0,"10.3":0.05426,"11.0-11.2":0.00362,"11.3-11.4":0.00482,"12.0-12.1":0.00241,"12.2-12.5":0.29058,"13.0-13.1":0.00241,"13.2":0.00723,"13.3":0.01326,"13.4-13.7":0.03617,"14.0-14.4":0.09887,"14.5-14.8":0.29179,"15.0-15.1":0.05788,"15.2-15.3":0.13745,"15.4":0.12419,"15.5":0.30023,"15.6":0.90189,"16.0":1.389,"16.1":2.78041,"16.2":2.93233,"16.3":1.65667,"16.4":0.00723},P:{"4":0.17398,"20":0.34796,"5.0-5.4":0.02047,"6.2-6.4":0,"7.2-7.4":0.08187,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0.02047,"12.0":0,"13.0":0.02047,"14.0":0.02047,"15.0":0.01023,"16.0":0.04094,"17.0":0.05117,"18.0":0.05117,"19.0":0.64474},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.01153,"4.2-4.3":0.01538,"4.4":0,"4.4.3-4.4.4":0.08074},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0.00377,"9":0,"10":0,"11":0.01506,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.02494},H:{"0":0.12396},L:{"0":72.40977},R:{_:"0"},M:{"0":0.13094},Q:{"13.1":0}};
|
||||
@@ -0,0 +1,256 @@
|
||||
(function (global, factory) {
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define('localforageSerializer', ['module', 'exports', './createBlob'], factory);
|
||||
} else if (typeof exports !== "undefined") {
|
||||
factory(module, exports, require('./createBlob'));
|
||||
} else {
|
||||
var mod = {
|
||||
exports: {}
|
||||
};
|
||||
factory(mod, mod.exports, global.createBlob);
|
||||
global.localforageSerializer = mod.exports;
|
||||
}
|
||||
})(this, function (module, exports, _createBlob) {
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createBlob2 = _interopRequireDefault(_createBlob);
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
|
||||
// Sadly, the best way to save binary data in WebSQL/localStorage is serializing
|
||||
// it to Base64, so this is how we store it to prevent very strange errors with less
|
||||
// verbose ways of binary <-> string data storage.
|
||||
var BASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; /* eslint-disable no-bitwise */
|
||||
|
||||
|
||||
var BLOB_TYPE_PREFIX = '~~local_forage_type~';
|
||||
var BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;
|
||||
|
||||
var SERIALIZED_MARKER = '__lfsc__:';
|
||||
var SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length;
|
||||
|
||||
// OMG the serializations!
|
||||
var TYPE_ARRAYBUFFER = 'arbf';
|
||||
var TYPE_BLOB = 'blob';
|
||||
var TYPE_INT8ARRAY = 'si08';
|
||||
var TYPE_UINT8ARRAY = 'ui08';
|
||||
var TYPE_UINT8CLAMPEDARRAY = 'uic8';
|
||||
var TYPE_INT16ARRAY = 'si16';
|
||||
var TYPE_INT32ARRAY = 'si32';
|
||||
var TYPE_UINT16ARRAY = 'ur16';
|
||||
var TYPE_UINT32ARRAY = 'ui32';
|
||||
var TYPE_FLOAT32ARRAY = 'fl32';
|
||||
var TYPE_FLOAT64ARRAY = 'fl64';
|
||||
var TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length;
|
||||
|
||||
var toString = Object.prototype.toString;
|
||||
|
||||
function stringToBuffer(serializedString) {
|
||||
// Fill the string into a ArrayBuffer.
|
||||
var bufferLength = serializedString.length * 0.75;
|
||||
var len = serializedString.length;
|
||||
var i;
|
||||
var p = 0;
|
||||
var encoded1, encoded2, encoded3, encoded4;
|
||||
|
||||
if (serializedString[serializedString.length - 1] === '=') {
|
||||
bufferLength--;
|
||||
if (serializedString[serializedString.length - 2] === '=') {
|
||||
bufferLength--;
|
||||
}
|
||||
}
|
||||
|
||||
var buffer = new ArrayBuffer(bufferLength);
|
||||
var bytes = new Uint8Array(buffer);
|
||||
|
||||
for (i = 0; i < len; i += 4) {
|
||||
encoded1 = BASE_CHARS.indexOf(serializedString[i]);
|
||||
encoded2 = BASE_CHARS.indexOf(serializedString[i + 1]);
|
||||
encoded3 = BASE_CHARS.indexOf(serializedString[i + 2]);
|
||||
encoded4 = BASE_CHARS.indexOf(serializedString[i + 3]);
|
||||
|
||||
/*jslint bitwise: true */
|
||||
bytes[p++] = encoded1 << 2 | encoded2 >> 4;
|
||||
bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
|
||||
bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
// Converts a buffer to a string to store, serialized, in the backend
|
||||
// storage library.
|
||||
function bufferToString(buffer) {
|
||||
// base64-arraybuffer
|
||||
var bytes = new Uint8Array(buffer);
|
||||
var base64String = '';
|
||||
var i;
|
||||
|
||||
for (i = 0; i < bytes.length; i += 3) {
|
||||
/*jslint bitwise: true */
|
||||
base64String += BASE_CHARS[bytes[i] >> 2];
|
||||
base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];
|
||||
base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];
|
||||
base64String += BASE_CHARS[bytes[i + 2] & 63];
|
||||
}
|
||||
|
||||
if (bytes.length % 3 === 2) {
|
||||
base64String = base64String.substring(0, base64String.length - 1) + '=';
|
||||
} else if (bytes.length % 3 === 1) {
|
||||
base64String = base64String.substring(0, base64String.length - 2) + '==';
|
||||
}
|
||||
|
||||
return base64String;
|
||||
}
|
||||
|
||||
// Serialize a value, afterwards executing a callback (which usually
|
||||
// instructs the `setItem()` callback/promise to be executed). This is how
|
||||
// we store binary data with localStorage.
|
||||
function serialize(value, callback) {
|
||||
var valueType = '';
|
||||
if (value) {
|
||||
valueType = toString.call(value);
|
||||
}
|
||||
|
||||
// Cannot use `value instanceof ArrayBuffer` or such here, as these
|
||||
// checks fail when running the tests using casper.js...
|
||||
//
|
||||
// TODO: See why those tests fail and use a better solution.
|
||||
if (value && (valueType === '[object ArrayBuffer]' || value.buffer && toString.call(value.buffer) === '[object ArrayBuffer]')) {
|
||||
// Convert binary arrays to a string and prefix the string with
|
||||
// a special marker.
|
||||
var buffer;
|
||||
var marker = SERIALIZED_MARKER;
|
||||
|
||||
if (value instanceof ArrayBuffer) {
|
||||
buffer = value;
|
||||
marker += TYPE_ARRAYBUFFER;
|
||||
} else {
|
||||
buffer = value.buffer;
|
||||
|
||||
if (valueType === '[object Int8Array]') {
|
||||
marker += TYPE_INT8ARRAY;
|
||||
} else if (valueType === '[object Uint8Array]') {
|
||||
marker += TYPE_UINT8ARRAY;
|
||||
} else if (valueType === '[object Uint8ClampedArray]') {
|
||||
marker += TYPE_UINT8CLAMPEDARRAY;
|
||||
} else if (valueType === '[object Int16Array]') {
|
||||
marker += TYPE_INT16ARRAY;
|
||||
} else if (valueType === '[object Uint16Array]') {
|
||||
marker += TYPE_UINT16ARRAY;
|
||||
} else if (valueType === '[object Int32Array]') {
|
||||
marker += TYPE_INT32ARRAY;
|
||||
} else if (valueType === '[object Uint32Array]') {
|
||||
marker += TYPE_UINT32ARRAY;
|
||||
} else if (valueType === '[object Float32Array]') {
|
||||
marker += TYPE_FLOAT32ARRAY;
|
||||
} else if (valueType === '[object Float64Array]') {
|
||||
marker += TYPE_FLOAT64ARRAY;
|
||||
} else {
|
||||
callback(new Error('Failed to get type for BinaryArray'));
|
||||
}
|
||||
}
|
||||
|
||||
callback(marker + bufferToString(buffer));
|
||||
} else if (valueType === '[object Blob]') {
|
||||
// Conver the blob to a binaryArray and then to a string.
|
||||
var fileReader = new FileReader();
|
||||
|
||||
fileReader.onload = function () {
|
||||
// Backwards-compatible prefix for the blob type.
|
||||
var str = BLOB_TYPE_PREFIX + value.type + '~' + bufferToString(this.result);
|
||||
|
||||
callback(SERIALIZED_MARKER + TYPE_BLOB + str);
|
||||
};
|
||||
|
||||
fileReader.readAsArrayBuffer(value);
|
||||
} else {
|
||||
try {
|
||||
callback(JSON.stringify(value));
|
||||
} catch (e) {
|
||||
console.error("Couldn't convert value into a JSON string: ", value);
|
||||
|
||||
callback(null, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Deserialize data we've inserted into a value column/field. We place
|
||||
// special markers into our strings to mark them as encoded; this isn't
|
||||
// as nice as a meta field, but it's the only sane thing we can do whilst
|
||||
// keeping localStorage support intact.
|
||||
//
|
||||
// Oftentimes this will just deserialize JSON content, but if we have a
|
||||
// special marker (SERIALIZED_MARKER, defined above), we will extract
|
||||
// some kind of arraybuffer/binary data/typed array out of the string.
|
||||
function deserialize(value) {
|
||||
// If we haven't marked this string as being specially serialized (i.e.
|
||||
// something other than serialized JSON), we can just return it and be
|
||||
// done with it.
|
||||
if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {
|
||||
return JSON.parse(value);
|
||||
}
|
||||
|
||||
// The following code deals with deserializing some kind of Blob or
|
||||
// TypedArray. First we separate out the type of data we're dealing
|
||||
// with from the data itself.
|
||||
var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);
|
||||
var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH);
|
||||
|
||||
var blobType;
|
||||
// Backwards-compatible blob type serialization strategy.
|
||||
// DBs created with older versions of localForage will simply not have the blob type.
|
||||
if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {
|
||||
var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);
|
||||
blobType = matcher[1];
|
||||
serializedString = serializedString.substring(matcher[0].length);
|
||||
}
|
||||
var buffer = stringToBuffer(serializedString);
|
||||
|
||||
// Return the right type based on the code/type set during
|
||||
// serialization.
|
||||
switch (type) {
|
||||
case TYPE_ARRAYBUFFER:
|
||||
return buffer;
|
||||
case TYPE_BLOB:
|
||||
return (0, _createBlob2.default)([buffer], { type: blobType });
|
||||
case TYPE_INT8ARRAY:
|
||||
return new Int8Array(buffer);
|
||||
case TYPE_UINT8ARRAY:
|
||||
return new Uint8Array(buffer);
|
||||
case TYPE_UINT8CLAMPEDARRAY:
|
||||
return new Uint8ClampedArray(buffer);
|
||||
case TYPE_INT16ARRAY:
|
||||
return new Int16Array(buffer);
|
||||
case TYPE_UINT16ARRAY:
|
||||
return new Uint16Array(buffer);
|
||||
case TYPE_INT32ARRAY:
|
||||
return new Int32Array(buffer);
|
||||
case TYPE_UINT32ARRAY:
|
||||
return new Uint32Array(buffer);
|
||||
case TYPE_FLOAT32ARRAY:
|
||||
return new Float32Array(buffer);
|
||||
case TYPE_FLOAT64ARRAY:
|
||||
return new Float64Array(buffer);
|
||||
default:
|
||||
throw new Error('Unkown type: ' + type);
|
||||
}
|
||||
}
|
||||
|
||||
var localforageSerializer = {
|
||||
serialize: serialize,
|
||||
deserialize: deserialize,
|
||||
stringToBuffer: stringToBuffer,
|
||||
bufferToString: bufferToString
|
||||
};
|
||||
|
||||
exports.default = localforageSerializer;
|
||||
module.exports = exports['default'];
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
var getWrapDetails = require('./_getWrapDetails'),
|
||||
insertWrapDetails = require('./_insertWrapDetails'),
|
||||
setToString = require('./_setToString'),
|
||||
updateWrapDetails = require('./_updateWrapDetails');
|
||||
|
||||
/**
|
||||
* Sets the `toString` method of `wrapper` to mimic the source of `reference`
|
||||
* with wrapper details in a comment at the top of the source body.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} wrapper The function to modify.
|
||||
* @param {Function} reference The reference function.
|
||||
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
|
||||
* @returns {Function} Returns `wrapper`.
|
||||
*/
|
||||
function setWrapToString(wrapper, reference, bitmask) {
|
||||
var source = (reference + '');
|
||||
return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
|
||||
}
|
||||
|
||||
module.exports = setWrapToString;
|
||||
@@ -0,0 +1,24 @@
|
||||
'use strict'
|
||||
/* eslint-env mocha */
|
||||
/* eslint no-proto: 0 */
|
||||
var assert = require('assert')
|
||||
var setPrototypeOf = require('..')
|
||||
|
||||
describe('setProtoOf(obj, proto)', function () {
|
||||
it('should merge objects', function () {
|
||||
var obj = { a: 1, b: 2 }
|
||||
var proto = { b: 3, c: 4 }
|
||||
var mergeObj = setPrototypeOf(obj, proto)
|
||||
|
||||
if (Object.getPrototypeOf) {
|
||||
assert.strictEqual(Object.getPrototypeOf(obj), proto)
|
||||
} else if ({ __proto__: [] } instanceof Array) {
|
||||
assert.strictEqual(obj.__proto__, proto)
|
||||
} else {
|
||||
assert.strictEqual(obj.a, 1)
|
||||
assert.strictEqual(obj.b, 2)
|
||||
assert.strictEqual(obj.c, 4)
|
||||
}
|
||||
assert.strictEqual(mergeObj, obj)
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"takeLast.js","sourceRoot":"","sources":["../../../../src/internal/operators/takeLast.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAyChE,MAAM,UAAU,QAAQ,CAAI,KAAa;IACvC,OAAO,KAAK,IAAI,CAAC;QACf,CAAC,CAAC,cAAM,OAAA,KAAK,EAAL,CAAK;QACb,CAAC,CAAC,OAAO,CAAC,UAAC,MAAM,EAAE,UAAU;YAKzB,IAAI,MAAM,GAAQ,EAAE,CAAC;YACrB,MAAM,CAAC,SAAS,CACd,wBAAwB,CACtB,UAAU,EACV,UAAC,KAAK;gBAEJ,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAGnB,KAAK,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAC1C,CAAC,EACD;;;oBAGE,KAAoB,IAAA,WAAA,SAAA,MAAM,CAAA,8BAAA,kDAAE;wBAAvB,IAAM,KAAK,mBAAA;wBACd,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;qBACxB;;;;;;;;;gBACD,UAAU,CAAC,QAAQ,EAAE,CAAC;YACxB,CAAC,EAED,SAAS,EACT;gBAEE,MAAM,GAAG,IAAK,CAAC;YACjB,CAAC,CACF,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;AACT,CAAC"}
|
||||
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (trimStart, t) {
|
||||
t.test('normal cases', function (st) {
|
||||
st.equal(trimStart(' \t\na \t\n'), 'a \t\n', 'strips whitespace off the left side');
|
||||
st.equal(trimStart('a'), 'a', 'noop when no whitespace');
|
||||
|
||||
var allWhitespaceChars = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
||||
st.equal(trimStart(allWhitespaceChars + 'a' + allWhitespaceChars), 'a' + allWhitespaceChars, 'all expected whitespace chars are trimmed');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
// see https://codeblog.jonskeet.uk/2014/12/01/when-is-an-identifier-not-an-identifier-attack-of-the-mongolian-vowel-separator/
|
||||
var mongolianVowelSeparator = '\u180E';
|
||||
var mvsIsWS = (/^\s$/).test(mongolianVowelSeparator);
|
||||
t.test('mongolian vowel separator: unicode >= 4 && < 6.3', function (st) {
|
||||
st.equal(
|
||||
trimStart(mongolianVowelSeparator + 'a' + mongolianVowelSeparator),
|
||||
(mvsIsWS ? '' : mongolianVowelSeparator) + 'a' + mongolianVowelSeparator,
|
||||
'mongolian vowel separator is ' + (mvsIsWS ? '' : 'not ') + 'whitespace'
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('zero-width spaces', function (st) {
|
||||
var zeroWidth = '\u200b';
|
||||
st.equal(trimStart(zeroWidth), zeroWidth, 'zero width space does not trim');
|
||||
st.end();
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/types/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAA;AAEjC,oBAAY,qBAAqB,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAA;AAErE,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,eAAe,CAAA;IAC7B,WAAW,CAAC,EAAE,eAAe,CAAA;IAC7B,IAAI,CAAC,EAAE,eAAe,CAAA;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,WAAW,CAAA;IACjB,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB"}
|
||||
@@ -0,0 +1,12 @@
|
||||
export default function(Handlebars) {
|
||||
/* istanbul ignore next */
|
||||
let root = typeof global !== 'undefined' ? global : window,
|
||||
$Handlebars = root.Handlebars;
|
||||
/* istanbul ignore next */
|
||||
Handlebars.noConflict = function() {
|
||||
if (root.Handlebars === Handlebars) {
|
||||
root.Handlebars = $Handlebars;
|
||||
}
|
||||
return Handlebars;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "safe-buffer",
|
||||
"description": "Safer Node.js Buffer API",
|
||||
"version": "5.2.1",
|
||||
"author": {
|
||||
"name": "Feross Aboukhadijeh",
|
||||
"email": "feross@feross.org",
|
||||
"url": "https://feross.org"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/feross/safe-buffer/issues"
|
||||
},
|
||||
"devDependencies": {
|
||||
"standard": "*",
|
||||
"tape": "^5.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/feross/safe-buffer",
|
||||
"keywords": [
|
||||
"buffer",
|
||||
"buffer allocate",
|
||||
"node security",
|
||||
"safe",
|
||||
"safe-buffer",
|
||||
"security",
|
||||
"uninitialized"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/feross/safe-buffer.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "standard && tape test/*.js"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0.00797,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0.00797,"53":0,"54":0,"55":0,"56":0.00266,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0.00266,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0.00266,"80":0.00266,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0.00531,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.01062,"103":0.00266,"104":0.00266,"105":0.00797,"106":0.00797,"107":0.00797,"108":0.01328,"109":0.3956,"110":0.31595,"111":0.01859,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0.00266,"57":0,"58":0.00266,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0.00266,"68":0,"69":0.00266,"70":0.00266,"71":0.00266,"72":0.00266,"73":0.00266,"74":0.01062,"75":0.00266,"76":0,"77":0.00266,"78":0.00531,"79":0.00531,"80":0.00266,"81":0.00797,"83":0.00797,"84":0.01062,"85":0.01328,"86":0.01593,"87":0.01062,"88":0.00266,"89":0.00266,"90":0.00266,"91":0.00266,"92":0.00531,"93":0.00266,"94":0.00266,"95":0.00797,"96":0.00531,"97":0.00531,"98":0.00531,"99":0.00531,"100":0.00797,"101":0.00531,"102":0.00797,"103":0.01328,"104":0.00797,"105":0.01593,"106":0.01859,"107":0.03186,"108":0.077,"109":2.57004,"110":1.66734,"111":0.00797,"112":0.00531,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.00266,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0.00266,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0.00266,"56":0,"57":0,"58":0.00266,"60":0.00266,"62":0,"63":0.00531,"64":0.00797,"65":0.00266,"66":0.00797,"67":0.17523,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0.00266,"74":0.01328,"75":0,"76":0,"77":0,"78":0,"79":0.00266,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0.00266,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.00266,"94":0.06372,"95":0.08496,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0.00266,"13":0.00266,"14":0,"15":0,"16":0,"17":0,"18":0.00266,"79":0,"80":0,"81":0,"83":0,"84":0.00266,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00266,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0.00266,"107":0.00266,"108":0.00531,"109":0.11682,"110":0.17258},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0.00266,"15":0,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0,"13.1":0.00266,"14.1":0.00266,"15.1":0,"15.2-15.3":0.00266,"15.4":0.00266,"15.5":0.00266,"15.6":0.01859,"16.0":0.00531,"16.1":0.00797,"16.2":0.01593,"16.3":0.01593,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0006,"5.0-5.1":0.0021,"6.0-6.1":0.0003,"7.0-7.1":0.04292,"8.1-8.4":0.0018,"9.0-9.2":0.0027,"9.3":0.02131,"10.0-10.2":0.0045,"10.3":0.01891,"11.0-11.2":0.0048,"11.3-11.4":0.0036,"12.0-12.1":0.0048,"12.2-12.5":0.20952,"13.0-13.1":0.0039,"13.2":0.0033,"13.3":0.00901,"13.4-13.7":0.03062,"14.0-14.4":0.05403,"14.5-14.8":0.08585,"15.0-15.1":0.02612,"15.2-15.3":0.03842,"15.4":0.05163,"15.5":0.11076,"15.6":0.20982,"16.0":0.19631,"16.1":0.44546,"16.2":0.50399,"16.3":0.5214,"16.4":0.0015},P:{"4":0.22419,"20":0.19362,"5.0-5.4":0,"6.2-6.4":0.01019,"7.2-7.4":0.08152,"8.2":0,"9.2":0.01019,"10.1":0,"11.1-11.2":0.02038,"12.0":0.01019,"13.0":0.02038,"14.0":0.01019,"15.0":0.01019,"16.0":0.02038,"17.0":0.05095,"18.0":0.03057,"19.0":0.43819},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.01054,"4.4":0,"4.4.3-4.4.4":0.16866},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0.00266,"9":0,"10":0,"11":0.01859,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0.00735,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":2.22554},H:{"0":1.98182},L:{"0":83.93026},R:{_:"0"},M:{"0":0.11018},Q:{"13.1":0}};
|
||||
@@ -0,0 +1,410 @@
|
||||
/**
|
||||
* Clusters of Node.js processes can be used to run multiple instances of Node.js
|
||||
* that can distribute workloads among their application threads. When process
|
||||
* isolation is not needed, use the `worker_threads` module instead, which
|
||||
* allows running multiple application threads within a single Node.js instance.
|
||||
*
|
||||
* The cluster module allows easy creation of child processes that all share
|
||||
* server ports.
|
||||
*
|
||||
* ```js
|
||||
* import cluster from 'cluster';
|
||||
* import http from 'http';
|
||||
* import { cpus } from 'os';
|
||||
* import process from 'process';
|
||||
*
|
||||
* const numCPUs = cpus().length;
|
||||
*
|
||||
* if (cluster.isPrimary) {
|
||||
* console.log(`Primary ${process.pid} is running`);
|
||||
*
|
||||
* // Fork workers.
|
||||
* for (let i = 0; i < numCPUs; i++) {
|
||||
* cluster.fork();
|
||||
* }
|
||||
*
|
||||
* cluster.on('exit', (worker, code, signal) => {
|
||||
* console.log(`worker ${worker.process.pid} died`);
|
||||
* });
|
||||
* } else {
|
||||
* // Workers can share any TCP connection
|
||||
* // In this case it is an HTTP server
|
||||
* http.createServer((req, res) => {
|
||||
* res.writeHead(200);
|
||||
* res.end('hello world\n');
|
||||
* }).listen(8000);
|
||||
*
|
||||
* console.log(`Worker ${process.pid} started`);
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Running Node.js will now share port 8000 between the workers:
|
||||
*
|
||||
* ```console
|
||||
* $ node server.js
|
||||
* Primary 3596 is running
|
||||
* Worker 4324 started
|
||||
* Worker 4520 started
|
||||
* Worker 6056 started
|
||||
* Worker 5644 started
|
||||
* ```
|
||||
*
|
||||
* On Windows, it is not yet possible to set up a named pipe server in a worker.
|
||||
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/cluster.js)
|
||||
*/
|
||||
declare module 'cluster' {
|
||||
import * as child from 'node:child_process';
|
||||
import EventEmitter = require('node:events');
|
||||
import * as net from 'node:net';
|
||||
export interface ClusterSettings {
|
||||
execArgv?: string[] | undefined; // default: process.execArgv
|
||||
exec?: string | undefined;
|
||||
args?: string[] | undefined;
|
||||
silent?: boolean | undefined;
|
||||
stdio?: any[] | undefined;
|
||||
uid?: number | undefined;
|
||||
gid?: number | undefined;
|
||||
inspectPort?: number | (() => number) | undefined;
|
||||
}
|
||||
export interface Address {
|
||||
address: string;
|
||||
port: number;
|
||||
addressType: number | 'udp4' | 'udp6'; // 4, 6, -1, "udp4", "udp6"
|
||||
}
|
||||
/**
|
||||
* A `Worker` object contains all public information and method about a worker.
|
||||
* In the primary it can be obtained using `cluster.workers`. In a worker
|
||||
* it can be obtained using `cluster.worker`.
|
||||
* @since v0.7.0
|
||||
*/
|
||||
export class Worker extends EventEmitter {
|
||||
/**
|
||||
* Each new worker is given its own unique id, this id is stored in the`id`.
|
||||
*
|
||||
* While a worker is alive, this is the key that indexes it in`cluster.workers`.
|
||||
* @since v0.8.0
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* All workers are created using `child_process.fork()`, the returned object
|
||||
* from this function is stored as `.process`. In a worker, the global `process`is stored.
|
||||
*
|
||||
* See: `Child Process module`.
|
||||
*
|
||||
* Workers will call `process.exit(0)` if the `'disconnect'` event occurs
|
||||
* on `process` and `.exitedAfterDisconnect` is not `true`. This protects against
|
||||
* accidental disconnection.
|
||||
* @since v0.7.0
|
||||
*/
|
||||
process: child.ChildProcess;
|
||||
/**
|
||||
* Send a message to a worker or primary, optionally with a handle.
|
||||
*
|
||||
* In the primary, this sends a message to a specific worker. It is identical to `ChildProcess.send()`.
|
||||
*
|
||||
* In a worker, this sends a message to the primary. It is identical to`process.send()`.
|
||||
*
|
||||
* This example will echo back all messages from the primary:
|
||||
*
|
||||
* ```js
|
||||
* if (cluster.isPrimary) {
|
||||
* const worker = cluster.fork();
|
||||
* worker.send('hi there');
|
||||
*
|
||||
* } else if (cluster.isWorker) {
|
||||
* process.on('message', (msg) => {
|
||||
* process.send(msg);
|
||||
* });
|
||||
* }
|
||||
* ```
|
||||
* @since v0.7.0
|
||||
* @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:
|
||||
*/
|
||||
send(message: child.Serializable, callback?: (error: Error | null) => void): boolean;
|
||||
send(message: child.Serializable, sendHandle: child.SendHandle, callback?: (error: Error | null) => void): boolean;
|
||||
send(message: child.Serializable, sendHandle: child.SendHandle, options?: child.MessageOptions, callback?: (error: Error | null) => void): boolean;
|
||||
/**
|
||||
* This function will kill the worker. In the primary worker, it does this by
|
||||
* disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`.
|
||||
*
|
||||
* The `kill()` function kills the worker process without waiting for a graceful
|
||||
* disconnect, it has the same behavior as `worker.process.kill()`.
|
||||
*
|
||||
* This method is aliased as `worker.destroy()` for backwards compatibility.
|
||||
*
|
||||
* In a worker, `process.kill()` exists, but it is not this function;
|
||||
* it is `kill()`.
|
||||
* @since v0.9.12
|
||||
* @param [signal='SIGTERM'] Name of the kill signal to send to the worker process.
|
||||
*/
|
||||
kill(signal?: string): void;
|
||||
destroy(signal?: string): void;
|
||||
/**
|
||||
* In a worker, this function will close all servers, wait for the `'close'` event
|
||||
* on those servers, and then disconnect the IPC channel.
|
||||
*
|
||||
* In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself.
|
||||
*
|
||||
* Causes `.exitedAfterDisconnect` to be set.
|
||||
*
|
||||
* After a server is closed, it will no longer accept new connections,
|
||||
* but connections may be accepted by any other listening worker. Existing
|
||||
* connections will be allowed to close as usual. When no more connections exist,
|
||||
* see `server.close()`, the IPC channel to the worker will close allowing it
|
||||
* to die gracefully.
|
||||
*
|
||||
* The above applies _only_ to server connections, client connections are not
|
||||
* automatically closed by workers, and disconnect does not wait for them to close
|
||||
* before exiting.
|
||||
*
|
||||
* In a worker, `process.disconnect` exists, but it is not this function;
|
||||
* it is `disconnect()`.
|
||||
*
|
||||
* Because long living server connections may block workers from disconnecting, it
|
||||
* may be useful to send a message, so application specific actions may be taken to
|
||||
* close them. It also may be useful to implement a timeout, killing a worker if
|
||||
* the `'disconnect'` event has not been emitted after some time.
|
||||
*
|
||||
* ```js
|
||||
* if (cluster.isPrimary) {
|
||||
* const worker = cluster.fork();
|
||||
* let timeout;
|
||||
*
|
||||
* worker.on('listening', (address) => {
|
||||
* worker.send('shutdown');
|
||||
* worker.disconnect();
|
||||
* timeout = setTimeout(() => {
|
||||
* worker.kill();
|
||||
* }, 2000);
|
||||
* });
|
||||
*
|
||||
* worker.on('disconnect', () => {
|
||||
* clearTimeout(timeout);
|
||||
* });
|
||||
*
|
||||
* } else if (cluster.isWorker) {
|
||||
* const net = require('net');
|
||||
* const server = net.createServer((socket) => {
|
||||
* // Connections never end
|
||||
* });
|
||||
*
|
||||
* server.listen(8000);
|
||||
*
|
||||
* process.on('message', (msg) => {
|
||||
* if (msg === 'shutdown') {
|
||||
* // Initiate graceful close of any connections to server
|
||||
* }
|
||||
* });
|
||||
* }
|
||||
* ```
|
||||
* @since v0.7.7
|
||||
* @return A reference to `worker`.
|
||||
*/
|
||||
disconnect(): void;
|
||||
/**
|
||||
* This function returns `true` if the worker is connected to its primary via its
|
||||
* IPC channel, `false` otherwise. A worker is connected to its primary after it
|
||||
* has been created. It is disconnected after the `'disconnect'` event is emitted.
|
||||
* @since v0.11.14
|
||||
*/
|
||||
isConnected(): boolean;
|
||||
/**
|
||||
* This function returns `true` if the worker's process has terminated (either
|
||||
* because of exiting or being signaled). Otherwise, it returns `false`.
|
||||
*
|
||||
* ```js
|
||||
* import cluster from 'cluster';
|
||||
* import http from 'http';
|
||||
* import { cpus } from 'os';
|
||||
* import process from 'process';
|
||||
*
|
||||
* const numCPUs = cpus().length;
|
||||
*
|
||||
* if (cluster.isPrimary) {
|
||||
* console.log(`Primary ${process.pid} is running`);
|
||||
*
|
||||
* // Fork workers.
|
||||
* for (let i = 0; i < numCPUs; i++) {
|
||||
* cluster.fork();
|
||||
* }
|
||||
*
|
||||
* cluster.on('fork', (worker) => {
|
||||
* console.log('worker is dead:', worker.isDead());
|
||||
* });
|
||||
*
|
||||
* cluster.on('exit', (worker, code, signal) => {
|
||||
* console.log('worker is dead:', worker.isDead());
|
||||
* });
|
||||
* } else {
|
||||
* // Workers can share any TCP connection. In this case, it is an HTTP server.
|
||||
* http.createServer((req, res) => {
|
||||
* res.writeHead(200);
|
||||
* res.end(`Current process\n ${process.pid}`);
|
||||
* process.kill(process.pid);
|
||||
* }).listen(8000);
|
||||
* }
|
||||
* ```
|
||||
* @since v0.11.14
|
||||
*/
|
||||
isDead(): boolean;
|
||||
/**
|
||||
* This property is `true` if the worker exited due to `.disconnect()`.
|
||||
* If the worker exited any other way, it is `false`. If the
|
||||
* worker has not exited, it is `undefined`.
|
||||
*
|
||||
* The boolean `worker.exitedAfterDisconnect` allows distinguishing between
|
||||
* voluntary and accidental exit, the primary may choose not to respawn a worker
|
||||
* based on this value.
|
||||
*
|
||||
* ```js
|
||||
* cluster.on('exit', (worker, code, signal) => {
|
||||
* if (worker.exitedAfterDisconnect === true) {
|
||||
* console.log('Oh, it was just voluntary – no need to worry');
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* // kill worker
|
||||
* worker.kill();
|
||||
* ```
|
||||
* @since v6.0.0
|
||||
*/
|
||||
exitedAfterDisconnect: boolean;
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. disconnect
|
||||
* 2. error
|
||||
* 3. exit
|
||||
* 4. listening
|
||||
* 5. message
|
||||
* 6. online
|
||||
*/
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: 'disconnect', listener: () => void): this;
|
||||
addListener(event: 'error', listener: (error: Error) => void): this;
|
||||
addListener(event: 'exit', listener: (code: number, signal: string) => void): this;
|
||||
addListener(event: 'listening', listener: (address: Address) => void): this;
|
||||
addListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
addListener(event: 'online', listener: () => void): this;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: 'disconnect'): boolean;
|
||||
emit(event: 'error', error: Error): boolean;
|
||||
emit(event: 'exit', code: number, signal: string): boolean;
|
||||
emit(event: 'listening', address: Address): boolean;
|
||||
emit(event: 'message', message: any, handle: net.Socket | net.Server): boolean;
|
||||
emit(event: 'online'): boolean;
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: 'disconnect', listener: () => void): this;
|
||||
on(event: 'error', listener: (error: Error) => void): this;
|
||||
on(event: 'exit', listener: (code: number, signal: string) => void): this;
|
||||
on(event: 'listening', listener: (address: Address) => void): this;
|
||||
on(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
on(event: 'online', listener: () => void): this;
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: 'disconnect', listener: () => void): this;
|
||||
once(event: 'error', listener: (error: Error) => void): this;
|
||||
once(event: 'exit', listener: (code: number, signal: string) => void): this;
|
||||
once(event: 'listening', listener: (address: Address) => void): this;
|
||||
once(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
once(event: 'online', listener: () => void): this;
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: 'disconnect', listener: () => void): this;
|
||||
prependListener(event: 'error', listener: (error: Error) => void): this;
|
||||
prependListener(event: 'exit', listener: (code: number, signal: string) => void): this;
|
||||
prependListener(event: 'listening', listener: (address: Address) => void): this;
|
||||
prependListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
prependListener(event: 'online', listener: () => void): this;
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: 'disconnect', listener: () => void): this;
|
||||
prependOnceListener(event: 'error', listener: (error: Error) => void): this;
|
||||
prependOnceListener(event: 'exit', listener: (code: number, signal: string) => void): this;
|
||||
prependOnceListener(event: 'listening', listener: (address: Address) => void): this;
|
||||
prependOnceListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
prependOnceListener(event: 'online', listener: () => void): this;
|
||||
}
|
||||
export interface Cluster extends EventEmitter {
|
||||
disconnect(callback?: () => void): void;
|
||||
fork(env?: any): Worker;
|
||||
/** @deprecated since v16.0.0 - use isPrimary. */
|
||||
readonly isMaster: boolean;
|
||||
readonly isPrimary: boolean;
|
||||
readonly isWorker: boolean;
|
||||
schedulingPolicy: number;
|
||||
readonly settings: ClusterSettings;
|
||||
/** @deprecated since v16.0.0 - use setupPrimary. */
|
||||
setupMaster(settings?: ClusterSettings): void;
|
||||
/**
|
||||
* `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings.
|
||||
*/
|
||||
setupPrimary(settings?: ClusterSettings): void;
|
||||
readonly worker?: Worker | undefined;
|
||||
readonly workers?: NodeJS.Dict<Worker> | undefined;
|
||||
readonly SCHED_NONE: number;
|
||||
readonly SCHED_RR: number;
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. disconnect
|
||||
* 2. exit
|
||||
* 3. fork
|
||||
* 4. listening
|
||||
* 5. message
|
||||
* 6. online
|
||||
* 7. setup
|
||||
*/
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: 'disconnect', listener: (worker: Worker) => void): this;
|
||||
addListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
addListener(event: 'fork', listener: (worker: Worker) => void): this;
|
||||
addListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
|
||||
addListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
addListener(event: 'online', listener: (worker: Worker) => void): this;
|
||||
addListener(event: 'setup', listener: (settings: ClusterSettings) => void): this;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: 'disconnect', worker: Worker): boolean;
|
||||
emit(event: 'exit', worker: Worker, code: number, signal: string): boolean;
|
||||
emit(event: 'fork', worker: Worker): boolean;
|
||||
emit(event: 'listening', worker: Worker, address: Address): boolean;
|
||||
emit(event: 'message', worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
|
||||
emit(event: 'online', worker: Worker): boolean;
|
||||
emit(event: 'setup', settings: ClusterSettings): boolean;
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: 'disconnect', listener: (worker: Worker) => void): this;
|
||||
on(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
on(event: 'fork', listener: (worker: Worker) => void): this;
|
||||
on(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
|
||||
on(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
on(event: 'online', listener: (worker: Worker) => void): this;
|
||||
on(event: 'setup', listener: (settings: ClusterSettings) => void): this;
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: 'disconnect', listener: (worker: Worker) => void): this;
|
||||
once(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
once(event: 'fork', listener: (worker: Worker) => void): this;
|
||||
once(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
|
||||
once(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
once(event: 'online', listener: (worker: Worker) => void): this;
|
||||
once(event: 'setup', listener: (settings: ClusterSettings) => void): this;
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: 'disconnect', listener: (worker: Worker) => void): this;
|
||||
prependListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
prependListener(event: 'fork', listener: (worker: Worker) => void): this;
|
||||
prependListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
|
||||
// the handle is a net.Socket or net.Server object, or undefined.
|
||||
prependListener(event: 'message', listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void): this;
|
||||
prependListener(event: 'online', listener: (worker: Worker) => void): this;
|
||||
prependListener(event: 'setup', listener: (settings: ClusterSettings) => void): this;
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: 'disconnect', listener: (worker: Worker) => void): this;
|
||||
prependOnceListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
prependOnceListener(event: 'fork', listener: (worker: Worker) => void): this;
|
||||
prependOnceListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this;
|
||||
// the handle is a net.Socket or net.Server object, or undefined.
|
||||
prependOnceListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;
|
||||
prependOnceListener(event: 'online', listener: (worker: Worker) => void): this;
|
||||
prependOnceListener(event: 'setup', listener: (settings: ClusterSettings) => void): this;
|
||||
}
|
||||
const cluster: Cluster;
|
||||
export default cluster;
|
||||
}
|
||||
declare module 'node:cluster' {
|
||||
export * from 'cluster';
|
||||
export { default as default } from 'cluster';
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"name": "socks",
|
||||
"private": false,
|
||||
"version": "2.7.1",
|
||||
"description": "Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.",
|
||||
"main": "build/index.js",
|
||||
"typings": "typings/index.d.ts",
|
||||
"homepage": "https://github.com/JoshGlazebrook/socks/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/JoshGlazebrook/socks.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/JoshGlazebrook/socks/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"socks",
|
||||
"proxy",
|
||||
"tor",
|
||||
"socks 4",
|
||||
"socks 5",
|
||||
"socks4",
|
||||
"socks5"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10.13.0",
|
||||
"npm": ">= 3.0.0"
|
||||
},
|
||||
"author": "Josh Glazebrook",
|
||||
"contributors": [
|
||||
"castorw"
|
||||
],
|
||||
"license": "MIT",
|
||||
"readmeFilename": "README.md",
|
||||
"devDependencies": {
|
||||
"@types/ip": "1.1.0",
|
||||
"@types/mocha": "^9.1.1",
|
||||
"@types/node": "^18.0.6",
|
||||
"@typescript-eslint/eslint-plugin": "^5.30.6",
|
||||
"@typescript-eslint/parser": "^5.30.6",
|
||||
"eslint": "^8.20.0",
|
||||
"mocha": "^10.0.0",
|
||||
"prettier": "^2.7.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"ip": "^2.0.0",
|
||||
"smart-buffer": "^4.2.0"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublish": "npm install -g typescript && npm run build",
|
||||
"test": "NODE_ENV=test mocha --recursive --require ts-node/register test/**/*.ts",
|
||||
"prettier": "prettier --write ./src/**/*.ts --config .prettierrc.yaml",
|
||||
"lint": "eslint 'src/**/*.ts'",
|
||||
"build": "rm -rf build typings && prettier --write ./src/**/*.ts --config .prettierrc.yaml && tsc -p ."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
let tty = require("tty")
|
||||
|
||||
let isColorSupported =
|
||||
!("NO_COLOR" in process.env || process.argv.includes("--no-color")) &&
|
||||
("FORCE_COLOR" in process.env ||
|
||||
process.argv.includes("--color") ||
|
||||
process.platform === "win32" ||
|
||||
(tty.isatty(1) && process.env.TERM !== "dumb") ||
|
||||
"CI" in process.env)
|
||||
|
||||
let formatter =
|
||||
(open, close, replace = open) =>
|
||||
input => {
|
||||
let string = "" + input
|
||||
let index = string.indexOf(close, open.length)
|
||||
return ~index
|
||||
? open + replaceClose(string, close, replace, index) + close
|
||||
: open + string + close
|
||||
}
|
||||
|
||||
let replaceClose = (string, close, replace, index) => {
|
||||
let start = string.substring(0, index) + replace
|
||||
let end = string.substring(index + close.length)
|
||||
let nextIndex = end.indexOf(close)
|
||||
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end
|
||||
}
|
||||
|
||||
let createColors = (enabled = isColorSupported) => ({
|
||||
isColorSupported: enabled,
|
||||
reset: enabled ? s => `\x1b[0m${s}\x1b[0m` : String,
|
||||
bold: enabled ? formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m") : String,
|
||||
dim: enabled ? formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m") : String,
|
||||
italic: enabled ? formatter("\x1b[3m", "\x1b[23m") : String,
|
||||
underline: enabled ? formatter("\x1b[4m", "\x1b[24m") : String,
|
||||
inverse: enabled ? formatter("\x1b[7m", "\x1b[27m") : String,
|
||||
hidden: enabled ? formatter("\x1b[8m", "\x1b[28m") : String,
|
||||
strikethrough: enabled ? formatter("\x1b[9m", "\x1b[29m") : String,
|
||||
black: enabled ? formatter("\x1b[30m", "\x1b[39m") : String,
|
||||
red: enabled ? formatter("\x1b[31m", "\x1b[39m") : String,
|
||||
green: enabled ? formatter("\x1b[32m", "\x1b[39m") : String,
|
||||
yellow: enabled ? formatter("\x1b[33m", "\x1b[39m") : String,
|
||||
blue: enabled ? formatter("\x1b[34m", "\x1b[39m") : String,
|
||||
magenta: enabled ? formatter("\x1b[35m", "\x1b[39m") : String,
|
||||
cyan: enabled ? formatter("\x1b[36m", "\x1b[39m") : String,
|
||||
white: enabled ? formatter("\x1b[37m", "\x1b[39m") : String,
|
||||
gray: enabled ? formatter("\x1b[90m", "\x1b[39m") : String,
|
||||
bgBlack: enabled ? formatter("\x1b[40m", "\x1b[49m") : String,
|
||||
bgRed: enabled ? formatter("\x1b[41m", "\x1b[49m") : String,
|
||||
bgGreen: enabled ? formatter("\x1b[42m", "\x1b[49m") : String,
|
||||
bgYellow: enabled ? formatter("\x1b[43m", "\x1b[49m") : String,
|
||||
bgBlue: enabled ? formatter("\x1b[44m", "\x1b[49m") : String,
|
||||
bgMagenta: enabled ? formatter("\x1b[45m", "\x1b[49m") : String,
|
||||
bgCyan: enabled ? formatter("\x1b[46m", "\x1b[49m") : String,
|
||||
bgWhite: enabled ? formatter("\x1b[47m", "\x1b[49m") : String,
|
||||
})
|
||||
|
||||
module.exports = createColors()
|
||||
module.exports.createColors = createColors
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"@types/http-cache-semantics","version":"4.0.1","files":{"LICENSE":{"checkedAt":1678883669855,"integrity":"sha512-HQaIQk9pwOcyKutyDk4o2a87WnotwYuLGYFW43emGm4FvIJFKPyg+OYaw5sTegKAKf+C5SKa1ACjzCLivbaHrQ==","mode":511,"size":1141},"README.md":{"checkedAt":1678883670957,"integrity":"sha512-+QCKa6F4mW+puU7LXQinmT+cbgYobWS2QOt2Vkwcp5wHFgjpXViuDboicfS+yyAuUOW2sE6Wwgd7P6EoPKRWbg==","mode":511,"size":556},"package.json":{"checkedAt":1678883670957,"integrity":"sha512-/gXXMmxoLtHteu2f9V050T3FYWSRPZ1TKiBS3AfqHP8DCAaOD6Zr7KYOCxkNF5rQb0WY2lBSwSl/YMYpoamu1w==","mode":511,"size":849},"index.d.ts":{"checkedAt":1678883670957,"integrity":"sha512-sIVuVHBGtbeS2JFgI/CWyN223LOG1BnyOtbXcx8TEj7QJXWUJVShsTb0QY6KlyHDWIbdVQYnUMYTxanwhWK9UQ==","mode":511,"size":7009}}}
|
||||
@@ -0,0 +1,29 @@
|
||||
// Credit:
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round
|
||||
// #Decimal_rounding
|
||||
|
||||
"use strict";
|
||||
|
||||
var isValue = require("../object/is-value")
|
||||
, ensureInteger = require("../object/ensure-integer");
|
||||
|
||||
var split = String.prototype.split;
|
||||
|
||||
module.exports = function (type) {
|
||||
return function (value /*, exp*/) {
|
||||
value = Number(value);
|
||||
var exp = arguments[1];
|
||||
if (isValue(exp)) exp = ensureInteger(exp);
|
||||
if (!value) return value;
|
||||
if (!exp) return Math[type](value);
|
||||
if (!isFinite(value)) return value;
|
||||
|
||||
// Shift
|
||||
var tokens = split.call(value, "e");
|
||||
value = Math[type](tokens[0] + "e" + ((tokens[1] || 0) - exp));
|
||||
|
||||
// Shift back
|
||||
tokens = value.toString().split("e");
|
||||
return Number(tokens[0] + "e" + (Number(tokens[1] || 0) + exp));
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"cryptoBrowser.js","sourceRoot":"","sources":["../src/cryptoBrowser.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAA8B;IAC/C,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,OAAO,IAAI,KAAK,QAAQ,IAAI,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;CAC5E,CAAC"}
|
||||
@@ -0,0 +1,50 @@
|
||||
import type {OmitIndexSignature} from './omit-index-signature';
|
||||
import type {PickIndexSignature} from './pick-index-signature';
|
||||
import type {EnforceOptional} from './enforce-optional';
|
||||
|
||||
// Merges two objects without worrying about index signatures or optional keys.
|
||||
type SimpleMerge<Destination, Source> = {
|
||||
[Key in keyof Destination | keyof Source]: Key extends keyof Source
|
||||
? Source[Key]
|
||||
: Key extends keyof Destination
|
||||
? Destination[Key]
|
||||
: never;
|
||||
};
|
||||
|
||||
/**
|
||||
Merge two types into a new type. Keys of the second type overrides keys of the first type.
|
||||
|
||||
@example
|
||||
```
|
||||
import type {Merge} from 'type-fest';
|
||||
|
||||
interface Foo {
|
||||
[x: string]: unknown;
|
||||
[x: number]: unknown;
|
||||
foo: string;
|
||||
bar: symbol;
|
||||
}
|
||||
|
||||
type Bar = {
|
||||
[x: number]: number;
|
||||
[x: symbol]: unknown;
|
||||
bar: Date;
|
||||
baz: boolean;
|
||||
};
|
||||
|
||||
export type FooBar = Merge<Foo, Bar>;
|
||||
// => {
|
||||
// [x: string]: unknown;
|
||||
// [x: number]: number;
|
||||
// [x: symbol]: unknown;
|
||||
// foo: string;
|
||||
// bar: Date;
|
||||
// baz: boolean;
|
||||
// }
|
||||
```
|
||||
|
||||
@category Object
|
||||
*/
|
||||
export type Merge<Destination, Source> = EnforceOptional<
|
||||
SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>>
|
||||
& SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
||||
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.applyMixins = void 0;
|
||||
function applyMixins(derivedCtor, baseCtors) {
|
||||
for (var i = 0, len = baseCtors.length; i < len; i++) {
|
||||
var baseCtor = baseCtors[i];
|
||||
var propertyKeys = Object.getOwnPropertyNames(baseCtor.prototype);
|
||||
for (var j = 0, len2 = propertyKeys.length; j < len2; j++) {
|
||||
var name_1 = propertyKeys[j];
|
||||
derivedCtor.prototype[name_1] = baseCtor.prototype[name_1];
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.applyMixins = applyMixins;
|
||||
//# sourceMappingURL=applyMixins.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"is-extglob","version":"2.1.1","files":{"README.md":{"checkedAt":1678883670844,"integrity":"sha512-gDyPl3DORgGje7yQETCFQgDVDoOPoe1xth/lH0wGOyxcb+ySEpB4kKV3geO0m3bl1B+9BTybJsLw0okFYi2Vtg==","mode":420,"size":3469},"LICENSE":{"checkedAt":1678883670844,"integrity":"sha512-lq7/KIS38aMUNN18NX4BP1tRi9ozEmtIXAwCCZTt5964lyrKnjs3PwB73ws2p7415zW1Y4DxV6wKHIE+Ggn+cg==","mode":420,"size":1087},"index.js":{"checkedAt":1678883670844,"integrity":"sha512-A595voDgHlPV1KV+Afwx/1MwnlT4wS6ivDeqij1VAouyWSTrWUaxCC09tt0tYKFu22BbSS9k7Bo1+5v5sjLk4A==","mode":420,"size":441},"package.json":{"checkedAt":1678883670844,"integrity":"sha512-qyiaS5IV5g5ro+KLaOO7DTtjZbD37KgX6ev5gSbA3Uiyqbgi2UN80jhRnlgCUCJYHitgpg7Bj/22l7qQUAcffg==","mode":420,"size":1220}}}
|
||||
@@ -0,0 +1,31 @@
|
||||
<script>export let handler;
|
||||
const rowsPerPage = handler.getRowsPerPage();
|
||||
const options = [5, 10, 20, 50, 100];
|
||||
</script>
|
||||
|
||||
|
||||
<aside>
|
||||
<span>{handler.i18n.show}</span>
|
||||
<select bind:value={$rowsPerPage} on:change={() => handler.setPage(1)}>
|
||||
{#each options as option}
|
||||
<option value={option}>
|
||||
{option}
|
||||
</option>
|
||||
{/each}
|
||||
</select>
|
||||
<span>{handler.i18n.entries}</span>
|
||||
</aside>
|
||||
|
||||
|
||||
<style>
|
||||
aside{
|
||||
display:flex;
|
||||
justify-content:flex-start;
|
||||
align-items: center;
|
||||
height:32px;
|
||||
color:#616161;
|
||||
}
|
||||
select{
|
||||
margin:0 4px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Some “list” response that can be paginated have a different response structure
|
||||
*
|
||||
* They have a `total_count` key in the response (search also has `incomplete_results`,
|
||||
* /installation/repositories also has `repository_selection`), as well as a key with
|
||||
* the list of the items which name varies from endpoint to endpoint.
|
||||
*
|
||||
* Octokit normalizes these responses so that paginated results are always returned following
|
||||
* the same structure. One challenge is that if the list response has only one page, no Link
|
||||
* header is provided, so this header alone is not sufficient to check wether a response is
|
||||
* paginated or not.
|
||||
*
|
||||
* We check if a "total_count" key is present in the response data, but also make sure that
|
||||
* a "url" property is not, as the "Get the combined status for a specific ref" endpoint would
|
||||
* otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref
|
||||
*/
|
||||
export function normalizePaginatedListResponse(response) {
|
||||
// endpoints can respond with 204 if repository is empty
|
||||
if (!response.data) {
|
||||
return {
|
||||
...response,
|
||||
data: [],
|
||||
};
|
||||
}
|
||||
const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
|
||||
if (!responseNeedsNormalization)
|
||||
return response;
|
||||
// keep the additional properties intact as there is currently no other way
|
||||
// to retrieve the same information.
|
||||
const incompleteResults = response.data.incomplete_results;
|
||||
const repositorySelection = response.data.repository_selection;
|
||||
const totalCount = response.data.total_count;
|
||||
delete response.data.incomplete_results;
|
||||
delete response.data.repository_selection;
|
||||
delete response.data.total_count;
|
||||
const namespaceKey = Object.keys(response.data)[0];
|
||||
const data = response.data[namespaceKey];
|
||||
response.data = data;
|
||||
if (typeof incompleteResults !== "undefined") {
|
||||
response.data.incomplete_results = incompleteResults;
|
||||
}
|
||||
if (typeof repositorySelection !== "undefined") {
|
||||
response.data.repository_selection = repositorySelection;
|
||||
}
|
||||
response.data.total_count = totalCount;
|
||||
return response;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
export default function stripFinalNewline(input) {
|
||||
const LF = typeof input === 'string' ? '\n' : '\n'.charCodeAt();
|
||||
const CR = typeof input === 'string' ? '\r' : '\r'.charCodeAt();
|
||||
|
||||
if (input[input.length - 1] === LF) {
|
||||
input = input.slice(0, -1);
|
||||
}
|
||||
|
||||
if (input[input.length - 1] === CR) {
|
||||
input = input.slice(0, -1);
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ToRawPrecision = void 0;
|
||||
var utils_1 = require("../utils");
|
||||
function ToRawPrecision(x, minPrecision, maxPrecision) {
|
||||
var p = maxPrecision;
|
||||
var m;
|
||||
var e;
|
||||
var xFinal;
|
||||
if (x === 0) {
|
||||
m = (0, utils_1.repeat)('0', p);
|
||||
e = 0;
|
||||
xFinal = 0;
|
||||
}
|
||||
else {
|
||||
var xToString = x.toString();
|
||||
// If xToString is formatted as scientific notation, the number is either very small or very
|
||||
// large. If the precision of the formatted string is lower that requested max precision, we
|
||||
// should still infer them from the formatted string, otherwise the formatted result might have
|
||||
// precision loss (e.g. 1e41 will not have 0 in every trailing digits).
|
||||
var xToStringExponentIndex = xToString.indexOf('e');
|
||||
var _a = xToString.split('e'), xToStringMantissa = _a[0], xToStringExponent = _a[1];
|
||||
var xToStringMantissaWithoutDecimalPoint = xToStringMantissa.replace('.', '');
|
||||
if (xToStringExponentIndex >= 0 &&
|
||||
xToStringMantissaWithoutDecimalPoint.length <= p) {
|
||||
e = +xToStringExponent;
|
||||
m =
|
||||
xToStringMantissaWithoutDecimalPoint +
|
||||
(0, utils_1.repeat)('0', p - xToStringMantissaWithoutDecimalPoint.length);
|
||||
xFinal = x;
|
||||
}
|
||||
else {
|
||||
e = (0, utils_1.getMagnitude)(x);
|
||||
var decimalPlaceOffset = e - p + 1;
|
||||
// n is the integer containing the required precision digits. To derive the formatted string,
|
||||
// we will adjust its decimal place in the logic below.
|
||||
var n = Math.round(adjustDecimalPlace(x, decimalPlaceOffset));
|
||||
// The rounding caused the change of magnitude, so we should increment `e` by 1.
|
||||
if (adjustDecimalPlace(n, p - 1) >= 10) {
|
||||
e = e + 1;
|
||||
// Divide n by 10 to swallow one precision.
|
||||
n = Math.floor(n / 10);
|
||||
}
|
||||
m = n.toString();
|
||||
// Equivalent of n * 10 ** (e - p + 1)
|
||||
xFinal = adjustDecimalPlace(n, p - 1 - e);
|
||||
}
|
||||
}
|
||||
var int;
|
||||
if (e >= p - 1) {
|
||||
m = m + (0, utils_1.repeat)('0', e - p + 1);
|
||||
int = e + 1;
|
||||
}
|
||||
else if (e >= 0) {
|
||||
m = "".concat(m.slice(0, e + 1), ".").concat(m.slice(e + 1));
|
||||
int = e + 1;
|
||||
}
|
||||
else {
|
||||
m = "0.".concat((0, utils_1.repeat)('0', -e - 1)).concat(m);
|
||||
int = 1;
|
||||
}
|
||||
if (m.indexOf('.') >= 0 && maxPrecision > minPrecision) {
|
||||
var cut = maxPrecision - minPrecision;
|
||||
while (cut > 0 && m[m.length - 1] === '0') {
|
||||
m = m.slice(0, -1);
|
||||
cut--;
|
||||
}
|
||||
if (m[m.length - 1] === '.') {
|
||||
m = m.slice(0, -1);
|
||||
}
|
||||
}
|
||||
return { formattedString: m, roundedNumber: xFinal, integerDigitsCount: int };
|
||||
// x / (10 ** magnitude), but try to preserve as much floating point precision as possible.
|
||||
function adjustDecimalPlace(x, magnitude) {
|
||||
return magnitude < 0 ? x * Math.pow(10, -magnitude) : x / Math.pow(10, magnitude);
|
||||
}
|
||||
}
|
||||
exports.ToRawPrecision = ToRawPrecision;
|
||||
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
|
||||
var mixin = require("../../object/mixin")
|
||||
, validFunction = require("../valid-function")
|
||||
, re = /^\s*function\s*([\0-')-\uffff]+)*\s*\(([\0-(*-\uffff]*)\)\s*\{/;
|
||||
|
||||
module.exports = function () {
|
||||
var match = String(validFunction(this)).match(re), fn;
|
||||
|
||||
// eslint-disable-next-line no-new-func
|
||||
fn = new Function(
|
||||
"fn",
|
||||
"return function " +
|
||||
match[1].trim() +
|
||||
"(" +
|
||||
match[2] +
|
||||
") { return fn.apply(this, arguments); };"
|
||||
)(this);
|
||||
try { mixin(fn, this); }
|
||||
catch (ignore) {}
|
||||
return fn;
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "@types/sass",
|
||||
"version": "1.43.1",
|
||||
"description": "TypeScript definitions for sass",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sass",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Alan Agius",
|
||||
"url": "https://github.com/alan-agius4",
|
||||
"githubUsername": "alan-agius4"
|
||||
},
|
||||
{
|
||||
"name": "Silas Rech",
|
||||
"url": "https://github.com/lenovouser",
|
||||
"githubUsername": "lenovouser"
|
||||
},
|
||||
{
|
||||
"name": "Justin Leider",
|
||||
"url": "https://github.com/jleider",
|
||||
"githubUsername": "jleider"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/sass"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "60487bf7a03449fb838c5300d57aba464ce51fa5c3412d5b93af8a4ed50ddd05",
|
||||
"typeScriptVersion": "3.8"
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
define(['exports', 'module'], function (exports, module) {
|
||||
'use strict';
|
||||
|
||||
module.exports = function (instance) {
|
||||
instance.registerHelper('log', function () /* message, options */{
|
||||
var args = [undefined],
|
||||
options = arguments[arguments.length - 1];
|
||||
for (var i = 0; i < arguments.length - 1; i++) {
|
||||
args.push(arguments[i]);
|
||||
}
|
||||
|
||||
var level = 1;
|
||||
if (options.hash.level != null) {
|
||||
level = options.hash.level;
|
||||
} else if (options.data && options.data.level != null) {
|
||||
level = options.data.level;
|
||||
}
|
||||
args[0] = level;
|
||||
|
||||
instance.log.apply(instance, args);
|
||||
});
|
||||
};
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvbG9nLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OzttQkFBZSxVQUFTLFFBQVEsRUFBRTtBQUNoQyxZQUFRLENBQUMsY0FBYyxDQUFDLEtBQUssRUFBRSxrQ0FBaUM7QUFDOUQsVUFBSSxJQUFJLEdBQUcsQ0FBQyxTQUFTLENBQUM7VUFDcEIsT0FBTyxHQUFHLFNBQVMsQ0FBQyxTQUFTLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQyxDQUFDO0FBQzVDLFdBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxTQUFTLENBQUMsTUFBTSxHQUFHLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRTtBQUM3QyxZQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO09BQ3pCOztBQUVELFVBQUksS0FBSyxHQUFHLENBQUMsQ0FBQztBQUNkLFVBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLElBQUksSUFBSSxFQUFFO0FBQzlCLGFBQUssR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQztPQUM1QixNQUFNLElBQUksT0FBTyxDQUFDLElBQUksSUFBSSxPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssSUFBSSxJQUFJLEVBQUU7QUFDckQsYUFBSyxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDO09BQzVCO0FBQ0QsVUFBSSxDQUFDLENBQUMsQ0FBQyxHQUFHLEtBQUssQ0FBQzs7QUFFaEIsY0FBUSxDQUFDLEdBQUcsTUFBQSxDQUFaLFFBQVEsRUFBUSxJQUFJLENBQUMsQ0FBQztLQUN2QixDQUFDLENBQUM7R0FDSiIsImZpbGUiOiJsb2cuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbihpbnN0YW5jZSkge1xuICBpbnN0YW5jZS5yZWdpc3RlckhlbHBlcignbG9nJywgZnVuY3Rpb24oLyogbWVzc2FnZSwgb3B0aW9ucyAqLykge1xuICAgIGxldCBhcmdzID0gW3VuZGVmaW5lZF0sXG4gICAgICBvcHRpb25zID0gYXJndW1lbnRzW2FyZ3VtZW50cy5sZW5ndGggLSAxXTtcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyZ3VtZW50cy5sZW5ndGggLSAxOyBpKyspIHtcbiAgICAgIGFyZ3MucHVzaChhcmd1bWVudHNbaV0pO1xuICAgIH1cblxuICAgIGxldCBsZXZlbCA9IDE7XG4gICAgaWYgKG9wdGlvbnMuaGFzaC5sZXZlbCAhPSBudWxsKSB7XG4gICAgICBsZXZlbCA9IG9wdGlvbnMuaGFzaC5sZXZlbDtcbiAgICB9IGVsc2UgaWYgKG9wdGlvbnMuZGF0YSAmJiBvcHRpb25zLmRhdGEubGV2ZWwgIT0gbnVsbCkge1xuICAgICAgbGV2ZWwgPSBvcHRpb25zLmRhdGEubGV2ZWw7XG4gICAgfVxuICAgIGFyZ3NbMF0gPSBsZXZlbDtcblxuICAgIGluc3RhbmNlLmxvZyguLi5hcmdzKTtcbiAgfSk7XG59XG4iXX0=
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').filter;
|
||||
@@ -0,0 +1,48 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
/**
|
||||
* Find the @config at-rule in the given CSS AST and return the relative path to the config file
|
||||
*
|
||||
* @param {import('postcss').Root} root
|
||||
* @param {import('postcss').Result} result
|
||||
*/
|
||||
export function findAtConfigPath(root, result) {
|
||||
let configPath = null
|
||||
let relativeTo = null
|
||||
|
||||
root.walkAtRules('config', (rule) => {
|
||||
relativeTo = rule.source?.input.file ?? result.opts.from ?? 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.isAbsolute(inputPath)) {
|
||||
throw rule.error('The `@config` directive cannot be used with an absolute path.')
|
||||
}
|
||||
|
||||
configPath = path.resolve(path.dirname(relativeTo), inputPath)
|
||||
if (!fs.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,24 @@
|
||||
import { innerFrom } from '../observable/innerFrom';
|
||||
import { operate } from '../util/lift';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
export function switchMap(project, resultSelector) {
|
||||
return operate((source, subscriber) => {
|
||||
let innerSubscriber = null;
|
||||
let index = 0;
|
||||
let isComplete = false;
|
||||
const checkComplete = () => isComplete && !innerSubscriber && subscriber.complete();
|
||||
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
||||
innerSubscriber === null || innerSubscriber === void 0 ? void 0 : innerSubscriber.unsubscribe();
|
||||
let innerIndex = 0;
|
||||
const outerIndex = index++;
|
||||
innerFrom(project(value, outerIndex)).subscribe((innerSubscriber = createOperatorSubscriber(subscriber, (innerValue) => subscriber.next(resultSelector ? resultSelector(value, innerValue, outerIndex, innerIndex++) : innerValue), () => {
|
||||
innerSubscriber = null;
|
||||
checkComplete();
|
||||
})));
|
||||
}, () => {
|
||||
isComplete = true;
|
||||
checkComplete();
|
||||
}));
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=switchMap.js.map
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('once', require('../once'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = rtrim;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function rtrim(str, chars) {
|
||||
(0, _assertString.default)(str);
|
||||
|
||||
if (chars) {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Escaping
|
||||
var pattern = new RegExp("[".concat(chars.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), "]+$"), 'g');
|
||||
return str.replace(pattern, '');
|
||||
} // Use a faster and more safe than regex trim method https://blog.stevenlevithan.com/archives/faster-trim-javascript
|
||||
|
||||
|
||||
var strIndex = str.length - 1;
|
||||
|
||||
while (/\s/.test(str.charAt(strIndex))) {
|
||||
strIndex -= 1;
|
||||
}
|
||||
|
||||
return str.slice(0, strIndex + 1);
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0.04606,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0.00329,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0.00329,"75":0,"76":0,"77":0,"78":0.00329,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0.00329,"100":0,"101":0,"102":0.00658,"103":0,"104":0.00329,"105":0.00329,"106":0.00329,"107":0.00329,"108":0.00987,"109":0.13489,"110":0.08883,"111":0.00329,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0.00987,"39":0,"40":0,"41":0,"42":0,"43":0.01316,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.00987,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0.00329,"57":0,"58":0,"59":0,"60":0.00329,"61":0,"62":0,"63":0.00329,"64":0.00329,"65":0.00329,"66":0.00329,"67":0,"68":0.00329,"69":0.00329,"70":0.00329,"71":0.00658,"72":0.00329,"73":0.00329,"74":0.00329,"75":0.00329,"76":0,"77":0.00329,"78":0.00658,"79":0.01974,"80":0.00329,"81":0.01316,"83":0.01316,"84":0.00329,"85":0.00658,"86":0.00658,"87":0.01645,"88":0.00987,"89":0.00329,"90":0.00329,"91":0.00329,"92":0.01645,"93":0.00329,"94":0.00329,"95":0.00987,"96":0.00987,"97":0.01316,"98":0.00987,"99":0.00658,"100":0.01645,"101":0.00329,"102":0.00987,"103":0.01974,"104":0.01645,"105":0.70406,"106":0.01316,"107":0.02303,"108":0.09212,"109":4.07302,"110":1.56604,"111":0.00329,"112":0.00329,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0.00329,"67":0.02632,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0.00329,"75":0,"76":0,"77":0,"78":0,"79":0.00658,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0.00329,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.00987,"94":0.11844,"95":0.11515,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0.00329,"79":0,"80":0,"81":0,"83":0,"84":0.00329,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00987,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0.00329,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0.02303,"108":0.02961,"109":0.27636,"110":0.33887},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.00329,"14":0.04935,"15":0.02303,_:"0","3.1":0,"3.2":0,"5.1":0.07896,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0,"13.1":0.00987,"14.1":0.08883,"15.1":0.00658,"15.2-15.3":0.00987,"15.4":0.02303,"15.5":0.12831,"15.6":0.44744,"16.0":0.01974,"16.1":0.16779,"16.2":0.4935,"16.3":0.2632,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00254,"6.0-6.1":0,"7.0-7.1":0.09385,"8.1-8.4":0,"9.0-9.2":0.00507,"9.3":0.05834,"10.0-10.2":0,"10.3":0.0558,"11.0-11.2":0.00761,"11.3-11.4":0.01268,"12.0-12.1":0.02029,"12.2-12.5":0.61636,"13.0-13.1":0.00761,"13.2":0.00761,"13.3":0.03551,"13.4-13.7":0.11161,"14.0-14.4":0.3196,"14.5-14.8":0.76602,"15.0-15.1":0.16233,"15.2-15.3":0.23589,"15.4":0.31706,"15.5":0.68992,"15.6":1.53711,"16.0":3.45215,"16.1":4.05837,"16.2":5.11608,"16.3":4.66205,"16.4":0.01522},P:{"4":0.08265,"20":0.87813,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.10331,"8.2":0,"9.2":0.02066,"10.1":0,"11.1-11.2":0.06199,"12.0":0.02066,"13.0":0.07232,"14.0":0.06199,"15.0":0.04132,"16.0":0.09298,"17.0":0.1343,"18.0":0.1343,"19.0":1.68394},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.00632,"4.2-4.3":0.00843,"4.4":0,"4.4.3-4.4.4":0.10118},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.02632,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.44286},H:{"0":0.38116},L:{"0":60.46988},R:{_:"0"},M:{"0":0.11407},Q:{"13.1":0}};
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "balanced-match",
|
||||
"description": "Match balanced character pairs, like \"{\" and \"}\"",
|
||||
"version": "1.0.2",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/juliangruber/balanced-match.git"
|
||||
},
|
||||
"homepage": "https://github.com/juliangruber/balanced-match",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "tape test/test.js",
|
||||
"bench": "matcha test/bench.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"matcha": "^0.7.0",
|
||||
"tape": "^4.6.0"
|
||||
},
|
||||
"keywords": [
|
||||
"match",
|
||||
"regexp",
|
||||
"test",
|
||||
"balanced",
|
||||
"parse"
|
||||
],
|
||||
"author": {
|
||||
"name": "Julian Gruber",
|
||||
"email": "mail@juliangruber.com",
|
||||
"url": "http://juliangruber.com"
|
||||
},
|
||||
"license": "MIT",
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": [
|
||||
"ie/8..latest",
|
||||
"firefox/20..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/25..latest",
|
||||
"chrome/canary",
|
||||
"opera/12..latest",
|
||||
"opera/next",
|
||||
"safari/5.1..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0.03589,"55":0,"56":0.04142,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0.01104,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0.00276,"104":0,"105":0,"106":0.19051,"107":0.01381,"108":0.02209,"109":0.07455,"110":0.19051,"111":0.00276,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0.01104,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0.02761,"70":0,"71":0,"72":0,"73":0,"74":0.00276,"75":0,"76":0,"77":0,"78":0.00276,"79":0,"80":0,"81":0.03313,"83":0,"84":0.00276,"85":0,"86":0,"87":0,"88":0.01381,"89":0,"90":0.00276,"91":0,"92":0,"93":0,"94":0.00276,"95":0,"96":0,"97":0.00276,"98":0,"99":0.01104,"100":0.02209,"101":0,"102":0.02209,"103":0.19879,"104":0,"105":0,"106":0.00828,"107":0,"108":0.10492,"109":2.80794,"110":1.39707,"111":0,"112":0,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0.02485,"68":0,"69":0,"70":0,"71":0,"72":0.00828,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.00828,"94":0.01104,"95":0,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0.00828},B:{"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0.01104,"79":0,"80":0,"81":0,"83":0,"84":0.00828,"85":0.01381,"86":0,"87":0,"88":0,"89":0.00828,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0.00828,"97":0,"98":0,"99":0.00276,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0.00828,"106":0.00276,"107":0.0497,"108":0.05798,"109":0.30095,"110":0.3755},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0,"13.1":0,"14.1":0.02485,"15.1":0,"15.2-15.3":0,"15.4":0,"15.5":0,"15.6":0.00276,"16.0":0,"16.1":0.01104,"16.2":0.05798,"16.3":0.14081,"16.4":0.00276},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01058,"10.0-10.2":0,"10.3":0.08555,"11.0-11.2":0,"11.3-11.4":0,"12.0-12.1":0,"12.2-12.5":0.01058,"13.0-13.1":0,"13.2":0.09613,"13.3":0,"13.4-13.7":0.06408,"14.0-14.4":0.16021,"14.5-14.8":0.14963,"15.0-15.1":0.03204,"15.2-15.3":0.14963,"15.4":0.16021,"15.5":0.18168,"15.6":0.3422,"16.0":0.20314,"16.1":0.2778,"16.2":0.22461,"16.3":0.90869,"16.4":0},P:{"4":0.10032,"20":0.05016,"5.0-5.4":0.35111,"6.2-6.4":0,"7.2-7.4":0.78246,"8.2":0,"9.2":0.03009,"10.1":0,"11.1-11.2":0.06019,"12.0":0,"13.0":0.08025,"14.0":0.03009,"15.0":0.10032,"16.0":0.3812,"17.0":0.04013,"18.0":0.14044,"19.0":0.53167},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00905,"4.4":0,"4.4.3-4.4.4":0.0996},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.04142,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.51397},H:{"0":0.40435},L:{"0":85.01169},R:{_:"0"},M:{"0":0.78905},Q:{"13.1":0}};
|
||||
@@ -0,0 +1,653 @@
|
||||
# before-after-hook
|
||||
|
||||
> asynchronous hooks for internal functionality
|
||||
|
||||
[](https://www.npmjs.com/package/before-after-hook)
|
||||
[](https://github.com/gr2m/before-after-hook/actions/workflows/test.yml)
|
||||
|
||||
## Usage
|
||||
|
||||
### Singular hook
|
||||
|
||||
```js
|
||||
// instantiate singular hook API
|
||||
const hook = new Hook.Singular();
|
||||
|
||||
// Create a hook
|
||||
function getData(options) {
|
||||
return hook(fetchFromDatabase, options)
|
||||
.then(handleData)
|
||||
.catch(handleGetError);
|
||||
}
|
||||
|
||||
// register before/error/after hooks.
|
||||
// The methods can be async or return a promise
|
||||
hook.before(beforeHook);
|
||||
hook.error(errorHook);
|
||||
hook.after(afterHook);
|
||||
|
||||
getData({ id: 123 });
|
||||
```
|
||||
|
||||
### Hook collection
|
||||
|
||||
```js
|
||||
// instantiate hook collection API
|
||||
const hookCollection = new Hook.Collection();
|
||||
|
||||
// Create a hook
|
||||
function getData(options) {
|
||||
return hookCollection("get", fetchFromDatabase, options)
|
||||
.then(handleData)
|
||||
.catch(handleGetError);
|
||||
}
|
||||
|
||||
// register before/error/after hooks.
|
||||
// The methods can be async or return a promise
|
||||
hookCollection.before("get", beforeHook);
|
||||
hookCollection.error("get", errorHook);
|
||||
hookCollection.after("get", afterHook);
|
||||
|
||||
getData({ id: 123 });
|
||||
```
|
||||
|
||||
### Hook.Singular vs Hook.Collection
|
||||
|
||||
There's no fundamental difference between the `Hook.Singular` and `Hook.Collection` hooks except for the fact that a hook from a collection requires you to pass along the name. Therefore the following explanation applies to both code snippets as described above.
|
||||
|
||||
The methods are executed in the following order
|
||||
|
||||
1. `beforeHook`
|
||||
2. `fetchFromDatabase`
|
||||
3. `afterHook`
|
||||
4. `handleData`
|
||||
|
||||
`beforeHook` can mutate `options` before it’s passed to `fetchFromDatabase`.
|
||||
|
||||
If an error is thrown in `beforeHook` or `fetchFromDatabase` then `errorHook` is
|
||||
called next.
|
||||
|
||||
If `afterHook` throws an error then `handleGetError` is called instead
|
||||
of `handleData`.
|
||||
|
||||
If `errorHook` throws an error then `handleGetError` is called next, otherwise
|
||||
`afterHook` and `handleData`.
|
||||
|
||||
You can also use `hook.wrap` to achieve the same thing as shown above (collection example):
|
||||
|
||||
```js
|
||||
hookCollection.wrap("get", async (getData, options) => {
|
||||
await beforeHook(options);
|
||||
|
||||
try {
|
||||
const result = getData(options);
|
||||
} catch (error) {
|
||||
await errorHook(error, options);
|
||||
}
|
||||
|
||||
await afterHook(result, options);
|
||||
});
|
||||
```
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
npm install before-after-hook
|
||||
```
|
||||
|
||||
Or download [the latest `before-after-hook.min.js`](https://github.com/gr2m/before-after-hook/releases/latest).
|
||||
|
||||
## API
|
||||
|
||||
- [Singular Hook Constructor](#singular-hook-api)
|
||||
- [Hook Collection Constructor](#hook-collection-api)
|
||||
|
||||
## Singular hook API
|
||||
|
||||
- [Singular constructor](#singular-constructor)
|
||||
- [hook.api](#singular-api)
|
||||
- [hook()](#singular-api)
|
||||
- [hook.before()](#singular-api)
|
||||
- [hook.error()](#singular-api)
|
||||
- [hook.after()](#singular-api)
|
||||
- [hook.wrap()](#singular-api)
|
||||
- [hook.remove()](#singular-api)
|
||||
|
||||
### Singular constructor
|
||||
|
||||
The `Hook.Singular` constructor has no options and returns a `hook` instance with the
|
||||
methods below:
|
||||
|
||||
```js
|
||||
const hook = new Hook.Singular();
|
||||
```
|
||||
|
||||
Using the singular hook is recommended for [TypeScript](#typescript)
|
||||
|
||||
### Singular API
|
||||
|
||||
The singular hook is a reference to a single hook. This means that there's no need to pass along any identifier (such as a `name` as can be seen in the [Hook.Collection API](#hookcollectionapi)).
|
||||
|
||||
The API of a singular hook is exactly the same as a collection hook and we therefore suggest you read the [Hook.Collection API](#hookcollectionapi) and leave out any use of the `name` argument. Just skip it like described in this example:
|
||||
|
||||
```js
|
||||
const hook = new Hook.Singular();
|
||||
|
||||
// good
|
||||
hook.before(beforeHook);
|
||||
hook.after(afterHook);
|
||||
hook(fetchFromDatabase, options);
|
||||
|
||||
// bad
|
||||
hook.before("get", beforeHook);
|
||||
hook.after("get", afterHook);
|
||||
hook("get", fetchFromDatabase, options);
|
||||
```
|
||||
|
||||
## Hook collection API
|
||||
|
||||
- [Collection constructor](#collection-constructor)
|
||||
- [hookCollection.api](#hookcollectionapi)
|
||||
- [hookCollection()](#hookcollection)
|
||||
- [hookCollection.before()](#hookcollectionbefore)
|
||||
- [hookCollection.error()](#hookcollectionerror)
|
||||
- [hookCollection.after()](#hookcollectionafter)
|
||||
- [hookCollection.wrap()](#hookcollectionwrap)
|
||||
- [hookCollection.remove()](#hookcollectionremove)
|
||||
|
||||
### Collection constructor
|
||||
|
||||
The `Hook.Collection` constructor has no options and returns a `hookCollection` instance with the
|
||||
methods below
|
||||
|
||||
```js
|
||||
const hookCollection = new Hook.Collection();
|
||||
```
|
||||
|
||||
### hookCollection.api
|
||||
|
||||
Use the `api` property to return the public API:
|
||||
|
||||
- [hookCollection.before()](#hookcollectionbefore)
|
||||
- [hookCollection.after()](#hookcollectionafter)
|
||||
- [hookCollection.error()](#hookcollectionerror)
|
||||
- [hookCollection.wrap()](#hookcollectionwrap)
|
||||
- [hookCollection.remove()](#hookcollectionremove)
|
||||
|
||||
That way you don’t need to expose the [hookCollection()](#hookcollection) method to consumers of your library
|
||||
|
||||
### hookCollection()
|
||||
|
||||
Invoke before and after hooks. Returns a promise.
|
||||
|
||||
```js
|
||||
hookCollection(nameOrNames, method /*, options */);
|
||||
```
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Argument</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Required</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<th align="left"><code>name</code></th>
|
||||
<td>String or Array of Strings</td>
|
||||
<td>Hook name, for example <code>'save'</code>. Or an array of names, see example below.</td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left"><code>method</code></th>
|
||||
<td>Function</td>
|
||||
<td>Callback to be executed after all before hooks finished execution successfully. <code>options</code> is passed as first argument</td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left"><code>options</code></th>
|
||||
<td>Object</td>
|
||||
<td>Will be passed to all before hooks as reference, so they can mutate it</td>
|
||||
<td>No, defaults to empty object (<code>{}</code>)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Resolves with whatever `method` returns or resolves with.
|
||||
Rejects with error that is thrown or rejected with by
|
||||
|
||||
1. Any of the before hooks, whichever rejects / throws first
|
||||
2. `method`
|
||||
3. Any of the after hooks, whichever rejects / throws first
|
||||
|
||||
Simple Example
|
||||
|
||||
```js
|
||||
hookCollection(
|
||||
"save",
|
||||
function (record) {
|
||||
return store.save(record);
|
||||
},
|
||||
record
|
||||
);
|
||||
// shorter: hookCollection('save', store.save, record)
|
||||
|
||||
hookCollection.before("save", function addTimestamps(record) {
|
||||
const now = new Date().toISOString();
|
||||
if (record.createdAt) {
|
||||
record.updatedAt = now;
|
||||
} else {
|
||||
record.createdAt = now;
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
Example defining multiple hooks at once.
|
||||
|
||||
```js
|
||||
hookCollection(
|
||||
["add", "save"],
|
||||
function (record) {
|
||||
return store.save(record);
|
||||
},
|
||||
record
|
||||
);
|
||||
|
||||
hookCollection.before("add", function addTimestamps(record) {
|
||||
if (!record.type) {
|
||||
throw new Error("type property is required");
|
||||
}
|
||||
});
|
||||
|
||||
hookCollection.before("save", function addTimestamps(record) {
|
||||
if (!record.type) {
|
||||
throw new Error("type property is required");
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
Defining multiple hooks is helpful if you have similar methods for which you want to define separate hooks, but also an additional hook that gets called for all at once. The example above is equal to this:
|
||||
|
||||
```js
|
||||
hookCollection(
|
||||
"add",
|
||||
function (record) {
|
||||
return hookCollection(
|
||||
"save",
|
||||
function (record) {
|
||||
return store.save(record);
|
||||
},
|
||||
record
|
||||
);
|
||||
},
|
||||
record
|
||||
);
|
||||
```
|
||||
|
||||
### hookCollection.before()
|
||||
|
||||
Add before hook for given name.
|
||||
|
||||
```js
|
||||
hookCollection.before(name, method);
|
||||
```
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Argument</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Required</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<th align="left"><code>name</code></th>
|
||||
<td>String</td>
|
||||
<td>Hook name, for example <code>'save'</code></td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left"><code>method</code></th>
|
||||
<td>Function</td>
|
||||
<td>
|
||||
Executed before the wrapped method. Called with the hook’s
|
||||
<code>options</code> argument. Before hooks can mutate the passed options
|
||||
before they are passed to the wrapped method.
|
||||
</td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Example
|
||||
|
||||
```js
|
||||
hookCollection.before("save", function validate(record) {
|
||||
if (!record.name) {
|
||||
throw new Error("name property is required");
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### hookCollection.error()
|
||||
|
||||
Add error hook for given name.
|
||||
|
||||
```js
|
||||
hookCollection.error(name, method);
|
||||
```
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Argument</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Required</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<th align="left"><code>name</code></th>
|
||||
<td>String</td>
|
||||
<td>Hook name, for example <code>'save'</code></td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left"><code>method</code></th>
|
||||
<td>Function</td>
|
||||
<td>
|
||||
Executed when an error occurred in either the wrapped method or a
|
||||
<code>before</code> hook. Called with the thrown <code>error</code>
|
||||
and the hook’s <code>options</code> argument. The first <code>method</code>
|
||||
which does not throw an error will set the result that the after hook
|
||||
methods will receive.
|
||||
</td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Example
|
||||
|
||||
```js
|
||||
hookCollection.error("save", function (error, options) {
|
||||
if (error.ignore) return;
|
||||
throw error;
|
||||
});
|
||||
```
|
||||
|
||||
### hookCollection.after()
|
||||
|
||||
Add after hook for given name.
|
||||
|
||||
```js
|
||||
hookCollection.after(name, method);
|
||||
```
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Argument</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Required</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<th align="left"><code>name</code></th>
|
||||
<td>String</td>
|
||||
<td>Hook name, for example <code>'save'</code></td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left"><code>method</code></th>
|
||||
<td>Function</td>
|
||||
<td>
|
||||
Executed after wrapped method. Called with what the wrapped method
|
||||
resolves with the hook’s <code>options</code> argument.
|
||||
</td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Example
|
||||
|
||||
```js
|
||||
hookCollection.after("save", function (result, options) {
|
||||
if (result.updatedAt) {
|
||||
app.emit("update", result);
|
||||
} else {
|
||||
app.emit("create", result);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### hookCollection.wrap()
|
||||
|
||||
Add wrap hook for given name.
|
||||
|
||||
```js
|
||||
hookCollection.wrap(name, method);
|
||||
```
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Argument</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Required</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<th align="left"><code>name</code></th>
|
||||
<td>String</td>
|
||||
<td>Hook name, for example <code>'save'</code></td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left"><code>method</code></th>
|
||||
<td>Function</td>
|
||||
<td>
|
||||
Receives both the wrapped method and the passed options as arguments so it can add logic before and after the wrapped method, it can handle errors and even replace the wrapped method altogether
|
||||
</td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Example
|
||||
|
||||
```js
|
||||
hookCollection.wrap("save", async function (saveInDatabase, options) {
|
||||
if (!record.name) {
|
||||
throw new Error("name property is required");
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await saveInDatabase(options);
|
||||
|
||||
if (result.updatedAt) {
|
||||
app.emit("update", result);
|
||||
} else {
|
||||
app.emit("create", result);
|
||||
}
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
if (error.ignore) return;
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
See also: [Test mock example](examples/test-mock-example.md)
|
||||
|
||||
### hookCollection.remove()
|
||||
|
||||
Removes hook for given name.
|
||||
|
||||
```js
|
||||
hookCollection.remove(name, hookMethod);
|
||||
```
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Argument</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Required</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<th align="left"><code>name</code></th>
|
||||
<td>String</td>
|
||||
<td>Hook name, for example <code>'save'</code></td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left"><code>beforeHookMethod</code></th>
|
||||
<td>Function</td>
|
||||
<td>
|
||||
Same function that was previously passed to <code>hookCollection.before()</code>, <code>hookCollection.error()</code>, <code>hookCollection.after()</code> or <code>hookCollection.wrap()</code>
|
||||
</td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Example
|
||||
|
||||
```js
|
||||
hookCollection.remove("save", validateRecord);
|
||||
```
|
||||
|
||||
## TypeScript
|
||||
|
||||
This library contains type definitions for TypeScript.
|
||||
|
||||
### Type support for `Singular`:
|
||||
|
||||
```ts
|
||||
import { Hook } from "before-after-hook";
|
||||
|
||||
type TOptions = { foo: string }; // type for options
|
||||
type TResult = { bar: number }; // type for result
|
||||
type TError = Error; // type for error
|
||||
|
||||
const hook = new Hook.Singular<TOptions, TResult, TError>();
|
||||
|
||||
hook.before((options) => {
|
||||
// `options.foo` has `string` type
|
||||
|
||||
// not allowed
|
||||
options.foo = 42;
|
||||
|
||||
// allowed
|
||||
options.foo = "Forty-Two";
|
||||
});
|
||||
|
||||
const hookedMethod = hook(
|
||||
(options) => {
|
||||
// `options.foo` has `string` type
|
||||
|
||||
// not allowed, because it does not satisfy the `R` type
|
||||
return { foo: 42 };
|
||||
|
||||
// allowed
|
||||
return { bar: 42 };
|
||||
},
|
||||
{ foo: "Forty-Two" }
|
||||
);
|
||||
```
|
||||
|
||||
You can choose not to pass the types for options, result or error. So, these are completely valid:
|
||||
|
||||
```ts
|
||||
const hook = new Hook.Singular<O, R>();
|
||||
const hook = new Hook.Singular<O>();
|
||||
const hook = new Hook.Singular();
|
||||
```
|
||||
|
||||
In these cases, the omitted types will implicitly be `any`.
|
||||
|
||||
### Type support for `Collection`:
|
||||
|
||||
`Collection` also has strict type support. You can use it like this:
|
||||
|
||||
```ts
|
||||
import { Hook } from "before-after-hook";
|
||||
|
||||
type HooksType = {
|
||||
add: {
|
||||
Options: { type: string };
|
||||
Result: { id: number };
|
||||
Error: Error;
|
||||
};
|
||||
save: {
|
||||
Options: { type: string };
|
||||
Result: { id: number };
|
||||
};
|
||||
read: {
|
||||
Options: { id: number; foo: number };
|
||||
};
|
||||
destroy: {
|
||||
Options: { id: number; foo: string };
|
||||
};
|
||||
};
|
||||
|
||||
const hooks = new Hook.Collection<HooksType>();
|
||||
|
||||
hooks.before("destroy", (options) => {
|
||||
// `options.id` has `number` type
|
||||
});
|
||||
|
||||
hooks.error("add", (err, options) => {
|
||||
// `options.type` has `string` type
|
||||
// `err` is `instanceof Error`
|
||||
});
|
||||
|
||||
hooks.error("save", (err, options) => {
|
||||
// `options.type` has `string` type
|
||||
// `err` has type `any`
|
||||
});
|
||||
|
||||
hooks.after("save", (result, options) => {
|
||||
// `options.type` has `string` type
|
||||
// `result.id` has `number` type
|
||||
});
|
||||
```
|
||||
|
||||
You can choose not to pass the types altogether. In that case, everything will implicitly be `any`:
|
||||
|
||||
```ts
|
||||
const hook = new Hook.Collection();
|
||||
```
|
||||
|
||||
Alternative imports:
|
||||
|
||||
```ts
|
||||
import { Singular, Collection } from "before-after-hook";
|
||||
|
||||
const hook = new Singular();
|
||||
const hooks = new Collection();
|
||||
```
|
||||
|
||||
## Upgrading to 1.4
|
||||
|
||||
Since version 1.4 the `Hook` constructor has been deprecated in favor of returning `Hook.Singular` in an upcoming breaking release.
|
||||
|
||||
Version 1.4 is still 100% backwards-compatible, but if you want to continue using hook collections, we recommend using the `Hook.Collection` constructor instead before the next release.
|
||||
|
||||
For even more details, check out [the PR](https://github.com/gr2m/before-after-hook/pull/52).
|
||||
|
||||
## See also
|
||||
|
||||
If `before-after-hook` is not for you, have a look at one of these alternatives:
|
||||
|
||||
- https://github.com/keystonejs/grappling-hook
|
||||
- https://github.com/sebelga/promised-hooks
|
||||
- https://github.com/bnoguchi/hooks-js
|
||||
- https://github.com/cb1kenobi/hook-emitter
|
||||
|
||||
## License
|
||||
|
||||
[Apache 2.0](LICENSE)
|
||||
@@ -0,0 +1,61 @@
|
||||
const U32_MASK64 = BigInt(2 ** 32 - 1);
|
||||
const _32n = BigInt(32);
|
||||
// We are not using BigUint64Array, because they are extremely slow as per 2022
|
||||
export function fromBig(n, le = false) {
|
||||
if (le)
|
||||
return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };
|
||||
return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
|
||||
}
|
||||
export function split(lst, le = false) {
|
||||
let Ah = new Uint32Array(lst.length);
|
||||
let Al = new Uint32Array(lst.length);
|
||||
for (let i = 0; i < lst.length; i++) {
|
||||
const { h, l } = fromBig(lst[i], le);
|
||||
[Ah[i], Al[i]] = [h, l];
|
||||
}
|
||||
return [Ah, Al];
|
||||
}
|
||||
export const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);
|
||||
// for Shift in [0, 32)
|
||||
const shrSH = (h, l, s) => h >>> s;
|
||||
const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);
|
||||
// Right rotate for Shift in [1, 32)
|
||||
const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));
|
||||
const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);
|
||||
// Right rotate for Shift in (32, 64), NOTE: 32 is special case.
|
||||
const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));
|
||||
const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));
|
||||
// Right rotate for shift===32 (just swaps l&h)
|
||||
const rotr32H = (h, l) => l;
|
||||
const rotr32L = (h, l) => h;
|
||||
// Left rotate for Shift in [1, 32)
|
||||
const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));
|
||||
const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));
|
||||
// Left rotate for Shift in (32, 64), NOTE: 32 is special case.
|
||||
const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));
|
||||
const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));
|
||||
// JS uses 32-bit signed integers for bitwise operations which means we cannot
|
||||
// simple take carry out of low bit sum by shift, we need to use division.
|
||||
// Removing "export" has 5% perf penalty -_-
|
||||
export function add(Ah, Al, Bh, Bl) {
|
||||
const l = (Al >>> 0) + (Bl >>> 0);
|
||||
return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };
|
||||
}
|
||||
// Addition with more than 2 elements
|
||||
const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
|
||||
const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;
|
||||
const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
|
||||
const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;
|
||||
const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
|
||||
const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;
|
||||
// prettier-ignore
|
||||
const u64 = {
|
||||
fromBig, split, toBig,
|
||||
shrSH, shrSL,
|
||||
rotrSH, rotrSL, rotrBH, rotrBL,
|
||||
rotr32H, rotr32L,
|
||||
rotlSH, rotlSL, rotlBH, rotlBL,
|
||||
add, add3L, add3H, add4L, add4H, add5H, add5L,
|
||||
};
|
||||
export default u64;
|
||||
//# sourceMappingURL=_u64.js.map
|
||||
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
var implementation = require('./implementation');
|
||||
|
||||
var zeroWidthSpace = '\u200b';
|
||||
var mongolianVowelSeparator = '\u180E';
|
||||
|
||||
module.exports = function getPolyfill() {
|
||||
if (
|
||||
String.prototype.trim
|
||||
&& zeroWidthSpace.trim() === zeroWidthSpace
|
||||
&& mongolianVowelSeparator.trim() === mongolianVowelSeparator
|
||||
&& ('_' + mongolianVowelSeparator).trim() === ('_' + mongolianVowelSeparator)
|
||||
&& (mongolianVowelSeparator + '_').trim() === (mongolianVowelSeparator + '_')
|
||||
) {
|
||||
return String.prototype.trim;
|
||||
}
|
||||
return implementation;
|
||||
};
|
||||
@@ -0,0 +1,67 @@
|
||||
// Limited implementation of python % string operator, supports only %s and %r for now
|
||||
// (other formats are not used here, but may appear in custom templates)
|
||||
|
||||
'use strict'
|
||||
|
||||
const { inspect } = require('util')
|
||||
|
||||
|
||||
module.exports = function sub(pattern, ...values) {
|
||||
let regex = /%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g
|
||||
|
||||
let result = pattern.replace(regex, function (_, is_literal, is_left_align, is_padded, name, format) {
|
||||
if (is_literal) return '%'
|
||||
|
||||
let padded_count = 0
|
||||
if (is_padded) {
|
||||
if (values.length === 0) throw new TypeError('not enough arguments for format string')
|
||||
padded_count = values.shift()
|
||||
if (!Number.isInteger(padded_count)) throw new TypeError('* wants int')
|
||||
}
|
||||
|
||||
let str
|
||||
if (name !== undefined) {
|
||||
let dict = values[0]
|
||||
if (typeof dict !== 'object' || dict === null) throw new TypeError('format requires a mapping')
|
||||
if (!(name in dict)) throw new TypeError(`no such key: '${name}'`)
|
||||
str = dict[name]
|
||||
} else {
|
||||
if (values.length === 0) throw new TypeError('not enough arguments for format string')
|
||||
str = values.shift()
|
||||
}
|
||||
|
||||
switch (format) {
|
||||
case 's':
|
||||
str = String(str)
|
||||
break
|
||||
case 'r':
|
||||
str = inspect(str)
|
||||
break
|
||||
case 'd':
|
||||
case 'i':
|
||||
if (typeof str !== 'number') {
|
||||
throw new TypeError(`%${format} format: a number is required, not ${typeof str}`)
|
||||
}
|
||||
str = String(str.toFixed(0))
|
||||
break
|
||||
default:
|
||||
throw new TypeError(`unsupported format character '${format}'`)
|
||||
}
|
||||
|
||||
if (padded_count > 0) {
|
||||
return is_left_align ? str.padEnd(padded_count) : str.padStart(padded_count)
|
||||
} else {
|
||||
return str
|
||||
}
|
||||
})
|
||||
|
||||
if (values.length) {
|
||||
if (values.length === 1 && typeof values[0] === 'object' && values[0] !== null) {
|
||||
// mapping
|
||||
} else {
|
||||
throw new TypeError('not all arguments converted during string formatting')
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/// <reference types="node" />
|
||||
import { Transform, TransformOptions, Readable } from "stream";
|
||||
import { CSVParseParam } from "./Parameters";
|
||||
import { ParseRuntime } from "./ParseRuntime";
|
||||
import CSVError from "./CSVError";
|
||||
export declare class Converter extends Transform implements PromiseLike<any[]> {
|
||||
options: TransformOptions;
|
||||
preRawData(onRawData: PreRawDataCallback): Converter;
|
||||
preFileLine(onFileLine: PreFileLineCallback): Converter;
|
||||
subscribe(onNext?: (data: any, lineNumber: number) => void | PromiseLike<void>, onError?: (err: CSVError) => void, onCompleted?: () => void): Converter;
|
||||
fromFile(filePath: string, options?: string | CreateReadStreamOption | undefined): Converter;
|
||||
fromStream(readStream: Readable): Converter;
|
||||
fromString(csvString: string): Converter;
|
||||
then<TResult1 = any[], TResult2 = never>(onfulfilled?: (value: any[]) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): PromiseLike<TResult1 | TResult2>;
|
||||
readonly parseParam: CSVParseParam;
|
||||
readonly parseRuntime: ParseRuntime;
|
||||
private params;
|
||||
private runtime;
|
||||
private processor;
|
||||
private result;
|
||||
constructor(param?: Partial<CSVParseParam>, options?: TransformOptions);
|
||||
_transform(chunk: any, encoding: string, cb: Function): void;
|
||||
_flush(cb: Function): void;
|
||||
private processEnd(cb);
|
||||
readonly parsedLineNumber: number;
|
||||
}
|
||||
export interface CreateReadStreamOption {
|
||||
flags?: string;
|
||||
encoding?: string;
|
||||
fd?: number;
|
||||
mode?: number;
|
||||
autoClose?: boolean;
|
||||
start?: number;
|
||||
end?: number;
|
||||
highWaterMark?: number;
|
||||
}
|
||||
export declare type CallBack = (err: Error, data: Array<any>) => void;
|
||||
export declare type PreFileLineCallback = (line: string, lineNumber: number) => string | PromiseLike<string>;
|
||||
export declare type PreRawDataCallback = (csvString: string) => string | PromiseLike<string>;
|
||||
@@ -0,0 +1,518 @@
|
||||
# Tinro Changelog
|
||||
|
||||
## 0.6.11 - 2022-02-03
|
||||
|
||||
### Other
|
||||
|
||||
- Merge branch 'master' of github.com:AlexxNB/tinro [`9f9f2d40`](https://github.com/AlexxNB/tinro/commit/9f9f2d40798e3b2ea213b710b81740119be3fd59)
|
||||
|
||||
### Chores
|
||||
|
||||
- Fix Breadcrumb type ([#103](https://github.com/AlexxNB/tinro/issues/103)) [`bc63d95d`](https://github.com/AlexxNB/tinro/commit/bc63d95d336cad36515a9f3777ccdeddeb408b6e)
|
||||
|
||||
*close #103*
|
||||
|
||||
### Tests
|
||||
|
||||
- Changing test environment [`60de58a4`](https://github.com/AlexxNB/tinro/commit/60de58a4ea96f1effa46dd4e4570420b362aeaf1)
|
||||
|
||||
## 0.6.10 - 2021-12-13
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix regexp for internal hashed links [`c72465c6`](https://github.com/AlexxNB/tinro/commit/c72465c6752fca5376f01bcaa26541ce68741459)
|
||||
|
||||
## 0.6.9 - 2021-12-13
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Internal hash-links on page does not work ([#99](https://github.com/AlexxNB/tinro/issues/99)) [`21fb1213`](https://github.com/AlexxNB/tinro/commit/21fb121378f1bbfe1884a3f42db1293acd7f7218)
|
||||
|
||||
*fix #99*
|
||||
|
||||
### Chores
|
||||
|
||||
- Update deps [`239c5d75`](https://github.com/AlexxNB/tinro/commit/239c5d75a59b9ab7b783097f930636ed675b1103)
|
||||
|
||||
## 0.6.8 - 2021-11-12
|
||||
|
||||
### Features
|
||||
|
||||
- Add reactive parameters for active action to update link's state when they change ([#87](https://github.com/AlexxNB/tinro/issues/87)) [`e611ad9f`](https://github.com/AlexxNB/tinro/commit/e611ad9fcc1eb0dbb541340ab3b035a9c623b353)
|
||||
|
||||
*close #87*
|
||||
|
||||
### Documentation
|
||||
|
||||
- 📝 Fix typo [`65ca1bee`](https://github.com/AlexxNB/tinro/commit/65ca1beeb38c131e83bedeff1869d7a52039ee98)
|
||||
|
||||
*Thx to @sevensidedmarble for its PR*
|
||||
|
||||
### Other
|
||||
|
||||
- Merge branch 'master' of github.com:AlexxNB/tinro [`35408142`](https://github.com/AlexxNB/tinro/commit/35408142fc0a2f10ae0f1fcd1e1ef8f4e1571963)
|
||||
|
||||
## 0.6.7 - 2021-09-03
|
||||
|
||||
### Features
|
||||
|
||||
- Add method to set base path for router ([#88](https://github.com/AlexxNB/tinro/issues/88)) [`d63dead7`](https://github.com/AlexxNB/tinro/commit/d63dead7be3a3bae181c51bf2e3df6cc0fecdfe9)
|
||||
|
||||
*resolve #88*
|
||||
|
||||
## 0.6.6 - 2021-08-18
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Links with query or fragments are not have active class [`ddb22286`](https://github.com/AlexxNB/tinro/commit/ddb222868da9a26376319c835763eab2deb6aa45)
|
||||
|
||||
*#85*
|
||||
- Unmounted routes not to be deleted from parent's active childs. [`bc0c210c`](https://github.com/AlexxNB/tinro/commit/bc0c210c6a8d0570d0d5e1ad65feba655c4e5d1a)
|
||||
|
||||
*#84*
|
||||
|
||||
### Other
|
||||
|
||||
- Merge pull request #83 from ItsiAdam/patch-1 ([#83](https://github.com/AlexxNB/tinro/issues/83)) [`d6549b97`](https://github.com/AlexxNB/tinro/commit/d6549b97d01484cfd071c33245b7340a4563c67c)
|
||||
|
||||
*fix typo :-)*
|
||||
- fix typo :-) [`03baf93c`](https://github.com/AlexxNB/tinro/commit/03baf93cba1b32e819255ba8a135a50d0f9c4f09)
|
||||
- Merge branch 'master' of github.com:AlexxNB/tinro [`23027a38`](https://github.com/AlexxNB/tinro/commit/23027a38c80bf4b10772d4ec1994220212349e55)
|
||||
|
||||
## 0.6.5 - 2021-07-22
|
||||
|
||||
### Chores
|
||||
|
||||
- ⬆️ Upgrade dependencies [`7329109d`](https://github.com/AlexxNB/tinro/commit/7329109da093994ee35443ed9f12e0df8d2fae15)
|
||||
|
||||
### Tests
|
||||
|
||||
- ✨ Use uvu for tests running [`94501da0`](https://github.com/AlexxNB/tinro/commit/94501da0310cf3317708e8f540c4ea79d6d2056d)
|
||||
|
||||
## 0.6.4 - 2021-05-06
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- 🏗 Create proto object for root and other routes [`8d23cff8`](https://github.com/AlexxNB/tinro/commit/8d23cff860b1a6dee114f713601c156bd9b3e9ea)
|
||||
|
||||
## 0.6.3 - 2021-05-06
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- 🏗 Add root component for all Routes, so no more any differences between root and nonrot routes [`b3cdb862`](https://github.com/AlexxNB/tinro/commit/b3cdb862fe4643cfa76f86b73484838a96355f76)
|
||||
|
||||
## 0.6.2 - 2021-05-06
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- 📝 Add forgeted link in table of content [`680c7c82`](https://github.com/AlexxNB/tinro/commit/680c7c8212f55032e3bea67e5dcb59fb84dd22b3)
|
||||
|
||||
### Documentation
|
||||
|
||||
- 📝 Add note for Vite users [`cdadf9f3`](https://github.com/AlexxNB/tinro/commit/cdadf9f3dafa2c274c238b54f1a4fd24a12060e3)
|
||||
- 📝 Add reciepe about announcer ([#60](https://github.com/AlexxNB/tinro/issues/60)) [`8829e6bc`](https://github.com/AlexxNB/tinro/commit/8829e6bcfc0df33240a0c212ba4b522fa1463d47)
|
||||
|
||||
*Thanks to @kindoflew*
|
||||
- 📝 Add notice about using meta() inside Route only [`bd2940de`](https://github.com/AlexxNB/tinro/commit/bd2940de42153fa29bd7e712c9ea401e4b007e0e)
|
||||
|
||||
### Other
|
||||
|
||||
- update versions [`f8a58a8d`](https://github.com/AlexxNB/tinro/commit/f8a58a8ddeef9b98ac33150bccef8b7cbda3d904)
|
||||
- Add test for conditional redirects [`42239e39`](https://github.com/AlexxNB/tinro/commit/42239e391cd6dcf61cbbc447eb81646fda493a31)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- Remove useless(i hope) tick in redirect [`d8e185ee`](https://github.com/AlexxNB/tinro/commit/d8e185eec5a703b368ff46eae676f57bfbd550b0)
|
||||
|
||||
## 0.6.1 - 2021-03-18
|
||||
|
||||
### Documentation
|
||||
|
||||
- 🚸 Add error message when use meta out of `Route` context. ([#58](https://github.com/AlexxNB/tinro/issues/58)) [`fc5d591b`](https://github.com/AlexxNB/tinro/commit/fc5d591bfa7cc2a2e3426c5c2d148bdc8d839dd6)
|
||||
|
||||
*[#58](https://github.com/AlexxNB/tinro/issues/58)*
|
||||
|
||||
### Other
|
||||
|
||||
- refactoring [`d2a818eb`](https://github.com/AlexxNB/tinro/commit/d2a818eb9c02a0598eee0c9e9ab3e260c2892439)
|
||||
|
||||
### Chores
|
||||
|
||||
- ⬆️ Upgrade [`88a04b26`](https://github.com/AlexxNB/tinro/commit/88a04b268cd19715ec8b257c74e3c3bb0122e2b0)
|
||||
|
||||
## 0.6.0 - 2021-03-06
|
||||
|
||||
### Features
|
||||
|
||||
- Add methods to set query and hash part of URL [`e84c4325`](https://github.com/AlexxNB/tinro/commit/e84c43259843445ded6cf00408ac684561b56c95)
|
||||
|
||||
## 0.5.15 - 2021-02-26
|
||||
|
||||
### Other
|
||||
|
||||
- refactroing merged PR workaround for redirects in hash mode [`3330c7de`](https://github.com/AlexxNB/tinro/commit/3330c7deddfec11bff37611c58a82e3292fd0919)
|
||||
|
||||
## 0.5.14 - 2021-02-26
|
||||
|
||||
### Other
|
||||
|
||||
- revert change to npmignore [`91413806`](https://github.com/AlexxNB/tinro/commit/91413806d0472d3257d0f9dd1bfa30b60befe367)
|
||||
- change to npmignore and gitignore [`7277b537`](https://github.com/AlexxNB/tinro/commit/7277b537609bec3ed2ce02f74299f3ec94c5480f)
|
||||
- removes dist files [`7c143dcf`](https://github.com/AlexxNB/tinro/commit/7c143dcf752f6342de0e71d9b4cdaf6b32e1f0d4)
|
||||
- build [`9439e9c5`](https://github.com/AlexxNB/tinro/commit/9439e9c5430b8531ac80b434e1c96f089f6d2704)
|
||||
- fix types, change goto behavior [`a349afcd`](https://github.com/AlexxNB/tinro/commit/a349afcd9709ef41ef61af0475e5d9f1086526e8)
|
||||
- Add "replace" option for routes (#1) [`d051eab3`](https://github.com/AlexxNB/tinro/commit/d051eab30a7f7957141c2d3dccc48ea010148129)
|
||||
|
||||
## 0.5.13 - 2021-02-25
|
||||
|
||||
### Other
|
||||
|
||||
- remove src from npmignore [`3e42a5f3`](https://github.com/AlexxNB/tinro/commit/3e42a5f34a6b94552d1eae29d44b613e8caf9300)
|
||||
- update deps [`6b2ec1a1`](https://github.com/AlexxNB/tinro/commit/6b2ec1a1585e3484ca277e81b7b721684a446587)
|
||||
- minor fixes [`36a64cab`](https://github.com/AlexxNB/tinro/commit/36a64cab857a1327008f1e4b3bae6fac0ea557ae)
|
||||
- Merge pull request #54 from mateomorris/master ([#54](https://github.com/AlexxNB/tinro/issues/54)) [`2c5b7484`](https://github.com/AlexxNB/tinro/commit/2c5b74840df973e4f1d1071c61ae1ea65d3fa4d3)
|
||||
|
||||
*Use 'meta' in example instead of 'params'*
|
||||
- Use 'meta' in example instead of 'params' [`01b840c6`](https://github.com/AlexxNB/tinro/commit/01b840c63d5d7c763804576c72719fe8a3aa022e)
|
||||
|
||||
## 0.5.12 - 2021-02-03
|
||||
|
||||
### Other
|
||||
|
||||
- separate meta from router [`7f6245c0`](https://github.com/AlexxNB/tinro/commit/7f6245c0916f519b932be7b5cc44b5f4cbc6dffc)
|
||||
|
||||
## 0.5.11 - 2021-01-29
|
||||
|
||||
### Other
|
||||
|
||||
- resolve [#50](https://github.com/AlexxNB/tinro/issues/50) ([#50](https://github.com/AlexxNB/tinro/issues/50)) [`823cdda0`](https://github.com/AlexxNB/tinro/commit/823cdda08091c0aa231419d3480fdd3975b3e84e)
|
||||
|
||||
## 0.5.10 - 2021-01-29
|
||||
|
||||
### Other
|
||||
|
||||
- fix [#50](https://github.com/AlexxNB/tinro/issues/50)#issuecomment-769808395 ([#50](https://github.com/AlexxNB/tinro/issues/50)) [`1af46ff0`](https://github.com/AlexxNB/tinro/commit/1af46ff061e74e28277773b56fe910ae4ee8cc7b)
|
||||
|
||||
## 0.5.9 - 2021-01-26
|
||||
|
||||
### Other
|
||||
|
||||
- resolve [#49](https://github.com/AlexxNB/tinro/issues/49) ([#49](https://github.com/AlexxNB/tinro/issues/49)) [`6ef56147`](https://github.com/AlexxNB/tinro/commit/6ef56147495cfac2d5cb911e61caed9a96c72d00)
|
||||
|
||||
## 0.5.8 - 2021-01-19
|
||||
|
||||
### Other
|
||||
|
||||
- fix parent in redirects [`cd481dca`](https://github.com/AlexxNB/tinro/commit/cd481dcadbcaaf8652ce99a0eb1163d02002ba22)
|
||||
- Merge pull request #48 from kindoflew/edit-readme ([#48](https://github.com/AlexxNB/tinro/issues/48)) [`a9526942`](https://github.com/AlexxNB/tinro/commit/a952694217e06d617a1a441048ff184718b66714)
|
||||
|
||||
*edit README and COMPARE*
|
||||
- edit README and COMPARE [`3adcf96c`](https://github.com/AlexxNB/tinro/commit/3adcf96c48211438a7095bc163c1cf217f12b29d)
|
||||
|
||||
## 0.5.7 - 2021-01-17
|
||||
|
||||
### Other
|
||||
|
||||
- make Route props reactive [`b095d10e`](https://github.com/AlexxNB/tinro/commit/b095d10e35c08ffa4f0375739bca65d31326c94b)
|
||||
|
||||
## 0.5.6 - 2021-01-08
|
||||
|
||||
### Other
|
||||
|
||||
- fix hash change listener [#42](https://github.com/AlexxNB/tinro/issues/42) ([#42](https://github.com/AlexxNB/tinro/issues/42)) [`495e294e`](https://github.com/AlexxNB/tinro/commit/495e294e71491785bfdb7e733cf271707875e71f)
|
||||
|
||||
## 0.5.5 - 2021-01-07
|
||||
|
||||
### Other
|
||||
|
||||
- fix format [`186782f0`](https://github.com/AlexxNB/tinro/commit/186782f07eb9e100c44c565b02265da0ac4995a5)
|
||||
|
||||
## 0.5.4 - 2021-01-07
|
||||
|
||||
### Other
|
||||
|
||||
- build correct module bundles [`754f4851`](https://github.com/AlexxNB/tinro/commit/754f48518e86065e6a49ab82c007c9e116a5c2ea)
|
||||
- add meta.query in contents [`dd96d17f`](https://github.com/AlexxNB/tinro/commit/dd96d17f936b9d365041ccc757e5c8e8db357424)
|
||||
|
||||
## 0.5.3 - 2021-01-04
|
||||
|
||||
### Other
|
||||
|
||||
- fix [`619f4ed2`](https://github.com/AlexxNB/tinro/commit/619f4ed26b010529dfb7a0fb3ea9725117aa5bf9)
|
||||
|
||||
## 0.5.2 - 2021-01-04
|
||||
|
||||
### Other
|
||||
|
||||
- refactoring [`10c925d9`](https://github.com/AlexxNB/tinro/commit/10c925d908ebcfb86b1a521c4fe4da6a8537c8cf)
|
||||
- added in memory navigation refactoring [`7474bce5`](https://github.com/AlexxNB/tinro/commit/7474bce5056d5149c5d8ab68360f3eda03bc1a29)
|
||||
- update API [`8fa450a8`](https://github.com/AlexxNB/tinro/commit/8fa450a8bc399e3dbc2ce9a539b123d50740bdab)
|
||||
|
||||
## 0.5.1 - 2021-01-02
|
||||
|
||||
### Other
|
||||
|
||||
- edit Readme [`a8245fa7`](https://github.com/AlexxNB/tinro/commit/a8245fa7ee52ec3140744706411b12d3354649f5)
|
||||
|
||||
## 0.5.0 - 2021-01-02
|
||||
|
||||
### Other
|
||||
|
||||
- new route meta data [`b7240a01`](https://github.com/AlexxNB/tinro/commit/b7240a01dab4ca510b0fd90fab098c5fc85757c5)
|
||||
|
||||
## 0.4.11 - 2021-01-02
|
||||
|
||||
### Other
|
||||
|
||||
- add params for slot definition [`273c2fdd`](https://github.com/AlexxNB/tinro/commit/273c2fdd46f38478d7ed7da9b535f1a74251eb17)
|
||||
|
||||
## 0.4.10 - 2020-12-30
|
||||
|
||||
### Other
|
||||
|
||||
- fix build [`a78de9f9`](https://github.com/AlexxNB/tinro/commit/a78de9f97066aecf8fc35a655aec8e97c0bcd7fb)
|
||||
|
||||
## 0.4.9 - 2020-12-30
|
||||
|
||||
### Other
|
||||
|
||||
- use esbuild for bundling instead rollup [`8f739831`](https://github.com/AlexxNB/tinro/commit/8f739831f9ae9a5e498f3cbda0f9dd3bc09a2f3c)
|
||||
- fix readme [`fd41f4a3`](https://github.com/AlexxNB/tinro/commit/fd41f4a3ec2f1f3c500032c51899e48a5c538f03)
|
||||
|
||||
## 0.4.8 - 2020-12-30
|
||||
|
||||
## 0.4.7 - 2020-12-30
|
||||
|
||||
### Other
|
||||
|
||||
- add firstmatch property resolve [#39](https://github.com/AlexxNB/tinro/issues/39) resolve [#31](https://github.com/AlexxNB/tinro/issues/31) resolve [#7](https://github.com/AlexxNB/tinro/issues/7) ([#39](https://github.com/AlexxNB/tinro/issues/39), [#31](https://github.com/AlexxNB/tinro/issues/31), [#7](https://github.com/AlexxNB/tinro/issues/7)) [`ec946494`](https://github.com/AlexxNB/tinro/commit/ec9464949b263de3f7723f7eb4800af25882fd7b)
|
||||
|
||||
## 0.4.6 - 2020-12-16
|
||||
|
||||
### Other
|
||||
|
||||
- fix links [`4978875d`](https://github.com/AlexxNB/tinro/commit/4978875d820010468a72c99730ba3f2faa6ba20d)
|
||||
|
||||
## 0.4.5 - 2020-12-09
|
||||
|
||||
### Other
|
||||
|
||||
- fix hashed links [`a416b2f8`](https://github.com/AlexxNB/tinro/commit/a416b2f8686e01cab26fbe1348bd86c41fee2838)
|
||||
|
||||
## 0.4.4 - 2020-12-09
|
||||
|
||||
### Other
|
||||
|
||||
- refactoring [`232eefeb`](https://github.com/AlexxNB/tinro/commit/232eefebbb831e0e21fc89ca4983b3daa8729522)
|
||||
- Merge pull request #30 from jacobmischka/fix-click-handler ([#30](https://github.com/AlexxNB/tinro/issues/30)) [`6eab81bb`](https://github.com/AlexxNB/tinro/commit/6eab81bb86931b49cff68606f74a6e3a785e47fb)
|
||||
|
||||
*Check for anchor before attempting to get href*
|
||||
- Check for anchor before attempting to get href [`073b8089`](https://github.com/AlexxNB/tinro/commit/073b8089714e742d67f7a00f8525c0d6e2c13c54)
|
||||
|
||||
## 0.4.3 - 2020-12-09
|
||||
|
||||
### Other
|
||||
|
||||
- fix relative links [`0cb4bd7e`](https://github.com/AlexxNB/tinro/commit/0cb4bd7eb2176b7bf2ac4ae279e450b4dd3452da)
|
||||
|
||||
## 0.4.2 - 2020-12-04
|
||||
|
||||
### Other
|
||||
|
||||
- add error messages [`5607bc7a`](https://github.com/AlexxNB/tinro/commit/5607bc7aa34b0416a4a8a6ac59f9af323b72fcf2)
|
||||
|
||||
## 0.4.1 - 2020-12-03
|
||||
|
||||
## 0.4.0 - 2020-12-03
|
||||
|
||||
### Other
|
||||
|
||||
- new routes matching conception [`a95094c0`](https://github.com/AlexxNB/tinro/commit/a95094c0215b9eccbb94550165df8bcdfe4754d1)
|
||||
|
||||
## 0.3.7 - 2020-09-30
|
||||
|
||||
### Other
|
||||
|
||||
- Merge pull request #26 from blissini/master ([#26](https://github.com/AlexxNB/tinro/issues/26)) [`95f4d393`](https://github.com/AlexxNB/tinro/commit/95f4d393efe53313c5bf5540dcc6bd4cb5fcedb8)
|
||||
|
||||
*fixed typos in README*
|
||||
|
||||
## 0.3.6 - 2020-09-30
|
||||
|
||||
### Other
|
||||
|
||||
- updtae Readme with key operator [`2f39df41`](https://github.com/AlexxNB/tinro/commit/2f39df41b9637ef8bfbe8432f5b75a7b639234f0)
|
||||
- update versions [`60cd977a`](https://github.com/AlexxNB/tinro/commit/60cd977ac2cf0711b8d72bd0370523958bf62806)
|
||||
- fixed some typos in README [`db37393e`](https://github.com/AlexxNB/tinro/commit/db37393e84110a3edd45bf875088809cb4e128ca)
|
||||
- Merge pull request #24 from AlexxNB/dependabot/npm_and_yarn/bl-4.0.3 ([#24](https://github.com/AlexxNB/tinro/issues/24)) [`ff68f135`](https://github.com/AlexxNB/tinro/commit/ff68f1356e23d6433241bbc2b303e2aec1b9c367)
|
||||
|
||||
*Bump bl from 4.0.2 to 4.0.3*
|
||||
- Bump bl from 4.0.2 to 4.0.3 [`1ba11784`](https://github.com/AlexxNB/tinro/commit/1ba11784100227b4575411d59109dfbcf0d48dd6)
|
||||
|
||||
*Bumps [bl](https://github.com/rvagg/bl) from 4.0.2 to 4.0.3. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](https://github.com/rvagg/bl/compare/v4.0.2...v4.0.3)*
|
||||
|
||||
## 0.3.5 - 2020-09-01
|
||||
|
||||
### Other
|
||||
|
||||
- oops [`1ec06fd1`](https://github.com/AlexxNB/tinro/commit/1ec06fd1ff3efbb39bbd5daab60439a5b9bca678)
|
||||
|
||||
## 0.3.4 - 2020-09-01
|
||||
|
||||
### Other
|
||||
|
||||
- type deffinition for the Router component [`d9effe09`](https://github.com/AlexxNB/tinro/commit/d9effe09ef0500f146c4501670f5a6ca03ac50b2)
|
||||
|
||||
## 0.3.3 - 2020-08-14
|
||||
|
||||
### Other
|
||||
|
||||
- fix [#16](https://github.com/AlexxNB/tinro/issues/16) ([#16](https://github.com/AlexxNB/tinro/issues/16)) [`4414f8ca`](https://github.com/AlexxNB/tinro/commit/4414f8ca44c568289c4ed3fcee52606361737a70)
|
||||
- update deps [`be3a6d4a`](https://github.com/AlexxNB/tinro/commit/be3a6d4a752380d55169adfffea4c68cc0a856d7)
|
||||
|
||||
## 0.3.2 - 2020-08-13
|
||||
|
||||
### Other
|
||||
|
||||
- update deps [`e3101958`](https://github.com/AlexxNB/tinro/commit/e310195840f971550003823c07249ed70437a5b6)
|
||||
|
||||
## 0.3.1 - 2020-07-29
|
||||
|
||||
### Other
|
||||
|
||||
- Merge pull request #19 from jnordberg/master ([#19](https://github.com/AlexxNB/tinro/issues/19)) [`e8f62c35`](https://github.com/AlexxNB/tinro/commit/e8f62c35e4685f475337f3128ba3986a396afabf)
|
||||
|
||||
*Improve TypeScript types*
|
||||
- Extension apparently has to be in separate declaration to be picked up [`503a9e3f`](https://github.com/AlexxNB/tinro/commit/503a9e3f3be2a523ba60606a35965ba8e50ab1f8)
|
||||
- Fix types [`1d33f7d5`](https://github.com/AlexxNB/tinro/commit/1d33f7d5f75ff60174fe5420faede85528c2c9cb)
|
||||
- add types [`f949285b`](https://github.com/AlexxNB/tinro/commit/f949285b0228da221bf3375b04bdcd15d9142c86)
|
||||
- add gzipped size in compare [`b53835d4`](https://github.com/AlexxNB/tinro/commit/b53835d4f36e7b0cea3ec0577b8bb3b366b44ae7)
|
||||
- add error handling [`4ed8f1ca`](https://github.com/AlexxNB/tinro/commit/4ed8f1ca2936263db2ddf73d0b66e35f6c029711)
|
||||
|
||||
## 0.3.0 - 2020-07-27
|
||||
|
||||
### Other
|
||||
|
||||
- add relative redirects [`6f34dd09`](https://github.com/AlexxNB/tinro/commit/6f34dd09745d4f8a68593da6a4457fd78ed56502)
|
||||
- huge refactoring, use store for routes logic [`f8eb0b7f`](https://github.com/AlexxNB/tinro/commit/f8eb0b7f95736532955078c3be1ac8d8fe1309e3)
|
||||
|
||||
## 0.2.10 - 2020-05-26
|
||||
|
||||
### Other
|
||||
|
||||
- fix [#15](https://github.com/AlexxNB/tinro/issues/15) ([#15](https://github.com/AlexxNB/tinro/issues/15)) [`0642b36f`](https://github.com/AlexxNB/tinro/commit/0642b36f1ab964ef02273da0fb9e1c769d555440)
|
||||
|
||||
## 0.2.9 - 2020-05-16
|
||||
|
||||
### Other
|
||||
|
||||
- remove browser bundle [`ed0bc4b5`](https://github.com/AlexxNB/tinro/commit/ed0bc4b5fd15456333c29cae0bd0b8a7383bcdc4)
|
||||
- Merge pull request #13 from ronthecookie/patch-1 ([#13](https://github.com/AlexxNB/tinro/issues/13)) [`9d07484a`](https://github.com/AlexxNB/tinro/commit/9d07484a3d77b4e666b527a2bb8bfea9d9c8f584)
|
||||
|
||||
*Fix typo in README*
|
||||
- Fix typo in README [`f0f6ace9`](https://github.com/AlexxNB/tinro/commit/f0f6ace9ac6c6f395ad85b53a669a79f622535ec)
|
||||
|
||||
## 0.2.8 - 2020-05-14
|
||||
|
||||
### Other
|
||||
|
||||
- fix [#12](https://github.com/AlexxNB/tinro/issues/12) ([#12](https://github.com/AlexxNB/tinro/issues/12)) [`49898c1d`](https://github.com/AlexxNB/tinro/commit/49898c1d7962d5fce0cbdcd2455c508481cb7bb1)
|
||||
|
||||
## 0.2.7 - 2020-05-12
|
||||
|
||||
### Other
|
||||
|
||||
- fix ignore attribute remove after first click [`6b5ad033`](https://github.com/AlexxNB/tinro/commit/6b5ad03374b5e19b215d6e733b27bc5d4f355de4)
|
||||
|
||||
## 0.2.6 - 2020-05-10
|
||||
|
||||
### Other
|
||||
|
||||
- add guarded routes recipe from [#9](https://github.com/AlexxNB/tinro/issues/9) ([#9](https://github.com/AlexxNB/tinro/issues/9)) [`575e332a`](https://github.com/AlexxNB/tinro/commit/575e332a0700f8d45d4867af70278380afad7bc8)
|
||||
|
||||
## 0.2.5 - 2020-05-09
|
||||
|
||||
### Other
|
||||
|
||||
- add tinro-ignore options propsed at [#11](https://github.com/AlexxNB/tinro/issues/11) ([#11](https://github.com/AlexxNB/tinro/issues/11)) [`cb9b844f`](https://github.com/AlexxNB/tinro/commit/cb9b844f9d15501aec444364ddf0a00869273c77)
|
||||
|
||||
## 0.2.4 - 2020-04-28
|
||||
|
||||
### Other
|
||||
|
||||
- add [#4](https://github.com/AlexxNB/tinro/issues/4) ([#4](https://github.com/AlexxNB/tinro/issues/4)) [`e35eacd1`](https://github.com/AlexxNB/tinro/commit/e35eacd1b942a79dcc15d16fa9720653eddb3f39)
|
||||
- More universal Lazy component [`dd4022e7`](https://github.com/AlexxNB/tinro/commit/dd4022e77e71af1a70cf9c696cc11f6a52b98a6a)
|
||||
- Merge pull request #6 from frederikhors/patch-2 ([#6](https://github.com/AlexxNB/tinro/issues/6)) [`160beebe`](https://github.com/AlexxNB/tinro/commit/160beebea4f1255a7239976b3ff085cd42f9c606)
|
||||
|
||||
*Misprints*
|
||||
- Merge pull request #5 from frederikhors/patch-1 ([#5](https://github.com/AlexxNB/tinro/issues/5)) [`908f82bf`](https://github.com/AlexxNB/tinro/commit/908f82bfe6e09f0bffb846bd71f6cd2285d0068b)
|
||||
|
||||
*Misprint*
|
||||
- Misprints [`55f8d8a6`](https://github.com/AlexxNB/tinro/commit/55f8d8a6e2932dc4b5d047edadcccb63cb131798)
|
||||
- Misprint [`285792fe`](https://github.com/AlexxNB/tinro/commit/285792fe89cfc8c36a49ff533af9c42637d4a670)
|
||||
- minor edits in readme [`9e40c0c8`](https://github.com/AlexxNB/tinro/commit/9e40c0c8729bd98a5092721cac9ec05d7b7b0ac7)
|
||||
- fix link [`eae49955`](https://github.com/AlexxNB/tinro/commit/eae499558f0fee83fa369d81ba98de6f704cb008)
|
||||
- fix typo [`4b1edab7`](https://github.com/AlexxNB/tinro/commit/4b1edab7466b6750da847adbce726ea0ee62d9ed)
|
||||
|
||||
## 0.2.3 - 2020-04-27
|
||||
|
||||
### Other
|
||||
|
||||
- Add recipies [`6649173b`](https://github.com/AlexxNB/tinro/commit/6649173b5d46f8be90c85b101eec4e9dcc72ead2)
|
||||
|
||||
## 0.2.2 - 2020-04-25
|
||||
|
||||
### Other
|
||||
|
||||
- fix, active action doesn't work with hashed style path [`dd3cb07d`](https://github.com/AlexxNB/tinro/commit/dd3cb07d0976fa24d9ce4763c68cf6c2e2efa700)
|
||||
- fix typo [`f4147883`](https://github.com/AlexxNB/tinro/commit/f4147883efae0d9843f3cce27d5a18283af5d806)
|
||||
|
||||
## 0.2.1 - 2020-04-25
|
||||
|
||||
### Other
|
||||
|
||||
- add active action to mark active links [`74bb6603`](https://github.com/AlexxNB/tinro/commit/74bb660397b6876955d62631a1dab810e4dbc381)
|
||||
- add tests [`758453a6`](https://github.com/AlexxNB/tinro/commit/758453a6bfeb83bfe68440fa0062317e167c119d)
|
||||
- fix build bage [`bd9221bf`](https://github.com/AlexxNB/tinro/commit/bd9221bfe0a7b075b2a8e704c2d708d267c432dd)
|
||||
- fix test [`e6ba03bb`](https://github.com/AlexxNB/tinro/commit/e6ba03bb78b09df125d83f9f9e042ef932f7aa56)
|
||||
- add badges [`df575f66`](https://github.com/AlexxNB/tinro/commit/df575f66958267d5b69a4e00f698fcfe4e0a64fb)
|
||||
- add REPL example [`cb5f6e38`](https://github.com/AlexxNB/tinro/commit/cb5f6e3898f53c6f83915c4d08360caedcd2cbd1)
|
||||
- add test for hash navigation [`296f8778`](https://github.com/AlexxNB/tinro/commit/296f87788e6ef28942f857a85f37f6a0d2cf22f4)
|
||||
- add hash feature in list [`d94717b0`](https://github.com/AlexxNB/tinro/commit/d94717b05e624b4af2b576bce93dbe69d6bbb276)
|
||||
|
||||
## 0.2.0 - 2020-04-18
|
||||
|
||||
### Other
|
||||
|
||||
- add hash navigation method [`aa762d19`](https://github.com/AlexxNB/tinro/commit/aa762d191def32f5f1498f1c37c11ece3dee4a89)
|
||||
- edit Readme [`1aee13cd`](https://github.com/AlexxNB/tinro/commit/1aee13cd6c53c2bfb2e786d17b98aad5fd678f79)
|
||||
- fix error message [`5238fb2b`](https://github.com/AlexxNB/tinro/commit/5238fb2b03fc83465a9e6e96c9a652adeab8c8b4)
|
||||
- impliment unholded rejection in script [`a7a0ba5d`](https://github.com/AlexxNB/tinro/commit/a7a0ba5d8d41654afe22bfe9fa14046fdfb1d3b5)
|
||||
- fix unkilled dev server [`caa51846`](https://github.com/AlexxNB/tinro/commit/caa518466080edd78e00d99f940fd74d0a01961f)
|
||||
- fail test on error with promises [`134a40b2`](https://github.com/AlexxNB/tinro/commit/134a40b2887433c7f0a321a73345806caa5d568e)
|
||||
- add npm publish workflow [`084170d9`](https://github.com/AlexxNB/tinro/commit/084170d90fd34fb98b99c67f5e714169a3daccb5)
|
||||
- fix import for Route [`110aae33`](https://github.com/AlexxNB/tinro/commit/110aae3313da8eac89cba0a28a0fc6750f065cad)
|
||||
- add table of contents [`58b8e5bb`](https://github.com/AlexxNB/tinro/commit/58b8e5bb8abcd66e0c8b565bc27886bbf1f29223)
|
||||
- add install chapter [`0566a886`](https://github.com/AlexxNB/tinro/commit/0566a8864b5de3e4200be8fb4c3ad5e94a079ab1)
|
||||
- add readme [`b21c2fd6`](https://github.com/AlexxNB/tinro/commit/b21c2fd6aa2e8607e5c8616b2b6168f1539f33e7)
|
||||
- add fallback tests [`26e1d8ec`](https://github.com/AlexxNB/tinro/commit/26e1d8ec9f43b3e634c19c7496acb8100137a5f4)
|
||||
- add links test [`8544cad1`](https://github.com/AlexxNB/tinro/commit/8544cad1cf2a3522b1f53213eb9864f686c30e3b)
|
||||
- add helpers in page object [`1bcb3754`](https://github.com/AlexxNB/tinro/commit/1bcb3754efa115df5d4d32b35f724f7477640114)
|
||||
- add some tests [`5c749e36`](https://github.com/AlexxNB/tinro/commit/5c749e3698fd98050df8cb967cc998c994f84f65)
|
||||
- new tests stack using tape-modern+puppeteer [`148e0940`](https://github.com/AlexxNB/tinro/commit/148e0940335a9c94d419145b0f197176811bd6df)
|
||||
- Move redirect to separate test [`f8e0eafb`](https://github.com/AlexxNB/tinro/commit/f8e0eafb57266307266d4a3244d2dff0255ab8eb)
|
||||
- make compare result generation [`45743cf1`](https://github.com/AlexxNB/tinro/commit/45743cf12e5fb5576d7e76017929aeb9118c131b)
|
||||
- add test for page loading [`1113a4b0`](https://github.com/AlexxNB/tinro/commit/1113a4b0e7f2d3828379f9f994798ae398677b2e)
|
||||
- break test on pieces in set directory [`df6d3c2b`](https://github.com/AlexxNB/tinro/commit/df6d3c2bf5bdb4accbeb03cfa7a730b1ff18021c)
|
||||
- setup test tooling [`38ecfce6`](https://github.com/AlexxNB/tinro/commit/38ecfce6913aa00316e6e34b8197e6eb2c6d9b46)
|
||||
- compare setup to determine the value of the tinro [`6ca0989a`](https://github.com/AlexxNB/tinro/commit/6ca0989a82b1830961935f5bbec7f08f8223dcd6)
|
||||
- add some tests [`9236630d`](https://github.com/AlexxNB/tinro/commit/9236630da261a5324199886707b68a98fa79b5d5)
|
||||
- fix non exact redirects [`66ce24e1`](https://github.com/AlexxNB/tinro/commit/66ce24e11f9db4d26ad22c2c290b5fdfb3773e55)
|
||||
- fix redirect [`3a0f1727`](https://github.com/AlexxNB/tinro/commit/3a0f1727dce6662abadff5518dae64da4a877e3e)
|
||||
- add redirect property [`86804cca`](https://github.com/AlexxNB/tinro/commit/86804cca7a7c700514f8cca4fceabf4043791478)
|
||||
- remove test bundles from git [`84a70394`](https://github.com/AlexxNB/tinro/commit/84a703941e2699c91c1cd71358d806f1b3fadd9b)
|
||||
- add params in router [`a6bcb8ae`](https://github.com/AlexxNB/tinro/commit/a6bcb8ae6a64b20d53fa6a7942156031d831a470)
|
||||
- some refactoring [`e3bec591`](https://github.com/AlexxNB/tinro/commit/e3bec59181670cb5a3ec43959f6f268c1db90609)
|
||||
- rebrending [`3dd8f2b9`](https://github.com/AlexxNB/tinro/commit/3dd8f2b9ce930d75cfca3aa13814421a96267b2e)
|
||||
- initial commit [`d192b741`](https://github.com/AlexxNB/tinro/commit/d192b741306d5ee9a6ce1590379c73548bb8716c)
|
||||
- Initial commit [`c9a025a2`](https://github.com/AlexxNB/tinro/commit/c9a025a21b61201326271e0a93767bf0e7bfd60f)
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../../../src/internal/operators/timestamp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAkC5B,MAAM,UAAU,SAAS,CAAI,iBAA4D;IAA5D,kCAAA,EAAA,yCAA4D;IACvF,OAAO,GAAG,CAAC,UAAC,KAAQ,IAAK,OAAA,CAAC,EAAE,KAAK,OAAA,EAAE,SAAS,EAAE,iBAAiB,CAAC,GAAG,EAAE,EAAE,CAAC,EAA/C,CAA+C,CAAC,CAAC;AAC5E,CAAC"}
|
||||
@@ -0,0 +1,52 @@
|
||||
'use strict';
|
||||
|
||||
/* eslint no-invalid-this: 1 */
|
||||
|
||||
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
||||
var slice = Array.prototype.slice;
|
||||
var toStr = Object.prototype.toString;
|
||||
var funcType = '[object Function]';
|
||||
|
||||
module.exports = function bind(that) {
|
||||
var target = this;
|
||||
if (typeof target !== 'function' || toStr.call(target) !== funcType) {
|
||||
throw new TypeError(ERROR_MESSAGE + target);
|
||||
}
|
||||
var args = slice.call(arguments, 1);
|
||||
|
||||
var bound;
|
||||
var binder = function () {
|
||||
if (this instanceof bound) {
|
||||
var result = target.apply(
|
||||
this,
|
||||
args.concat(slice.call(arguments))
|
||||
);
|
||||
if (Object(result) === result) {
|
||||
return result;
|
||||
}
|
||||
return this;
|
||||
} else {
|
||||
return target.apply(
|
||||
that,
|
||||
args.concat(slice.call(arguments))
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
var boundLength = Math.max(0, target.length - args.length);
|
||||
var boundArgs = [];
|
||||
for (var i = 0; i < boundLength; i++) {
|
||||
boundArgs.push('$' + i);
|
||||
}
|
||||
|
||||
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
|
||||
|
||||
if (target.prototype) {
|
||||
var Empty = function Empty() {};
|
||||
Empty.prototype = target.prototype;
|
||||
bound.prototype = new Empty();
|
||||
Empty.prototype = null;
|
||||
}
|
||||
|
||||
return bound;
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
import assertString from './util/assertString';
|
||||
export default function isWhitelisted(str, chars) {
|
||||
assertString(str);
|
||||
|
||||
for (var i = str.length - 1; i >= 0; i--) {
|
||||
if (chars.indexOf(str[i]) === -1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for csv2json/libs/csv2json.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</a> csv2json.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/3</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>0/0</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>0/0</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>0/3</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></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">//deprecated but leave it for backward compatibility
|
||||
<span class="cstat-no" title="statement not covered" >module.exports.core=require("./core");</span>
|
||||
|
||||
//live apis
|
||||
<span class="cstat-no" title="statement not covered" >module.exports=require("./core");</span>
|
||||
<span class="cstat-no" title="statement not covered" >module.exports.interfaces = require("./interfaces");</span>
|
||||
</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:20:20 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,99 @@
|
||||
# 1.1.2
|
||||
- add `Func.memoize`
|
||||
- fix `zip-all` and `zip-with-all` corner case (no input)
|
||||
- build with LiveScript 1.4.0
|
||||
|
||||
# 1.1.1
|
||||
- curry `unique-by`, `minimum-by`
|
||||
|
||||
# 1.1.0
|
||||
- added `List` functions: `maximum-by`, `minimum-by`, `unique-by`
|
||||
- added `List` functions: `at`, `elem-index`, `elem-indices`, `find-index`, `find-indices`
|
||||
- added `Str` functions: `capitalize`, `camelize`, `dasherize`
|
||||
- added `Func` function: `over` - eg. ``same-length = (==) `over` (.length)``
|
||||
- exported `Str.repeat` through main `prelude` object
|
||||
- fixed definition of `foldr` and `foldr1`, the new correct definition is backwards incompatible with the old, incorrect one
|
||||
- fixed issue with `fix`
|
||||
- improved code coverage
|
||||
|
||||
# 1.0.3
|
||||
- build browser versions
|
||||
|
||||
# 1.0.2
|
||||
- bug fix for `flatten` - slight change with bug fix, flattens arrays only, not array-like objects
|
||||
|
||||
# 1.0.1
|
||||
- bug fixes for `drop-while` and `take-while`
|
||||
|
||||
# 1.0.0
|
||||
* massive update - separated functions into separate modules
|
||||
* functions do not accept multiple types anymore - use different versions in their respective modules in some cases (eg. `Obj.map`), or use `chars` or `values` in other cases to transform into a list
|
||||
* objects are no longer transformed into functions, simply use `(obj.)` in LiveScript to do that
|
||||
* browser version now using browserify - use `prelude = require('prelude-ls')`
|
||||
* added `compact`, `split`, `flatten`, `difference`, `intersection`, `union`, `count-by`, `group-by`, `chars`, `unchars`, `apply`
|
||||
* added `lists-to-obj` which takes a list of keys and list of values and zips them up into an object, and the converse `obj-to-lists`
|
||||
* added `pairs-to-obj` which takes a list of pairs (2 element lists) and creates an object, and the converse `obj-to-pairs`
|
||||
* removed `cons`, `append` - use the concat operator
|
||||
* removed `compose` - use the compose operator
|
||||
* removed `obj-to-func` - use partially applied access (eg. `(obj.)`)
|
||||
* removed `length` - use `(.length)`
|
||||
* `sort-by` renamed to `sort-with`
|
||||
* added new `sort-by`
|
||||
* removed `compare` - just use the new `sort-by`
|
||||
* `break-it` renamed `break-list`, (`Str.break-str` for the string version)
|
||||
* added `Str.repeat` which creates a new string by repeating the input n times
|
||||
* `unfold` as alias to `unfoldr` is no longer used
|
||||
* fixed up style and compiled with LiveScript 1.1.1
|
||||
* use Make instead of Slake
|
||||
* greatly improved tests
|
||||
|
||||
# 0.6.0
|
||||
* fixed various bugs
|
||||
* added `fix`, a fixpoint (Y combinator) for anonymous recursive functions
|
||||
* added `unfoldr` (alias `unfold`)
|
||||
* calling `replicate` with a string now returns a list of strings
|
||||
* removed `partial`, just use native partial application in LiveScript using the `_` placeholder, or currying
|
||||
* added `sort`, `sortBy`, and `compare`
|
||||
|
||||
# 0.5.0
|
||||
* removed `lookup` - use (.prop)
|
||||
* removed `call` - use (.func arg1, arg2)
|
||||
* removed `pluck` - use map (.prop), xs
|
||||
* fixed buys wtih `head` and `last`
|
||||
* added non-minifed browser version, as `prelude-browser.js`
|
||||
* renamed `prelude-min.js` to `prelude-browser-min.js`
|
||||
* renamed `zip` to `zipAll`
|
||||
* renamed `zipWith` to `zipAllWith`
|
||||
* added `zip`, a curried zip that takes only two arguments
|
||||
* added `zipWith`, a curried zipWith that takes only two arguments
|
||||
|
||||
# 0.4.0
|
||||
* added `parition` function
|
||||
* added `curry` function
|
||||
* removed `elem` function (use `in`)
|
||||
* removed `notElem` function (use `not in`)
|
||||
|
||||
# 0.3.0
|
||||
* added `listToObject`
|
||||
* added `unique`
|
||||
* added `objToFunc`
|
||||
* added support for using strings in map and the like
|
||||
* added support for using objects in map and the like
|
||||
* added ability to use objects instead of functions in certain cases
|
||||
* removed `error` (just use throw)
|
||||
* added `tau` constant
|
||||
* added `join`
|
||||
* added `values`
|
||||
* added `keys`
|
||||
* added `partial`
|
||||
* renamed `log` to `ln`
|
||||
* added alias to `head`: `first`
|
||||
* added `installPrelude` helper
|
||||
|
||||
# 0.2.0
|
||||
* removed functions that simply warp operators as you can now use operators as functions in LiveScript
|
||||
* `min/max` are now curried and take only 2 arguments
|
||||
* added `call`
|
||||
|
||||
# 0.1.0
|
||||
* initial public release
|
||||
@@ -0,0 +1,22 @@
|
||||
import { identity } from '../util/identity';
|
||||
import { operate } from '../util/lift';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
export function distinctUntilChanged(comparator, keySelector = identity) {
|
||||
comparator = comparator !== null && comparator !== void 0 ? comparator : defaultCompare;
|
||||
return operate((source, subscriber) => {
|
||||
let previousKey;
|
||||
let first = true;
|
||||
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
||||
const currentKey = keySelector(value);
|
||||
if (first || !comparator(previousKey, currentKey)) {
|
||||
first = false;
|
||||
previousKey = currentKey;
|
||||
subscriber.next(value);
|
||||
}
|
||||
}));
|
||||
});
|
||||
}
|
||||
function defaultCompare(a, b) {
|
||||
return a === b;
|
||||
}
|
||||
//# sourceMappingURL=distinctUntilChanged.js.map
|
||||
@@ -0,0 +1,4 @@
|
||||
export type RunnerEmailNeededError = {
|
||||
name: string;
|
||||
message: string;
|
||||
};
|
||||
@@ -0,0 +1,2 @@
|
||||
# [SheetJS js-word](http://wordjs.com)
|
||||
|
||||
Reference in New Issue
Block a user