new license file version [CI SKIP]

This commit is contained in:
2023-03-15 12:34:41 +00:00
parent 0a6d92a1f3
commit 61328d20ed
13115 changed files with 1892314 additions and 1 deletions

View File

@@ -0,0 +1,134 @@
import { Observable } from '../Observable';
import { Subject } from '../Subject';
import { Subscription } from '../Subscription';
import { ObservableInput, OperatorFunction } from '../types';
import { operate } from '../util/lift';
import { innerFrom } from '../observable/innerFrom';
import { createOperatorSubscriber } from './OperatorSubscriber';
import { noop } from '../util/noop';
import { arrRemove } from '../util/arrRemove';
/**
* Branch out the source Observable values as a nested Observable starting from
* an emission from `openings` and ending when the output of `closingSelector`
* emits.
*
* <span class="informal">It's like {@link bufferToggle}, but emits a nested
* Observable instead of an array.</span>
*
* ![](windowToggle.png)
*
* Returns an Observable that emits windows of items it collects from the source
* Observable. The output Observable emits windows that contain those items
* emitted by the source Observable between the time when the `openings`
* Observable emits an item and when the Observable returned by
* `closingSelector` emits an item.
*
* ## Example
*
* Every other second, emit the click events from the next 500ms
*
* ```ts
* import { fromEvent, interval, windowToggle, EMPTY, mergeAll } from 'rxjs';
*
* const clicks = fromEvent(document, 'click');
* const openings = interval(1000);
* const result = clicks.pipe(
* windowToggle(openings, i => i % 2 ? interval(500) : EMPTY),
* mergeAll()
* );
* result.subscribe(x => console.log(x));
* ```
*
* @see {@link window}
* @see {@link windowCount}
* @see {@link windowTime}
* @see {@link windowWhen}
* @see {@link bufferToggle}
*
* @param {Observable<O>} openings An observable of notifications to start new
* windows.
* @param {function(value: O): Observable} closingSelector A function that takes
* the value emitted by the `openings` observable and returns an Observable,
* which, when it emits a next notification, signals that the
* associated window should complete.
* @return A function that returns an Observable of windows, which in turn are
* Observables.
*/
export function windowToggle<T, O>(
openings: ObservableInput<O>,
closingSelector: (openValue: O) => ObservableInput<any>
): OperatorFunction<T, Observable<T>> {
return operate((source, subscriber) => {
const windows: Subject<T>[] = [];
const handleError = (err: any) => {
while (0 < windows.length) {
windows.shift()!.error(err);
}
subscriber.error(err);
};
innerFrom(openings).subscribe(
createOperatorSubscriber(
subscriber,
(openValue) => {
const window = new Subject<T>();
windows.push(window);
const closingSubscription = new Subscription();
const closeWindow = () => {
arrRemove(windows, window);
window.complete();
closingSubscription.unsubscribe();
};
let closingNotifier: Observable<any>;
try {
closingNotifier = innerFrom(closingSelector(openValue));
} catch (err) {
handleError(err);
return;
}
subscriber.next(window.asObservable());
closingSubscription.add(closingNotifier.subscribe(createOperatorSubscriber(subscriber, closeWindow, noop, handleError)));
},
noop
)
);
// Subscribe to the source to get things started.
source.subscribe(
createOperatorSubscriber(
subscriber,
(value: T) => {
// Copy the windows array before we emit to
// make sure we don't have issues with reentrant code.
const windowsCopy = windows.slice();
for (const window of windowsCopy) {
window.next(value);
}
},
() => {
// Complete all of our windows before we complete.
while (0 < windows.length) {
windows.shift()!.complete();
}
subscriber.complete();
},
handleError,
() => {
// Add this finalization so that all window subjects are
// disposed of. This way, if a user tries to subscribe
// to a window *after* the outer subscription has been unsubscribed,
// they will get an error, instead of waiting forever to
// see if a value arrives.
while (0 < windows.length) {
windows.shift()!.unsubscribe();
}
}
)
);
});
}

View File

@@ -0,0 +1,3 @@
export default function isKeyframeRule(rule) {
return rule.parent && rule.parent.type === 'atrule' && /keyframes$/.test(rule.parent.name)
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"ConnectableObservable.js","sourceRoot":"","sources":["../../../../src/internal/observable/ConnectableObservable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AASvC,MAAM,OAAO,qBAAyB,SAAQ,UAAa;IAgBzD,YAAmB,MAAqB,EAAY,cAAgC;QAClF,KAAK,EAAE,CAAC;QADS,WAAM,GAAN,MAAM,CAAe;QAAY,mBAAc,GAAd,cAAc,CAAkB;QAf1E,aAAQ,GAAsB,IAAI,CAAC;QACnC,cAAS,GAAW,CAAC,CAAC;QACtB,gBAAW,GAAwB,IAAI,CAAC;QAkBhD,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE;YACnB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;SACzB;IACH,CAAC;IAGS,UAAU,CAAC,UAAyB;QAC5C,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACjD,CAAC;IAES,UAAU;QAClB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,SAAS,EAAE;YACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;SACvC;QACD,OAAO,IAAI,CAAC,QAAS,CAAC;IACxB,CAAC;IAES,SAAS;QACjB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,WAAW,EAAE,CAAC;IAC7B,CAAC;IAMD,OAAO;QACL,IAAI,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;QAClC,IAAI,CAAC,UAAU,EAAE;YACf,UAAU,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,YAAY,EAAE,CAAC;YACnD,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YAClC,UAAU,CAAC,GAAG,CACZ,IAAI,CAAC,MAAM,CAAC,SAAS,CACnB,wBAAwB,CACtB,OAAc,EACd,SAAS,EACT,GAAG,EAAE;gBACH,IAAI,CAAC,SAAS,EAAE,CAAC;gBACjB,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrB,CAAC,EACD,CAAC,GAAG,EAAE,EAAE;gBACN,IAAI,CAAC,SAAS,EAAE,CAAC;gBACjB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACrB,CAAC,EACD,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CACvB,CACF,CACF,CAAC;YAEF,IAAI,UAAU,CAAC,MAAM,EAAE;gBACrB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;gBACxB,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC;aACjC;SACF;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAMD,QAAQ;QACN,OAAO,mBAAmB,EAAE,CAAC,IAAI,CAAkB,CAAC;IACtD,CAAC;CACF"}

View File

@@ -0,0 +1,40 @@
'use strict';
var GetIntrinsic = require('../GetIntrinsic.js');
var $construct = GetIntrinsic('%Reflect.construct%', true);
var DefinePropertyOrThrow = require('./DefinePropertyOrThrow');
try {
DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} });
} catch (e) {
// Accessor properties aren't supported
DefinePropertyOrThrow = null;
}
// https://262.ecma-international.org/6.0/#sec-isconstructor
if (DefinePropertyOrThrow && $construct) {
var isConstructorMarker = {};
var badArrayLike = {};
DefinePropertyOrThrow(badArrayLike, 'length', {
'[[Get]]': function () {
throw isConstructorMarker;
},
'[[Enumerable]]': true
});
module.exports = function IsConstructor(argument) {
try {
// `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`:
$construct(argument, badArrayLike);
} catch (err) {
return err === isConstructorMarker;
}
};
} else {
module.exports = function IsConstructor(argument) {
// unfortunately there's no way to truly check this without try/catch `new argument` in old environments
return typeof argument === 'function' && !!argument.prototype;
};
}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"J D E F CC","129":"A B"},B:{"1":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","129":"C K","1025":"L G M N O"},C:{"2":"0 1 2 3 4 DC tB I v J D E F A B C K L G M N O w g x y z EC FC","513":"5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"I v"},E:{"1":"v J D E F A B C K L G IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I HC zB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 F B C G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e PC QC RC SC qB AC TC rB"},G:{"388":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"2":"oC"},I:{"2":"tB pC qC rC","388":"I f sC BC tC uC"},J:{"2":"D","388":"A"},K:{"1":"A B C qB AC rB","388":"h"},L:{"388":"H"},M:{"641":"H"},N:{"388":"A B"},O:{"388":"vC"},P:{"388":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"388":"1B"},R:{"388":"9C"},S:{"513":"AD BD"}},B:1,C:"Number input type"};

View File

@@ -0,0 +1 @@
{"version":3,"file":"combineAll.js","sourceRoot":"","sources":["../../../../src/internal/operators/combineAll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAKtD,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"partition.js","sourceRoot":"","sources":["../../../../src/internal/observable/partition.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAClC,8CAA6C;AAG7C,yCAAwC;AA0ExC,SAAgB,SAAS,CACvB,MAA0B,EAC1B,SAA0D,EAC1D,OAAa;IAEb,OAAO,CAAC,eAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,qBAAS,CAAC,MAAM,CAAC,CAAC,EAAE,eAAM,CAAC,SAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,qBAAS,CAAC,MAAM,CAAC,CAAC,CAGxG,CAAC;AACJ,CAAC;AATD,8BASC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"partition.js","sourceRoot":"","sources":["../../../../src/internal/observable/partition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA0ExC,MAAM,UAAU,SAAS,CACvB,MAA0B,EAC1B,SAA0D,EAC1D,OAAa;IAEb,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAGxG,CAAC;AACJ,CAAC"}

View File

@@ -0,0 +1,93 @@
import { ObservableInput, OperatorFunction } from '../types';
import { operate } from '../util/lift';
import { mergeInternals } from './mergeInternals';
/**
* Applies an accumulator function over the source Observable where the
* accumulator function itself returns an Observable, then each intermediate
* Observable returned is merged into the output Observable.
*
* <span class="informal">It's like {@link scan}, but the Observables returned
* by the accumulator are merged into the outer Observable.</span>
*
* The first parameter of the `mergeScan` is an `accumulator` function which is
* being called every time the source Observable emits a value. `mergeScan` will
* subscribe to the value returned by the `accumulator` function and will emit
* values to the subscriber emitted by inner Observable.
*
* The `accumulator` function is being called with three parameters passed to it:
* `acc`, `value` and `index`. The `acc` parameter is used as the state parameter
* whose value is initially set to the `seed` parameter (the second parameter
* passed to the `mergeScan` operator).
*
* `mergeScan` internally keeps the value of the `acc` parameter: as long as the
* source Observable emits without inner Observable emitting, the `acc` will be
* set to `seed`. The next time the inner Observable emits a value, `mergeScan`
* will internally remember it and it will be passed to the `accumulator`
* function as `acc` parameter the next time source emits.
*
* The `value` parameter of the `accumulator` function is the value emitted by the
* source Observable, while the `index` is a number which represent the order of the
* current emission by the source Observable. It starts with 0.
*
* The last parameter to the `mergeScan` is the `concurrent` value which defaults
* to Infinity. It represents the maximum number of inner Observable subscriptions
* at a time.
*
* ## Example
*
* Count the number of click events
*
* ```ts
* import { fromEvent, map, mergeScan, of } from 'rxjs';
*
* const click$ = fromEvent(document, 'click');
* const one$ = click$.pipe(map(() => 1));
* const seed = 0;
* const count$ = one$.pipe(
* mergeScan((acc, one) => of(acc + one), seed)
* );
*
* count$.subscribe(x => console.log(x));
*
* // Results:
* // 1
* // 2
* // 3
* // 4
* // ...and so on for each click
* ```
*
* @see {@link scan}
* @see {@link switchScan}
*
* @param {function(acc: R, value: T): Observable<R>} accumulator
* The accumulator function called on each source value.
* @param seed The initial accumulation value.
* @param {number} [concurrent=Infinity] Maximum number of
* input Observables being subscribed to concurrently.
* @return A function that returns an Observable of the accumulated values.
*/
export function mergeScan<T, R>(
accumulator: (acc: R, value: T, index: number) => ObservableInput<R>,
seed: R,
concurrent = Infinity
): OperatorFunction<T, R> {
return operate((source, subscriber) => {
// The accumulated state.
let state = seed;
return mergeInternals(
source,
subscriber,
(value, index) => accumulator(state, value, index),
concurrent,
(value) => {
state = value;
},
false,
undefined,
() => (state = null!)
);
});
}

View File

@@ -0,0 +1,58 @@
/* eslint-disable node/no-deprecated-api */
'use strict'
var buffer = require('buffer')
var Buffer = buffer.Buffer
var safer = require('./safer.js')
var Safer = safer.Buffer
var dangerous = {}
var key
for (key in safer) {
if (!safer.hasOwnProperty(key)) continue
dangerous[key] = safer[key]
}
var Dangereous = dangerous.Buffer = {}
// Copy Safer API
for (key in Safer) {
if (!Safer.hasOwnProperty(key)) continue
Dangereous[key] = Safer[key]
}
// Copy those missing unsafe methods, if they are present
for (key in Buffer) {
if (!Buffer.hasOwnProperty(key)) continue
if (Dangereous.hasOwnProperty(key)) continue
Dangereous[key] = Buffer[key]
}
if (!Dangereous.allocUnsafe) {
Dangereous.allocUnsafe = function (size) {
if (typeof size !== 'number') {
throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
}
if (size < 0 || size >= 2 * (1 << 30)) {
throw new RangeError('The value "' + size + '" is invalid for option "size"')
}
return Buffer(size)
}
}
if (!Dangereous.allocUnsafeSlow) {
Dangereous.allocUnsafeSlow = function (size) {
if (typeof size !== 'number') {
throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
}
if (size < 0 || size >= 2 * (1 << 30)) {
throw new RangeError('The value "' + size + '" is invalid for option "size"')
}
return buffer.SlowBuffer(size)
}
}
module.exports = dangerous

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"F A B","16":"CC","516":"E","1540":"J D"},B:{"1":"C K L G M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB EC FC","132":"tB","260":"DC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","16":"v J D E","132":"I"},E:{"1":"J D E F A B C K L G IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","16":"v HC","132":"I zB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 C G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e TC rB","16":"F PC","260":"B QC RC SC qB AC"},G:{"1":"E VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","16":"zB UC BC"},H:{"1":"oC"},I:{"1":"tB I f sC BC tC uC","16":"pC qC","132":"rC"},J:{"1":"D A"},K:{"1":"C h rB","260":"A B qB AC"},L:{"1":"H"},M:{"1":"H"},N:{"1":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:2,C:"::first-letter CSS pseudo-element selector"};

View File

@@ -0,0 +1,39 @@
import { MonoTypeOperatorFunction } from '../types';
/**
* If the source observable completes without emitting a value, it will emit
* an error. The error will be created at that time by the optional
* `errorFactory` argument, otherwise, the error will be {@link EmptyError}.
*
* ![](throwIfEmpty.png)
*
* ## Example
*
* Throw an error if the document wasn't clicked within 1 second
*
* ```ts
* import { fromEvent, takeUntil, timer, throwIfEmpty } from 'rxjs';
*
* const click$ = fromEvent(document, 'click');
*
* click$.pipe(
* takeUntil(timer(1000)),
* throwIfEmpty(() => new Error('The document was not clicked within 1 second'))
* )
* .subscribe({
* next() {
* console.log('The document was clicked');
* },
* error(err) {
* console.error(err.message);
* }
* });
* ```
*
* @param errorFactory A factory function called to produce the
* error to be thrown when the source observable completes without emitting a
* value.
* @return A function that returns an Observable that throws an error if the
* source Observable completed without emitting.
*/
export declare function throwIfEmpty<T>(errorFactory?: () => any): MonoTypeOperatorFunction<T>;
//# sourceMappingURL=throwIfEmpty.d.ts.map

View File

@@ -0,0 +1,35 @@
"use strict";
/**
* protocols
* Returns the protocols of an input url.
*
* @name protocols
* @function
* @param {String|URL} input The input url (string or `URL` instance)
* @param {Boolean|Number} first If `true`, the first protocol will be returned. If number, it will represent the zero-based index of the protocols array.
* @return {Array|String} The array of protocols or the specified protocol.
*/
module.exports = function protocols(input, first) {
if (first === true) {
first = 0;
}
var prots = "";
if (typeof input === "string") {
try {
prots = new URL(input).protocol;
} catch (e) {}
} else if (input && input.constructor === URL) {
prots = input.protocol;
}
var splits = prots.split(/\:|\+/).filter(Boolean);
if (typeof first === "number") {
return splits[first];
}
return splits;
};

View File

@@ -0,0 +1,274 @@
/**
* This is the common logic for both the Node.js and web browser
* implementations of `debug()`.
*/
function setup(env) {
createDebug.debug = createDebug;
createDebug.default = createDebug;
createDebug.coerce = coerce;
createDebug.disable = disable;
createDebug.enable = enable;
createDebug.enabled = enabled;
createDebug.humanize = require('ms');
createDebug.destroy = destroy;
Object.keys(env).forEach(key => {
createDebug[key] = env[key];
});
/**
* The currently active debug mode names, and names to skip.
*/
createDebug.names = [];
createDebug.skips = [];
/**
* Map of special "%n" handling functions, for the debug "format" argument.
*
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
*/
createDebug.formatters = {};
/**
* Selects a color for a debug namespace
* @param {String} namespace The namespace string for the debug instance to be colored
* @return {Number|String} An ANSI color code for the given namespace
* @api private
*/
function selectColor(namespace) {
let hash = 0;
for (let i = 0; i < namespace.length; i++) {
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
hash |= 0; // Convert to 32bit integer
}
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
}
createDebug.selectColor = selectColor;
/**
* Create a debugger with the given `namespace`.
*
* @param {String} namespace
* @return {Function}
* @api public
*/
function createDebug(namespace) {
let prevTime;
let enableOverride = null;
let namespacesCache;
let enabledCache;
function debug(...args) {
// Disabled?
if (!debug.enabled) {
return;
}
const self = debug;
// Set `diff` timestamp
const curr = Number(new Date());
const ms = curr - (prevTime || curr);
self.diff = ms;
self.prev = prevTime;
self.curr = curr;
prevTime = curr;
args[0] = createDebug.coerce(args[0]);
if (typeof args[0] !== 'string') {
// Anything else let's inspect with %O
args.unshift('%O');
}
// Apply any `formatters` transformations
let index = 0;
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
// If we encounter an escaped % then don't increase the array index
if (match === '%%') {
return '%';
}
index++;
const formatter = createDebug.formatters[format];
if (typeof formatter === 'function') {
const val = args[index];
match = formatter.call(self, val);
// Now we need to remove `args[index]` since it's inlined in the `format`
args.splice(index, 1);
index--;
}
return match;
});
// Apply env-specific formatting (colors, etc.)
createDebug.formatArgs.call(self, args);
const logFn = self.log || createDebug.log;
logFn.apply(self, args);
}
debug.namespace = namespace;
debug.useColors = createDebug.useColors();
debug.color = createDebug.selectColor(namespace);
debug.extend = extend;
debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
Object.defineProperty(debug, 'enabled', {
enumerable: true,
configurable: false,
get: () => {
if (enableOverride !== null) {
return enableOverride;
}
if (namespacesCache !== createDebug.namespaces) {
namespacesCache = createDebug.namespaces;
enabledCache = createDebug.enabled(namespace);
}
return enabledCache;
},
set: v => {
enableOverride = v;
}
});
// Env-specific initialization logic for debug instances
if (typeof createDebug.init === 'function') {
createDebug.init(debug);
}
return debug;
}
function extend(namespace, delimiter) {
const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
newDebug.log = this.log;
return newDebug;
}
/**
* Enables a debug mode by namespaces. This can include modes
* separated by a colon and wildcards.
*
* @param {String} namespaces
* @api public
*/
function enable(namespaces) {
createDebug.save(namespaces);
createDebug.namespaces = namespaces;
createDebug.names = [];
createDebug.skips = [];
let i;
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
const len = split.length;
for (i = 0; i < len; i++) {
if (!split[i]) {
// ignore empty strings
continue;
}
namespaces = split[i].replace(/\*/g, '.*?');
if (namespaces[0] === '-') {
createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
} else {
createDebug.names.push(new RegExp('^' + namespaces + '$'));
}
}
}
/**
* Disable debug output.
*
* @return {String} namespaces
* @api public
*/
function disable() {
const namespaces = [
...createDebug.names.map(toNamespace),
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
].join(',');
createDebug.enable('');
return namespaces;
}
/**
* Returns true if the given mode name is enabled, false otherwise.
*
* @param {String} name
* @return {Boolean}
* @api public
*/
function enabled(name) {
if (name[name.length - 1] === '*') {
return true;
}
let i;
let len;
for (i = 0, len = createDebug.skips.length; i < len; i++) {
if (createDebug.skips[i].test(name)) {
return false;
}
}
for (i = 0, len = createDebug.names.length; i < len; i++) {
if (createDebug.names[i].test(name)) {
return true;
}
}
return false;
}
/**
* Convert regexp to namespace
*
* @param {RegExp} regxep
* @return {String} namespace
* @api private
*/
function toNamespace(regexp) {
return regexp.toString()
.substring(2, regexp.toString().length - 2)
.replace(/\.\*\?$/, '*');
}
/**
* Coerce `val`.
*
* @param {Mixed} val
* @return {Mixed}
* @api private
*/
function coerce(val) {
if (val instanceof Error) {
return val.stack || val.message;
}
return val;
}
/**
* XXX DO NOT USE. This is a temporary stub function.
* XXX It WILL be removed in the next major release.
*/
function destroy() {
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
}
createDebug.enable(createDebug.load());
return createDebug;
}
module.exports = setup;

View File

@@ -0,0 +1,12 @@
import { dateTimestampProvider } from './scheduler/dateTimestampProvider';
export class Scheduler {
constructor(schedulerActionCtor, now = Scheduler.now) {
this.schedulerActionCtor = schedulerActionCtor;
this.now = now;
}
schedule(work, delay = 0, state) {
return new this.schedulerActionCtor(this, work).schedule(state, delay);
}
}
Scheduler.now = dateTimestampProvider.now;
//# sourceMappingURL=Scheduler.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Scheduler.js","sourceRoot":"","sources":["../../../src/internal/Scheduler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAqB1E,MAAM,OAAO,SAAS;IAGpB,YAAoB,mBAAkC,EAAE,MAAoB,SAAS,CAAC,GAAG;QAArE,wBAAmB,GAAnB,mBAAmB,CAAe;QACpD,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IA6BM,QAAQ,CAAI,IAAmD,EAAE,QAAgB,CAAC,EAAE,KAAS;QAClG,OAAO,IAAI,IAAI,CAAC,mBAAmB,CAAI,IAAI,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC5E,CAAC;;AAnCa,aAAG,GAAiB,qBAAqB,CAAC,GAAG,CAAC"}

View File

@@ -0,0 +1,57 @@
"use strict";
var assert = require("chai").assert
, isIterable = require("../../iterable/is");
describe("iterable/is", function () {
it("Should return true on array", function () { assert.equal(isIterable([]), true); });
it("Should return true on arguments", function () {
assert.equal(isIterable((function () { return arguments; })()), true);
});
it("Should by default return false on string", function () {
assert.equal(isIterable("foo"), false);
});
it("Should accept strings if specified", function () {
assert.equal(isIterable("foo", { allowString: true }), true);
});
it("Should support denyEmpty option", function () {
assert.equal(isIterable([], { denyEmpty: true }), false);
assert.equal(isIterable([null], { denyEmpty: true }), true);
assert.equal(isIterable("", { allowString: true, denyEmpty: true }), false);
assert.equal(isIterable("foo", { allowString: true, denyEmpty: true }), true);
});
if (typeof Set === "function") {
it("Should return true on set", function () { assert.equal(isIterable(new Set()), true); });
}
if (typeof Map === "function") {
it("Should return true on set", function () { assert.equal(isIterable(new Map()), true); });
}
it("Should return false on plain object", function () { assert.equal(isIterable({}), false); });
it("Should return false on function", function () {
assert.equal(isIterable(function () { return true; }), false);
});
if (typeof Object.create === "function") {
it("Should return false on object with no prototype", function () {
assert.equal(isIterable(Object.create(null)), false);
});
}
it("Should return false on string", function () { assert.equal(isIterable("foo"), false); });
it("Should return false on empty string", function () { assert.equal(isIterable(""), false); });
it("Should return false on number", function () { assert.equal(isIterable(123), false); });
it("Should return false on NaN", function () { assert.equal(isIterable(NaN), false); });
it("Should return false on boolean", function () { assert.equal(isIterable(true), false); });
if (typeof Symbol === "function") {
it("Should return false on symbol", function () {
assert.equal(isIterable(Symbol("foo")), false);
});
}
it("Should return false on null", function () { assert.equal(isIterable(null), false); });
it("Should return false on undefined", function () {
assert.equal(isIterable(void 0), false);
});
});

View File

@@ -0,0 +1,49 @@
import { ObservableInputTuple, OperatorFunction } from '../types';
import { merge } from './merge';
/**
* Merge the values from all observables to a single observable result.
*
* Creates an observable, that when subscribed to, subscribes to the source
* observable, and all other sources provided as arguments. All values from
* every source are emitted from the resulting subscription.
*
* When all sources complete, the resulting observable will complete.
*
* When any source errors, the resulting observable will error.
*
* ## Example
*
* Joining all outputs from multiple user input event streams
*
* ```ts
* import { fromEvent, map, mergeWith } from 'rxjs';
*
* const clicks$ = fromEvent(document, 'click').pipe(map(() => 'click'));
* const mousemoves$ = fromEvent(document, 'mousemove').pipe(map(() => 'mousemove'));
* const dblclicks$ = fromEvent(document, 'dblclick').pipe(map(() => 'dblclick'));
*
* mousemoves$
* .pipe(mergeWith(clicks$, dblclicks$))
* .subscribe(x => console.log(x));
*
* // result (assuming user interactions)
* // 'mousemove'
* // 'mousemove'
* // 'mousemove'
* // 'click'
* // 'click'
* // 'dblclick'
* ```
*
* @see {@link merge}
*
* @param otherSources the sources to combine the current source with.
* @return A function that returns an Observable that merges the values from
* all given Observables.
*/
export function mergeWith<T, A extends readonly unknown[]>(
...otherSources: [...ObservableInputTuple<A>]
): OperatorFunction<T, T | A[number]> {
return merge(...otherSources);
}

View File

@@ -0,0 +1,10 @@
/**
* Error subclass to use when the source does not exist at the specified endpoint.
*
* @param {String} message optional "message" property to set
* @api protected
*/
export default class NotFoundError extends Error {
code: string;
constructor(message?: string);
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IAC1C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACzB,MAAM,IAAI,SAAS,CAClB,kEAAkE,CAClE,CAAC;KACF;IAED,iBAAiB;IACjB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAEhC,+DAA+D;IAC/D,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,UAAU,KAAK,CAAC,CAAC,IAAI,UAAU,IAAI,CAAC,EAAE;QACzC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;KAC3C;IAED,mDAAmD;IACnD,MAAM,IAAI,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAErD,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC;IACrC,IAAI,QAAQ,GAAG,IAAI,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;YACzB,MAAM,GAAG,IAAI,CAAC;SACd;aAAM,IAAG,IAAI,CAAC,CAAC,CAAC,EAAE;YAClB,QAAQ,IAAI,IAAM,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5B,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;gBACtC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;aAC/B;SACD;KACD;IACD,oDAAoD;IACpD,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QAChC,QAAQ,IAAI,mBAAmB,CAAC;QAChC,OAAO,GAAG,UAAU,CAAC;KACrB;IAED,4DAA4D;IAC5D,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;IAC7C,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAe,CAAC;IAEzD,sDAAsD;IACtD,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAE3B,8BAA8B;IAC9B,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IAEzB,OAAO,MAAM,CAAC;AACf,CAAC;AAED,eAAe,eAAe,CAAC"}

View File

@@ -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.00623,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0.00623,"59":0.02494,"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.01247,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0.00623,"88":0,"89":0,"90":0,"91":0.00623,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0.01247,"102":0.14338,"103":0,"104":0,"105":0.01247,"106":0.00623,"107":0.00623,"108":0.03117,"109":0.77925,"110":0.44885,"111":0.00623,"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.00623,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.01247,"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,"64":0.00623,"65":0,"66":0.11845,"67":0.00623,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0.00623,"77":0,"78":0.00623,"79":0.01247,"80":0.00623,"81":0.00623,"83":0,"84":0.00623,"85":3.26038,"86":0.01247,"87":0.03117,"88":0.00623,"89":0.0187,"90":0.01247,"91":0.21819,"92":0.02494,"93":0.0187,"94":0.01247,"95":0.00623,"96":0.00623,"97":0.00623,"98":0.01247,"99":0.00623,"100":0.0374,"101":0.02494,"102":0.0187,"103":0.15585,"104":0.03117,"105":0.20572,"106":0.03117,"107":0.17455,"108":1.12212,"109":14.41301,"110":6.98208,"111":0.00623,"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.01247,"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.06857,"94":0.59223,"95":0.25559,"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.01247,"18":0,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0.00623,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00623,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0.01247,"104":0,"105":0.00623,"106":0.00623,"107":0.02494,"108":0.09974,"109":1.93254,"110":2.25047},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.00623,"14":0.06857,"15":0.0187,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0.00623,"10.1":0,"11.1":0.02494,"12.1":0.01247,"13.1":0.08104,"14.1":0.24313,"15.1":0.04987,"15.2-15.3":0.04364,"15.4":0.11845,"15.5":0.17455,"15.6":0.86653,"16.0":0.06857,"16.1":0.3491,"16.2":0.90393,"16.3":0.88523,"16.4":0},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.08036,"10.0-10.2":0.00765,"10.3":0.09567,"11.0-11.2":0.01148,"11.3-11.4":0.21431,"12.0-12.1":0.01531,"12.2-12.5":0.41713,"13.0-13.1":0.00383,"13.2":0.00765,"13.3":0.01531,"13.4-13.7":0.04592,"14.0-14.4":0.22579,"14.5-14.8":0.83044,"15.0-15.1":0.16456,"15.2-15.3":0.33294,"15.4":0.32529,"15.5":0.82278,"15.6":3.26434,"16.0":4.71474,"16.1":11.03677,"16.2":9.5328,"16.3":4.88695,"16.4":0.01148},P:{"4":0.05093,"20":0.93711,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0,"12.0":0,"13.0":0,"14.0":0.01019,"15.0":0,"16.0":0.02037,"17.0":0.02037,"18.0":0.04074,"19.0":1.50753},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.12076,"4.4":0,"4.4.3-4.4.4":0.02937},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.05611,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.01506},H:{"0":0.1747},L:{"0":19.69754},R:{_:"0"},M:{"0":0.30128},Q:{"13.1":0}};

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","2":"C K L G M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB EC FC"},D:{"1":"MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB"},E:{"2":"I v J D E F A B C K L G HC zB IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"1":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"0 1 2 3 4 5 6 7 8 F B C G M N O w g x y z PC QC RC SC qB AC TC rB"},G:{"2":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"2":"H"},N:{"2":"A B"},O:{"1":"vC"},P:{"1":"g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C","2":"I"},Q:{"1":"1B"},R:{"1":"9C"},S:{"2":"AD BD"}},B:6,C:"Client Hints: DPR, Width, Viewport-Width"};

View File

@@ -0,0 +1 @@
{"version":3,"file":"max.js","sourceRoot":"","sources":["../../../../src/internal/operators/max.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAgDhD,MAAM,UAAU,GAAG,CAAI,QAAiC;IACtD,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3G,CAAC"}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fsStat = require("@nodelib/fs.stat");
const fsWalk = require("@nodelib/fs.walk");
const reader_1 = require("./reader");
class ReaderSync extends reader_1.default {
constructor() {
super(...arguments);
this._walkSync = fsWalk.walkSync;
this._statSync = fsStat.statSync;
}
dynamic(root, options) {
return this._walkSync(root, options);
}
static(patterns, options) {
const entries = [];
for (const pattern of patterns) {
const filepath = this._getFullEntryPath(pattern);
const entry = this._getEntry(filepath, pattern, options);
if (entry === null || !options.entryFilter(entry)) {
continue;
}
entries.push(entry);
}
return entries;
}
_getEntry(filepath, pattern, options) {
try {
const stats = this._getStat(filepath);
return this._makeEntry(stats, pattern);
}
catch (error) {
if (options.errorFilter(error)) {
return null;
}
throw error;
}
}
_getStat(filepath) {
return this._statSync(filepath, this._fsStatSettings);
}
}
exports.default = ReaderSync;

View File

@@ -0,0 +1,141 @@
# cliui
![ci](https://github.com/yargs/cliui/workflows/ci/badge.svg)
[![NPM version](https://img.shields.io/npm/v/cliui.svg)](https://www.npmjs.com/package/cliui)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
![nycrc config on GitHub](https://img.shields.io/nycrc/yargs/cliui)
easily create complex multi-column command-line-interfaces.
## Example
```js
const ui = require('cliui')()
ui.div('Usage: $0 [command] [options]')
ui.div({
text: 'Options:',
padding: [2, 0, 1, 0]
})
ui.div(
{
text: "-f, --file",
width: 20,
padding: [0, 4, 0, 4]
},
{
text: "the file to load." +
chalk.green("(if this description is long it wraps).")
,
width: 20
},
{
text: chalk.red("[required]"),
align: 'right'
}
)
console.log(ui.toString())
```
## Deno/ESM Support
As of `v7` `cliui` supports [Deno](https://github.com/denoland/deno) and
[ESM](https://nodejs.org/api/esm.html#esm_ecmascript_modules):
```typescript
import cliui from "https://deno.land/x/cliui/deno.ts";
const ui = cliui({})
ui.div('Usage: $0 [command] [options]')
ui.div({
text: 'Options:',
padding: [2, 0, 1, 0]
})
ui.div({
text: "-f, --file",
width: 20,
padding: [0, 4, 0, 4]
})
console.log(ui.toString())
```
<img width="500" src="screenshot.png">
## Layout DSL
cliui exposes a simple layout DSL:
If you create a single `ui.div`, passing a string rather than an
object:
* `\n`: characters will be interpreted as new rows.
* `\t`: characters will be interpreted as new columns.
* `\s`: characters will be interpreted as padding.
**as an example...**
```js
var ui = require('./')({
width: 60
})
ui.div(
'Usage: node ./bin/foo.js\n' +
' <regex>\t provide a regex\n' +
' <glob>\t provide a glob\t [required]'
)
console.log(ui.toString())
```
**will output:**
```shell
Usage: node ./bin/foo.js
<regex> provide a regex
<glob> provide a glob [required]
```
## Methods
```js
cliui = require('cliui')
```
### cliui({width: integer})
Specify the maximum width of the UI being generated.
If no width is provided, cliui will try to get the current window's width and use it, and if that doesn't work, width will be set to `80`.
### cliui({wrap: boolean})
Enable or disable the wrapping of text in a column.
### cliui.div(column, column, column)
Create a row with any number of columns, a column
can either be a string, or an object with the following
options:
* **text:** some text to place in the column.
* **width:** the width of a column.
* **align:** alignment, `right` or `center`.
* **padding:** `[top, right, bottom, left]`.
* **border:** should a border be placed around the div?
### cliui.span(column, column, column)
Similar to `div`, except the next row will be appended without
a new line being created.
### cliui.resetOutput()
Resets the UI elements of the current cliui instance, maintaining the values
set for `width` and `wrap`.

View File

@@ -0,0 +1,24 @@
import { AsyncScheduler } from './AsyncScheduler';
export class AnimationFrameScheduler extends AsyncScheduler {
flush(action) {
this._active = true;
const flushId = this._scheduled;
this._scheduled = undefined;
const { actions } = this;
let error;
action = action || actions.shift();
do {
if ((error = action.execute(action.state, action.delay))) {
break;
}
} while ((action = actions[0]) && action.id === flushId && actions.shift());
this._active = false;
if (error) {
while ((action = actions[0]) && action.id === flushId && actions.shift()) {
action.unsubscribe();
}
throw error;
}
}
}
//# sourceMappingURL=AnimationFrameScheduler.js.map

View File

@@ -0,0 +1,71 @@
{
"name": "source-map-js",
"description": "Generates and consumes source maps",
"version": "1.0.2",
"homepage": "https://github.com/7rulnik/source-map-js",
"author": "Valentin 7rulnik Semirulnik <v7rulnik@gmail.com>",
"contributors": [
"Nick Fitzgerald <nfitzgerald@mozilla.com>",
"Tobias Koppers <tobias.koppers@googlemail.com>",
"Duncan Beevers <duncan@dweebd.com>",
"Stephen Crane <scrane@mozilla.com>",
"Ryan Seddon <seddon.ryan@gmail.com>",
"Miles Elam <miles.elam@deem.com>",
"Mihai Bazon <mihai.bazon@gmail.com>",
"Michael Ficarra <github.public.email@michael.ficarra.me>",
"Todd Wolfson <todd@twolfson.com>",
"Alexander Solovyov <alexander@solovyov.net>",
"Felix Gnass <fgnass@gmail.com>",
"Conrad Irwin <conrad.irwin@gmail.com>",
"usrbincc <usrbincc@yahoo.com>",
"David Glasser <glasser@davidglasser.net>",
"Chase Douglas <chase@newrelic.com>",
"Evan Wallace <evan.exe@gmail.com>",
"Heather Arthur <fayearthur@gmail.com>",
"Hugh Kennedy <hughskennedy@gmail.com>",
"David Glasser <glasser@davidglasser.net>",
"Simon Lydell <simon.lydell@gmail.com>",
"Jmeas Smith <jellyes2@gmail.com>",
"Michael Z Goddard <mzgoddard@gmail.com>",
"azu <azu@users.noreply.github.com>",
"John Gozde <john@gozde.ca>",
"Adam Kirkton <akirkton@truefitinnovation.com>",
"Chris Montgomery <christopher.montgomery@dowjones.com>",
"J. Ryan Stinnett <jryans@gmail.com>",
"Jack Herrington <jherrington@walmartlabs.com>",
"Chris Truter <jeffpalentine@gmail.com>",
"Daniel Espeset <daniel@danielespeset.com>",
"Jamie Wong <jamie.lf.wong@gmail.com>",
"Eddy Bruël <ejpbruel@mozilla.com>",
"Hawken Rives <hawkrives@gmail.com>",
"Gilad Peleg <giladp007@gmail.com>",
"djchie <djchie.dev@gmail.com>",
"Gary Ye <garysye@gmail.com>",
"Nicolas Lalevée <nicolas.lalevee@hibnet.org>"
],
"repository": "7rulnik/source-map-js",
"main": "./source-map.js",
"files": [
"source-map.js",
"source-map.d.ts",
"lib/"
],
"engines": {
"node": ">=0.10.0"
},
"license": "BSD-3-Clause",
"scripts": {
"test": "npm run build && node test/run-tests.js",
"build": "webpack --color",
"toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md"
},
"devDependencies": {
"clean-publish": "^3.1.0",
"doctoc": "^0.15.0",
"webpack": "^1.12.0"
},
"clean-publish": {
"cleanDocs": true
},
"typings": "source-map.d.ts"
}

View File

@@ -0,0 +1,19 @@
/*
Fraction.js v4.2.0 05/03/2022
https://www.xarg.org/2014/03/rational-numbers-in-javascript/
Copyright (c) 2021, Robert Eisele (robert@xarg.org)
Dual licensed under the MIT or GPL Version 2 licenses.
*/
(function(z){function p(a,c){var b=0,d=1,f=1,l=0,k=0,t=0,x=1,u=1,g=0,h=1,v=1,q=1;if(void 0!==a&&null!==a)if(void 0!==c){if(b=a,d=c,f=b*d,0!==b%1||0!==d%1)throw m.NonIntegerParameter;}else switch(typeof a){case "object":if("d"in a&&"n"in a)b=a.n,d=a.d,"s"in a&&(b*=a.s);else if(0 in a)b=a[0],1 in a&&(d=a[1]);else throw m.InvalidParameter;f=b*d;break;case "number":0>a&&(f=a,a=-a);if(0===a%1)b=a;else if(0<a){1<=a&&(u=Math.pow(10,Math.floor(1+Math.log(a)/Math.LN10)),a/=u);for(;1E7>=h&&1E7>=q;)if(b=(g+
v)/(h+q),a===b){1E7>=h+q?(b=g+v,d=h+q):q>h?(b=v,d=q):(b=g,d=h);break}else a>b?(g+=v,h+=q):(v+=g,q+=h),1E7<h?(b=v,d=q):(b=g,d=h);b*=u}else if(isNaN(a)||isNaN(c))d=b=NaN;break;case "string":h=a.match(/\d+|./g);if(null===h)throw m.InvalidParameter;"-"===h[g]?(f=-1,g++):"+"===h[g]&&g++;if(h.length===g+1)k=r(h[g++],f);else if("."===h[g+1]||"."===h[g]){"."!==h[g]&&(l=r(h[g++],f));g++;if(g+1===h.length||"("===h[g+1]&&")"===h[g+3]||"'"===h[g+1]&&"'"===h[g+3])k=r(h[g],f),x=Math.pow(10,h[g].length),g++;if("("===
h[g]&&")"===h[g+2]||"'"===h[g]&&"'"===h[g+2])t=r(h[g+1],f),u=Math.pow(10,h[g+1].length)-1,g+=3}else"/"===h[g+1]||":"===h[g+1]?(k=r(h[g],f),x=r(h[g+2],1),g+=3):"/"===h[g+3]&&" "===h[g+1]&&(l=r(h[g],f),k=r(h[g+2],f),x=r(h[g+4],1),g+=5);if(h.length<=g){d=x*u;f=b=t+d*l+u*k;break}default:throw m.InvalidParameter;}if(0===d)throw m.DivisionByZero;e.s=0>f?-1:1;e.n=Math.abs(b);e.d=Math.abs(d)}function r(a,c){if(isNaN(a=parseInt(a,10)))throw m.InvalidParameter;return a*c}function n(a,c){if(0===c)throw m.DivisionByZero;
var b=Object.create(m.prototype);b.s=0>a?-1:1;a=0>a?-a:a;var d=w(a,c);b.n=a/d;b.d=c/d;return b}function y(a){for(var c={},b=a,d=2,f=4;f<=b;){for(;0===b%d;)b/=d,c[d]=(c[d]||0)+1;f+=1+2*d++}b!==a?1<b&&(c[b]=(c[b]||0)+1):c[a]=(c[a]||0)+1;return c}function w(a,c){if(!a)return c;if(!c)return a;for(;;){a%=c;if(!a)return c;c%=a;if(!c)return a}}function m(a,c){p(a,c);if(this instanceof m)a=w(e.d,e.n),this.s=e.s,this.n=e.n/a,this.d=e.d/a;else return n(e.s*e.n,e.d)}var e={s:1,n:0,d:1};m.DivisionByZero=Error("Division by Zero");
m.InvalidParameter=Error("Invalid argument");m.NonIntegerParameter=Error("Parameters must be integer");m.prototype={s:1,n:0,d:1,abs:function(){return n(this.n,this.d)},neg:function(){return n(-this.s*this.n,this.d)},add:function(a,c){p(a,c);return n(this.s*this.n*e.d+e.s*this.d*e.n,this.d*e.d)},sub:function(a,c){p(a,c);return n(this.s*this.n*e.d-e.s*this.d*e.n,this.d*e.d)},mul:function(a,c){p(a,c);return n(this.s*e.s*this.n*e.n,this.d*e.d)},div:function(a,c){p(a,c);return n(this.s*e.s*this.n*e.d,
this.d*e.n)},clone:function(){return n(this.s*this.n,this.d)},mod:function(a,c){if(isNaN(this.n)||isNaN(this.d))return new m(NaN);if(void 0===a)return n(this.s*this.n%this.d,1);p(a,c);if(0===e.n&&0===this.d)throw m.DivisionByZero;return n(this.s*e.d*this.n%(e.n*this.d),e.d*this.d)},gcd:function(a,c){p(a,c);return n(w(e.n,this.n)*w(e.d,this.d),e.d*this.d)},lcm:function(a,c){p(a,c);return 0===e.n&&0===this.n?n(0,1):n(e.n*this.n,w(e.n,this.n)*w(e.d,this.d))},ceil:function(a){a=Math.pow(10,a||0);return isNaN(this.n)||
isNaN(this.d)?new m(NaN):n(Math.ceil(a*this.s*this.n/this.d),a)},floor:function(a){a=Math.pow(10,a||0);return isNaN(this.n)||isNaN(this.d)?new m(NaN):n(Math.floor(a*this.s*this.n/this.d),a)},round:function(a){a=Math.pow(10,a||0);return isNaN(this.n)||isNaN(this.d)?new m(NaN):n(Math.round(a*this.s*this.n/this.d),a)},inverse:function(){return n(this.s*this.d,this.n)},pow:function(a,c){p(a,c);if(1===e.d)return 0>e.s?n(Math.pow(this.s*this.d,e.n),Math.pow(this.n,e.n)):n(Math.pow(this.s*this.n,e.n),Math.pow(this.d,
e.n));if(0>this.s)return null;var b=y(this.n),d=y(this.d),f=1,l=1,k;for(k in b)if("1"!==k){if("0"===k){f=0;break}b[k]*=e.n;if(0===b[k]%e.d)b[k]/=e.d;else return null;f*=Math.pow(k,b[k])}for(k in d)if("1"!==k){d[k]*=e.n;if(0===d[k]%e.d)d[k]/=e.d;else return null;l*=Math.pow(k,d[k])}return 0>e.s?n(l,f):n(f,l)},equals:function(a,c){p(a,c);return this.s*this.n*e.d===e.s*e.n*this.d},compare:function(a,c){p(a,c);var b=this.s*this.n*e.d-e.s*e.n*this.d;return(0<b)-(0>b)},simplify:function(a){if(isNaN(this.n)||
isNaN(this.d))return this;a=a||.001;for(var c=this.abs(),b=c.toContinued(),d=1;d<b.length;d++){for(var f=n(b[d-1],1),l=d-2;0<=l;l--)f=f.inverse().add(b[l]);if(f.sub(c).abs().valueOf()<a)return f.mul(this.s)}return this},divisible:function(a,c){p(a,c);return!(!(e.n*this.d)||this.n*e.d%(e.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(a){var c,b="",d=this.n,f=this.d;0>this.s&&(b+="-");1===f?b+=d:(a&&0<(c=Math.floor(d/f))&&(b=b+c+" ",d%=f),b=b+d+"/",b+=f);return b},toLatex:function(a){var c,
b="",d=this.n,f=this.d;0>this.s&&(b+="-");1===f?b+=d:(a&&0<(c=Math.floor(d/f))&&(b+=c,d%=f),b=b+"\\frac{"+d+"}{"+f,b+="}");return b},toContinued:function(){var a=this.n,c=this.d,b=[];if(isNaN(a)||isNaN(c))return b;do{b.push(Math.floor(a/c));var d=a%c;a=c;c=d}while(1!==a);return b},toString:function(a){var c=this.n,b=this.d;if(isNaN(c)||isNaN(b))return"NaN";var d;a:{for(d=b;0===d%2;d/=2);for(;0===d%5;d/=5);if(1===d)d=0;else{for(var f=10%d,l=1;1!==f;l++)if(f=10*f%d,2E3<l){d=0;break a}d=l}}a:{f=1;l=
10;for(var k=d,t=1;0<k;l=l*l%b,k>>=1)k&1&&(t=t*l%b);l=t;for(k=0;300>k;k++){if(f===l){l=k;break a}f=10*f%b;l=10*l%b}l=0}f=0>this.s?"-":"";f+=c/b|0;(c=c%b*10)&&(f+=".");if(d){for(a=l;a--;)f+=c/b|0,c%=b,c*=10;f+="(";for(a=d;a--;)f+=c/b|0,c%=b,c*=10;f+=")"}else for(a=a||15;c&&a--;)f+=c/b|0,c%=b,c*=10;return f}};"function"===typeof define&&define.amd?define([],function(){return m}):"object"===typeof exports?(Object.defineProperty(m,"__esModule",{value:!0}),m["default"]=m,m.Fraction=m,module.exports=m):
z.Fraction=m})(this);

View File

@@ -0,0 +1 @@
{"version":3,"file":"env-replace.js","sourceRoot":"","sources":["../env-replace.ts"],"names":[],"mappings":";;;AAAA,MAAM,QAAQ,GAAG,8BAA8B,CAAA;AAE/C,SAAgB,UAAU,CAAC,YAAoB,EAAE,GAAsB;IACrE,OAAO,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAA;AACxE,CAAC;AAFD,gCAEC;AAED,SAAS,eAAe,CAAE,GAAsB,EAAE,IAAY,EAAE,MAAc,EAAE,IAAY;IAC1F,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QACrB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;KAC3C;IACD,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,CAAA;IAC1B,IAAI,QAAQ,KAAK,SAAS,EAAE;QAC1B,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAA;KAC5D;IACD,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,EAAE,CAAA;AAC1D,CAAC"}

View File

@@ -0,0 +1,157 @@
'use strict';
/* eslint global-require: 0 */
// https://262.ecma-international.org/9.0/#sec-abstract-operations
var ES2018 = {
'Abstract Equality Comparison': require('./2018/AbstractEqualityComparison'),
'Abstract Relational Comparison': require('./2018/AbstractRelationalComparison'),
'Strict Equality Comparison': require('./2018/StrictEqualityComparison'),
abs: require('./2018/abs'),
AdvanceStringIndex: require('./2018/AdvanceStringIndex'),
ArrayCreate: require('./2018/ArrayCreate'),
ArraySetLength: require('./2018/ArraySetLength'),
ArraySpeciesCreate: require('./2018/ArraySpeciesCreate'),
AsyncIteratorClose: require('./2018/AsyncIteratorClose'),
Call: require('./2018/Call'),
CanonicalNumericIndexString: require('./2018/CanonicalNumericIndexString'),
CharacterRange: require('./2018/CharacterRange'),
CompletePropertyDescriptor: require('./2018/CompletePropertyDescriptor'),
CompletionRecord: require('./2018/CompletionRecord'),
CopyDataProperties: require('./2018/CopyDataProperties'),
CreateAsyncFromSyncIterator: require('./2018/CreateAsyncFromSyncIterator'),
CreateDataProperty: require('./2018/CreateDataProperty'),
CreateDataPropertyOrThrow: require('./2018/CreateDataPropertyOrThrow'),
CreateHTML: require('./2018/CreateHTML'),
CreateIterResultObject: require('./2018/CreateIterResultObject'),
CreateListFromArrayLike: require('./2018/CreateListFromArrayLike'),
CreateMethodProperty: require('./2018/CreateMethodProperty'),
DateFromTime: require('./2018/DateFromTime'),
DateString: require('./2018/DateString'),
Day: require('./2018/Day'),
DayFromYear: require('./2018/DayFromYear'),
DaysInYear: require('./2018/DaysInYear'),
DayWithinYear: require('./2018/DayWithinYear'),
DefinePropertyOrThrow: require('./2018/DefinePropertyOrThrow'),
DeletePropertyOrThrow: require('./2018/DeletePropertyOrThrow'),
DetachArrayBuffer: require('./2018/DetachArrayBuffer'),
EnumerableOwnPropertyNames: require('./2018/EnumerableOwnPropertyNames'),
floor: require('./2018/floor'),
FromPropertyDescriptor: require('./2018/FromPropertyDescriptor'),
Get: require('./2018/Get'),
GetGlobalObject: require('./2018/GetGlobalObject'),
GetIterator: require('./2018/GetIterator'),
GetMethod: require('./2018/GetMethod'),
GetOwnPropertyKeys: require('./2018/GetOwnPropertyKeys'),
GetPrototypeFromConstructor: require('./2018/GetPrototypeFromConstructor'),
GetSubstitution: require('./2018/GetSubstitution'),
GetV: require('./2018/GetV'),
HasOwnProperty: require('./2018/HasOwnProperty'),
HasProperty: require('./2018/HasProperty'),
HourFromTime: require('./2018/HourFromTime'),
InLeapYear: require('./2018/InLeapYear'),
InstanceofOperator: require('./2018/InstanceofOperator'),
Invoke: require('./2018/Invoke'),
IsAccessorDescriptor: require('./2018/IsAccessorDescriptor'),
IsArray: require('./2018/IsArray'),
IsCallable: require('./2018/IsCallable'),
IsCompatiblePropertyDescriptor: require('./2018/IsCompatiblePropertyDescriptor'),
IsConcatSpreadable: require('./2018/IsConcatSpreadable'),
IsConstructor: require('./2018/IsConstructor'),
IsDataDescriptor: require('./2018/IsDataDescriptor'),
IsDetachedBuffer: require('./2018/IsDetachedBuffer'),
IsExtensible: require('./2018/IsExtensible'),
IsGenericDescriptor: require('./2018/IsGenericDescriptor'),
IsInteger: require('./2018/IsInteger'),
IsPromise: require('./2018/IsPromise'),
IsPropertyKey: require('./2018/IsPropertyKey'),
IsRegExp: require('./2018/IsRegExp'),
IsSharedArrayBuffer: require('./2018/IsSharedArrayBuffer'),
IsStringPrefix: require('./2018/IsStringPrefix'),
IterableToList: require('./2018/IterableToList'),
IteratorClose: require('./2018/IteratorClose'),
IteratorComplete: require('./2018/IteratorComplete'),
IteratorNext: require('./2018/IteratorNext'),
IteratorStep: require('./2018/IteratorStep'),
IteratorValue: require('./2018/IteratorValue'),
MakeDate: require('./2018/MakeDate'),
MakeDay: require('./2018/MakeDay'),
MakeTime: require('./2018/MakeTime'),
max: require('./2018/max'),
min: require('./2018/min'),
MinFromTime: require('./2018/MinFromTime'),
modulo: require('./2018/modulo'),
MonthFromTime: require('./2018/MonthFromTime'),
msFromTime: require('./2018/msFromTime'),
NormalCompletion: require('./2018/NormalCompletion'),
NumberToRawBytes: require('./2018/NumberToRawBytes'),
NumberToString: require('./2018/NumberToString'),
ObjectCreate: require('./2018/ObjectCreate'),
ObjectDefineProperties: require('./2018/ObjectDefineProperties'),
OrdinaryCreateFromConstructor: require('./2018/OrdinaryCreateFromConstructor'),
OrdinaryDefineOwnProperty: require('./2018/OrdinaryDefineOwnProperty'),
OrdinaryGetOwnProperty: require('./2018/OrdinaryGetOwnProperty'),
OrdinaryGetPrototypeOf: require('./2018/OrdinaryGetPrototypeOf'),
OrdinaryHasInstance: require('./2018/OrdinaryHasInstance'),
OrdinaryHasProperty: require('./2018/OrdinaryHasProperty'),
OrdinarySetPrototypeOf: require('./2018/OrdinarySetPrototypeOf'),
OrdinaryToPrimitive: require('./2018/OrdinaryToPrimitive'),
PromiseResolve: require('./2018/PromiseResolve'),
QuoteJSONString: require('./2018/QuoteJSONString'),
RawBytesToNumber: require('./2018/RawBytesToNumber'),
RegExpCreate: require('./2018/RegExpCreate'),
RegExpExec: require('./2018/RegExpExec'),
RequireObjectCoercible: require('./2018/RequireObjectCoercible'),
SameValue: require('./2018/SameValue'),
SameValueNonNumber: require('./2018/SameValueNonNumber'),
SameValueZero: require('./2018/SameValueZero'),
SecFromTime: require('./2018/SecFromTime'),
Set: require('./2018/Set'),
SetFunctionLength: require('./2018/SetFunctionLength'),
SetFunctionName: require('./2018/SetFunctionName'),
SetIntegrityLevel: require('./2018/SetIntegrityLevel'),
SpeciesConstructor: require('./2018/SpeciesConstructor'),
SplitMatch: require('./2018/SplitMatch'),
StringCreate: require('./2018/StringCreate'),
StringGetOwnProperty: require('./2018/StringGetOwnProperty'),
SymbolDescriptiveString: require('./2018/SymbolDescriptiveString'),
TestIntegrityLevel: require('./2018/TestIntegrityLevel'),
thisBooleanValue: require('./2018/thisBooleanValue'),
thisNumberValue: require('./2018/thisNumberValue'),
thisStringValue: require('./2018/thisStringValue'),
thisSymbolValue: require('./2018/thisSymbolValue'),
thisTimeValue: require('./2018/thisTimeValue'),
ThrowCompletion: require('./2018/ThrowCompletion'),
TimeClip: require('./2018/TimeClip'),
TimeFromYear: require('./2018/TimeFromYear'),
TimeString: require('./2018/TimeString'),
TimeWithinDay: require('./2018/TimeWithinDay'),
ToBoolean: require('./2018/ToBoolean'),
ToDateString: require('./2018/ToDateString'),
ToIndex: require('./2018/ToIndex'),
ToInt16: require('./2018/ToInt16'),
ToInt32: require('./2018/ToInt32'),
ToInt8: require('./2018/ToInt8'),
ToInteger: require('./2018/ToInteger'),
ToLength: require('./2018/ToLength'),
ToNumber: require('./2018/ToNumber'),
ToObject: require('./2018/ToObject'),
ToPrimitive: require('./2018/ToPrimitive'),
ToPropertyDescriptor: require('./2018/ToPropertyDescriptor'),
ToPropertyKey: require('./2018/ToPropertyKey'),
ToString: require('./2018/ToString'),
ToUint16: require('./2018/ToUint16'),
ToUint32: require('./2018/ToUint32'),
ToUint8: require('./2018/ToUint8'),
ToUint8Clamp: require('./2018/ToUint8Clamp'),
Type: require('./2018/Type'),
UnicodeEscape: require('./2018/UnicodeEscape'),
UTF16Decode: require('./2018/UTF16Decode'),
UTF16Encoding: require('./2018/UTF16Encoding'),
ValidateAndApplyPropertyDescriptor: require('./2018/ValidateAndApplyPropertyDescriptor'),
ValidateAtomicAccess: require('./2018/ValidateAtomicAccess'),
ValidateTypedArray: require('./2018/ValidateTypedArray'),
WeekDay: require('./2018/WeekDay'),
YearFromTime: require('./2018/YearFromTime')
};
module.exports = ES2018;

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"CC","8":"J D E F","260":"A B"},B:{"1":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","260":"C K L G","1284":"M N O"},C:{"1":"H xB yB","8":"DC tB EC FC","516":"o p q r s t u f","4612":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n"},D:{"1":"hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","8":"I v J D E F A B C K L G M N O w","132":"0 1 2 3 4 5 6 7 8 9 g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB"},E:{"1":"K L G rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","8":"I v J D E F A B C HC zB IC JC KC LC 0B qB"},F:{"1":"F B C cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e PC QC RC SC qB AC TC rB","132":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB"},G:{"8":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC","2049":"gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"2":"oC"},I:{"1":"f uC","8":"tB I pC qC rC sC BC tC"},J:{"1":"A","8":"D"},K:{"1":"A B C h qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"8":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"2":"AD BD"}},B:1,C:"Datalist element"};

View File

@@ -0,0 +1,269 @@
# Acorn
A tiny, fast JavaScript parser written in JavaScript.
## Community
Acorn is open source software released under an
[MIT license](https://github.com/acornjs/acorn/blob/master/acorn/LICENSE).
You are welcome to
[report bugs](https://github.com/acornjs/acorn/issues) or create pull
requests on [github](https://github.com/acornjs/acorn). For questions
and discussion, please use the
[Tern discussion forum](https://discuss.ternjs.net).
## Installation
The easiest way to install acorn is from [`npm`](https://www.npmjs.com/):
```sh
npm install acorn
```
Alternately, you can download the source and build acorn yourself:
```sh
git clone https://github.com/acornjs/acorn.git
cd acorn
npm install
```
## Interface
**parse**`(input, options)` is the main interface to the library. The
`input` parameter is a string, `options` can be undefined or an object
setting some of the options listed below. The return value will be an
abstract syntax tree object as specified by the [ESTree
spec](https://github.com/estree/estree).
```javascript
let acorn = require("acorn");
console.log(acorn.parse("1 + 1"));
```
When encountering a syntax error, the parser will raise a
`SyntaxError` object with a meaningful message. The error object will
have a `pos` property that indicates the string offset at which the
error occurred, and a `loc` object that contains a `{line, column}`
object referring to that same position.
Options can be provided by passing a second argument, which should be
an object containing any of these fields:
- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be
either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019) or 11
(2020, partial support). This influences support for strict mode,
the set of reserved words, and support for new syntax features.
Default is 10.
**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
implemented by Acorn. Other proposed new features can be implemented
through plugins.
- **sourceType**: Indicate the mode the code should be parsed in. Can be
either `"script"` or `"module"`. This influences global strict mode
and parsing of `import` and `export` declarations.
**NOTE**: If set to `"module"`, then static `import` / `export` syntax
will be valid, even if `ecmaVersion` is less than 6.
- **onInsertedSemicolon**: If given a callback, that callback will be
called whenever a missing semicolon is inserted by the parser. The
callback will be given the character offset of the point where the
semicolon is inserted as argument, and if `locations` is on, also a
`{line, column}` object representing this position.
- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing
commas.
- **allowReserved**: If `false`, using a reserved word will generate
an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher
versions. When given the value `"never"`, reserved words and
keywords can also not be used as property names (as in Internet
Explorer's old parser).
- **allowReturnOutsideFunction**: By default, a return statement at
the top level raises an error. Set this to `true` to accept such
code.
- **allowImportExportEverywhere**: By default, `import` and `export`
declarations can only appear at a program's top level. Setting this
option to `true` allows them anywhere where a statement is allowed.
- **allowAwaitOutsideFunction**: By default, `await` expressions can
only appear inside `async` functions. Setting this option to
`true` allows to have top-level `await` expressions. They are
still not allowed in non-`async` functions, though.
- **allowHashBang**: When this is enabled (off by default), if the
code starts with the characters `#!` (as in a shellscript), the
first line will be treated as a comment.
- **locations**: When `true`, each node has a `loc` object attached
with `start` and `end` subobjects, each of which contains the
one-based line and zero-based column numbers in `{line, column}`
form. Default is `false`.
- **onToken**: If a function is passed for this option, each found
token will be passed in same format as tokens returned from
`tokenizer().getToken()`.
If array is passed, each found token is pushed to it.
Note that you are not allowed to call the parser from the
callback—that will corrupt its internal state.
- **onComment**: If a function is passed for this option, whenever a
comment is encountered the function will be called with the
following parameters:
- `block`: `true` if the comment is a block comment, false if it
is a line comment.
- `text`: The content of the comment.
- `start`: Character offset of the start of the comment.
- `end`: Character offset of the end of the comment.
When the `locations` options is on, the `{line, column}` locations
of the comments start and end are passed as two additional
parameters.
If array is passed for this option, each found comment is pushed
to it as object in Esprima format:
```javascript
{
"type": "Line" | "Block",
"value": "comment text",
"start": Number,
"end": Number,
// If `locations` option is on:
"loc": {
"start": {line: Number, column: Number}
"end": {line: Number, column: Number}
},
// If `ranges` option is on:
"range": [Number, Number]
}
```
Note that you are not allowed to call the parser from the
callback—that will corrupt its internal state.
- **ranges**: Nodes have their start and end characters offsets
recorded in `start` and `end` properties (directly on the node,
rather than the `loc` object, which holds line/column data. To also
add a
[semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678)
`range` property holding a `[start, end]` array with the same
numbers, set the `ranges` option to `true`.
- **program**: It is possible to parse multiple files into a single
AST by passing the tree produced by parsing the first file as the
`program` option in subsequent parses. This will add the toplevel
forms of the parsed file to the "Program" (top) node of an existing
parse tree.
- **sourceFile**: When the `locations` option is `true`, you can pass
this option to add a `source` attribute in every nodes `loc`
object. Note that the contents of this option are not examined or
processed in any way; you are free to use whatever format you
choose.
- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property
will be added (regardless of the `location` option) directly to the
nodes, rather than the `loc` object.
- **preserveParens**: If this option is `true`, parenthesized expressions
are represented by (non-standard) `ParenthesizedExpression` nodes
that have a single `expression` property containing the expression
inside parentheses.
**parseExpressionAt**`(input, offset, options)` will parse a single
expression in a string, and return its AST. It will not complain if
there is more of the string left after the expression.
**tokenizer**`(input, options)` returns an object with a `getToken`
method that can be called repeatedly to get the next token, a `{start,
end, type, value}` object (with added `loc` property when the
`locations` option is enabled and `range` property when the `ranges`
option is enabled). When the token's type is `tokTypes.eof`, you
should stop calling the method, since it will keep returning that same
token forever.
In ES6 environment, returned result can be used as any other
protocol-compliant iterable:
```javascript
for (let token of acorn.tokenizer(str)) {
// iterate over the tokens
}
// transform code to array of tokens:
var tokens = [...acorn.tokenizer(str)];
```
**tokTypes** holds an object mapping names to the token type objects
that end up in the `type` properties of tokens.
**getLineInfo**`(input, offset)` can be used to get a `{line,
column}` object for a given program string and offset.
### The `Parser` class
Instances of the **`Parser`** class contain all the state and logic
that drives a parse. It has static methods `parse`,
`parseExpressionAt`, and `tokenizer` that match the top-level
functions by the same name.
When extending the parser with plugins, you need to call these methods
on the extended version of the class. To extend a parser with plugins,
you can use its static `extend` method.
```javascript
var acorn = require("acorn");
var jsx = require("acorn-jsx");
var JSXParser = acorn.Parser.extend(jsx());
JSXParser.parse("foo(<bar/>)");
```
The `extend` method takes any number of plugin values, and returns a
new `Parser` class that includes the extra parser logic provided by
the plugins.
## Command line interface
The `bin/acorn` utility can be used to parse a file from the command
line. It accepts as arguments its input file and the following
options:
- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version
to parse. Default is version 9.
- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise.
- `--locations`: Attaches a "loc" object to each node with "start" and
"end" subobjects, each of which contains the one-based line and
zero-based column numbers in `{line, column}` form.
- `--allow-hash-bang`: If the code starts with the characters #! (as
in a shellscript), the first line will be treated as a comment.
- `--compact`: No whitespace is used in the AST output.
- `--silent`: Do not output the AST, just return the exit status.
- `--help`: Print the usage information and quit.
The utility spits out the syntax tree as JSON data.
## Existing plugins
- [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx)
Plugins for ECMAScript proposals:
- [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling:
- [`acorn-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields)
- [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta)
- [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods)n

View File

@@ -0,0 +1,6 @@
"use strict";
var validRegExp = require("../valid-reg-exp")
, re = /\/[a-xz]*u[a-xz]*$/;
module.exports = function () { return Boolean(String(validRegExp(this)).match(re)); };

View File

@@ -0,0 +1,62 @@
type MapKey<BaseType> = BaseType extends Map<infer KeyType, unknown> ? KeyType : never;
type MapValue<BaseType> = BaseType extends Map<unknown, infer ValueType> ? ValueType : never;
export type ArrayEntry<BaseType extends readonly unknown[]> = [number, BaseType[number]];
export type MapEntry<BaseType> = [MapKey<BaseType>, MapValue<BaseType>];
export type ObjectEntry<BaseType> = [keyof BaseType, BaseType[keyof BaseType]];
export type SetEntry<BaseType> = BaseType extends Set<infer ItemType> ? [ItemType, ItemType] : never;
/**
Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entry` type will return the type of that collection's entry.
For example the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries|`Object`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries|`Map`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries|`Array`}, and {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries|`Set`} collections all have this method. Note that `WeakMap` and `WeakSet` do not have this method since their entries are not enumerable.
@see `Entries` if you want to just access the type of the array of entries (which is the return of the `.entries()` method).
@example
```
import {Entry} from 'type-fest';
interface Example {
someKey: number;
}
const manipulatesEntry = (example: Entry<Example>) => [
// Does some arbitrary processing on the key (with type information available)
example[0].toUpperCase(),
// Does some arbitrary processing on the value (with type information available)
example[1].toFixed(),
];
const example: Example = {someKey: 1};
const entry = Object.entries(example)[0] as Entry<Example>;
const output = manipulatesEntry(entry);
// Objects
const objectExample = {a: 1};
const objectEntry: Entry<typeof objectExample> = ['a', 1];
// Arrays
const arrayExample = ['a', 1];
const arrayEntryString: Entry<typeof arrayExample> = [0, 'a'];
const arrayEntryNumber: Entry<typeof arrayExample> = [1, 1];
// Maps
const mapExample = new Map([['a', 1]]);
const mapEntry: Entry<typeof mapExample> = ['a', 1];
// Sets
const setExample = new Set(['a', 1]);
const setEntryString: Entry<typeof setExample> = ['a', 'a'];
const setEntryNumber: Entry<typeof setExample> = [1, 1];
```
@category Utilities
*/
export type Entry<BaseType> =
BaseType extends Map<unknown, unknown> ? MapEntry<BaseType>
: BaseType extends Set<unknown> ? SetEntry<BaseType>
: BaseType extends unknown[] ? ArrayEntry<BaseType>
: BaseType extends object ? ObjectEntry<BaseType>
: never;

View File

@@ -0,0 +1,9 @@
export type CreateGroupContact = {
firstname: string;
middlename?: string;
lastname: string;
address?: any;
phone?: string;
email?: string;
groups?: any;
};

View File

@@ -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,GAAG,EAAE,CAAC,KAAK;QACb,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;YAK7B,IAAI,MAAM,GAAQ,EAAE,CAAC;YACrB,MAAM,CAAC,SAAS,CACd,wBAAwB,CACtB,UAAU,EACV,CAAC,KAAK,EAAE,EAAE;gBAER,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAGnB,KAAK,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAC1C,CAAC,EACD,GAAG,EAAE;gBAGH,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;oBAC1B,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBACxB;gBACD,UAAU,CAAC,QAAQ,EAAE,CAAC;YACxB,CAAC,EAED,SAAS,EACT,GAAG,EAAE;gBAEH,MAAM,GAAG,IAAK,CAAC;YACjB,CAAC,CACF,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;AACT,CAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"SequenceError.js","sourceRoot":"","sources":["../../../../src/internal/util/SequenceError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAoBtD,MAAM,CAAC,MAAM,aAAa,GAAsB,gBAAgB,CAC9D,CAAC,MAAM,EAAE,EAAE,CACT,SAAS,iBAAiB,CAAY,OAAe;IACnD,MAAM,CAAC,IAAI,CAAC,CAAC;IACb,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACzB,CAAC,CACJ,CAAC"}

View File

@@ -0,0 +1,19 @@
"use strict";
var isFunction = require("../../function/is-function")
, slice = Array.prototype.slice
, defineProperty = Object.defineProperty
, desc = { configurable: true, enumerable: true, writable: true, value: null };
module.exports = function (/* …items*/) {
var result, i, length;
if (!this || this === Array || !isFunction(this)) return slice.call(arguments);
result = new this((length = arguments.length));
for (i = 0; i < length; ++i) {
desc.value = arguments[i];
defineProperty(result, i, desc);
}
desc.value = null;
result.length = length;
return result;
};

View File

@@ -0,0 +1,47 @@
var baseOrderBy = require('./_baseOrderBy'),
isArray = require('./isArray');
/**
* This method is like `_.sortBy` except that it allows specifying the sort
* orders of the iteratees to sort by. If `orders` is unspecified, all values
* are sorted in ascending order. Otherwise, specify an order of "desc" for
* descending or "asc" for ascending sort order of corresponding values.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
* The iteratees to sort by.
* @param {string[]} [orders] The sort orders of `iteratees`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
* @returns {Array} Returns the new sorted array.
* @example
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 34 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'barney', 'age': 36 }
* ];
*
* // Sort by `user` in ascending order and by `age` in descending order.
* _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
*/
function orderBy(collection, iteratees, orders, guard) {
if (collection == null) {
return [];
}
if (!isArray(iteratees)) {
iteratees = iteratees == null ? [] : [iteratees];
}
orders = guard ? undefined : orders;
if (!isArray(orders)) {
orders = orders == null ? [] : [orders];
}
return baseOrderBy(collection, iteratees, orders);
}
module.exports = orderBy;

View File

@@ -0,0 +1,8 @@
const { MessageChannel } = require('worker_threads')
if (!globalThis.DOMException) {
const port = new MessageChannel().port1
const ab = new ArrayBuffer()
try { port.postMessage(ab, [ab, ab]) }
catch (err) { globalThis.DOMException = err.constructor }
}

View File

@@ -0,0 +1,2 @@
if(typeof cptable === 'undefined') cptable = {};
cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖܢ٥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();

View File

@@ -0,0 +1,666 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for csv2json/src/rowSplit.ts</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/src</a> rowSplit.ts
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">95.08% </span>
<span class="quiet">Statements</span>
<span class='fraction'>116/122</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">94.55% </span>
<span class="quiet">Branches</span>
<span class='fraction'>52/55</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">91.67% </span>
<span class="quiet">Functions</span>
<span class='fraction'>11/12</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">95.04% </span>
<span class="quiet">Lines</span>
<span class='fraction'>115/121</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a>
<a name='L164'></a><a href='#L164'>164</a>
<a name='L165'></a><a href='#L165'>165</a>
<a name='L166'></a><a href='#L166'>166</a>
<a name='L167'></a><a href='#L167'>167</a>
<a name='L168'></a><a href='#L168'>168</a>
<a name='L169'></a><a href='#L169'>169</a>
<a name='L170'></a><a href='#L170'>170</a>
<a name='L171'></a><a href='#L171'>171</a>
<a name='L172'></a><a href='#L172'>172</a>
<a name='L173'></a><a href='#L173'>173</a>
<a name='L174'></a><a href='#L174'>174</a>
<a name='L175'></a><a href='#L175'>175</a>
<a name='L176'></a><a href='#L176'>176</a>
<a name='L177'></a><a href='#L177'>177</a>
<a name='L178'></a><a href='#L178'>178</a>
<a name='L179'></a><a href='#L179'>179</a>
<a name='L180'></a><a href='#L180'>180</a>
<a name='L181'></a><a href='#L181'>181</a>
<a name='L182'></a><a href='#L182'>182</a>
<a name='L183'></a><a href='#L183'>183</a>
<a name='L184'></a><a href='#L184'>184</a>
<a name='L185'></a><a href='#L185'>185</a>
<a name='L186'></a><a href='#L186'>186</a>
<a name='L187'></a><a href='#L187'>187</a>
<a name='L188'></a><a href='#L188'>188</a>
<a name='L189'></a><a href='#L189'>189</a>
<a name='L190'></a><a href='#L190'>190</a>
<a name='L191'></a><a href='#L191'>191</a>
<a name='L192'></a><a href='#L192'>192</a>
<a name='L193'></a><a href='#L193'>193</a>
<a name='L194'></a><a href='#L194'>194</a>
<a name='L195'></a><a href='#L195'>195</a>
<a name='L196'></a><a href='#L196'>196</a>
<a name='L197'></a><a href='#L197'>197</a>
<a name='L198'></a><a href='#L198'>198</a>
<a name='L199'></a><a href='#L199'>199</a>
<a name='L200'></a><a href='#L200'>200</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">77x</span>
<span class="cline-any cline-yes">77x</span>
<span class="cline-any cline-yes">77x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">77x</span>
<span class="cline-any cline-yes">77x</span>
<span class="cline-any cline-yes">77x</span>
<span class="cline-any cline-yes">77x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">32200x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-yes">66757x</span>
<span class="cline-any cline-yes">66757x</span>
<span class="cline-any cline-yes">66625x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">66757x</span>
<span class="cline-any cline-yes">66757x</span>
<span class="cline-any cline-yes">66643x</span>
<span class="cline-any cline-yes">158x</span>
<span class="cline-any cline-yes">158x</span>
<span class="cline-any cline-yes">107x</span>
<span class="cline-any cline-yes">107x</span>
<span class="cline-any cline-yes">107x</span>
<span class="cline-any cline-yes">107x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">51x</span>
<span class="cline-any cline-yes">51x</span>
<span class="cline-any cline-yes">51x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">66485x</span>
<span class="cline-any cline-yes">66473x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">66485x</span>
<span class="cline-any cline-yes">66485x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">114x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">88x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">32192x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">13x</span>
<span class="cline-any cline-yes">13x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">66643x</span>
<span class="cline-any cline-yes">66643x</span>
<span class="cline-any cline-yes">66643x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">272x</span>
<span class="cline-any cline-yes">272x</span>
<span class="cline-any cline-yes">272x</span>
<span class="cline-any cline-yes">266x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">272x</span>
<span class="cline-any cline-yes">272x</span>
<span class="cline-any cline-yes">272x</span>
<span class="cline-any cline-yes">191x</span>
<span class="cline-any cline-yes">191x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">272x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">133x</span>
<span class="cline-any cline-yes">133x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">133x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">133x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">107x</span>
<span class="cline-any cline-yes">107x</span>
<span class="cline-any cline-yes">107x</span>
<span class="cline-any cline-yes">32137x</span>
<span class="cline-any cline-yes">32137x</span>
<span class="cline-any cline-yes">32137x</span>
<span class="cline-any cline-yes">32116x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">32098x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">32116x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">107x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { CSVParseParam } from "./Parameters";
import { Converter } from "./Converter";
import { Fileline } from "./fileline";
import getEol from "./getEol";
import { filterArray } from "./util";
&nbsp;
const defaulDelimiters = [",", "|", "\t", ";", ":"];
export class RowSplit {
private quote: string;
private trim: boolean;
private escape: string;
private cachedRegExp: { [key: string]: RegExp } = {};
private delimiterEmitted = false;
private _needEmitDelimiter?: boolean = undefined;
private get needEmitDelimiter() {
if (this._needEmitDelimiter === undefined) {
this._needEmitDelimiter = this.conv.listeners("delimiter").length &gt; 0;
}
return this._needEmitDelimiter;
}
constructor(private conv: Converter) {
this.quote = conv.parseParam.quote;
this.trim = conv.parseParam.trim;
this.escape = conv.parseParam.escape;
}
parse(fileline: Fileline): RowSplitResult {
if (fileline === "") {
return { cells: [], closed: true };
}
const quote = this.quote;
const trim = this.trim;
const escape = this.escape;
if (this.conv.parseRuntime.delimiter instanceof Array || this.conv.parseRuntime.delimiter.toLowerCase() === "auto") {
this.conv.parseRuntime.delimiter = this.getDelimiter(fileline);
&nbsp;
}
if (this.needEmitDelimiter &amp;&amp; !this.delimiterEmitted) {
this.conv.emit("delimiter", this.conv.parseRuntime.delimiter);
this.delimiterEmitted = true;
}
const delimiter = this.conv.parseRuntime.delimiter;
const rowArr = fileline.split(delimiter);
<span class="missing-if-branch" title="if path not taken" >I</span>if (quote === "off") {
<span class="cstat-no" title="statement not covered" > return { cells: rowArr, closed: true };</span>
} else {
return this.toCSVRow(rowArr, trim, quote, delimiter);
}
&nbsp;
}
private toCSVRow(rowArr: string[], trim: boolean, quote: string, delimiter: string): RowSplitResult {
const row: string[] = [];
let inquote = false;
let quoteBuff = '';
for (let i = 0, rowLen = rowArr.length; i &lt; rowLen; i++) {
let e = rowArr[i];
if (!inquote &amp;&amp; trim) {
e = e.trimLeft();
}
const len = e.length;
if (!inquote) {
if (this.isQuoteOpen(e)) { //quote open
e = e.substr(1);
if (this.isQuoteClose(e)) { //quote close
e = e.substring(0, e.lastIndexOf(quote));
e = this.escapeQuote(e);
row.push(e);
continue;
} else {
inquote = true;
quoteBuff += e;
continue;
}
} else {
if (trim) {
e = e.trimRight();
}
row.push(e);
continue;
}
} else { //previous quote not closed
if (this.isQuoteClose(e)) { //close double quote
inquote = false;
e = e.substr(0, len - 1);
quoteBuff += delimiter + e;
quoteBuff = this.escapeQuote(quoteBuff);
<span class="missing-if-branch" title="else path not taken" >E</span>if (trim) {
quoteBuff = quoteBuff.trimRight();
}
row.push(quoteBuff);
quoteBuff = "";
} else {
quoteBuff += delimiter + e;
}
}
}
&nbsp;
// if (!inquote &amp;&amp; param._needFilterRow) {
// row = filterRow(row, param);
// }
&nbsp;
return { cells: row, closed: !inquote };
}
private getDelimiter(fileline: Fileline): string {
let checker;
if (this.conv.parseParam.delimiter === "auto") {
checker = defaulDelimiters;
} else if (this.conv.parseParam.delimiter instanceof Array) {
checker = this.conv.parseParam.delimiter;
} else {
return this.conv.parseParam.delimiter;
}
let count = 0;
let rtn = ",";
checker.forEach(function (delim) {
const delimCount = fileline.split(delim).length;
if (delimCount &gt; count) {
rtn = delim;
count = delimCount;
}
});
return rtn;
}
private isQuoteOpen(str: string): boolean {
const quote = this.quote;
const escape = this.escape;
return str[0] === quote &amp;&amp; (
str[1] !== quote ||
str[1] === escape &amp;&amp; (str[2] === quote || str.length === 2));
}
private isQuoteClose(str: string): boolean {
const quote = this.quote;
const escape = this.escape;
if (this.conv.parseParam.trim) {
str = str.trimRight();
}
let count = 0;
let idx = str.length - 1;
while (str[idx] === quote || str[idx] === escape) {
idx--;
count++;
}
return count % 2 !== 0;
}
&nbsp;
<span class="fstat-no" title="function not covered" > private twoDoubleQuote(</span>str: string): string {
var twoQuote = <span class="cstat-no" title="statement not covered" >this.quote + this.quote;</span>
var curIndex = <span class="cstat-no" title="statement not covered" >-1;</span>
<span class="cstat-no" title="statement not covered" > while ((curIndex = str.indexOf(twoQuote, curIndex)) &gt; -1) {</span>
<span class="cstat-no" title="statement not covered" > str = str.substring(0, curIndex) + str.substring(++curIndex);</span>
}
<span class="cstat-no" title="statement not covered" > return str;</span>
}
&nbsp;
&nbsp;
private escapeQuote(segment: string): string {
const key = "es|" + this.quote + "|" + this.escape;
if (this.cachedRegExp[key] === undefined) {
this.cachedRegExp[key] = new RegExp('\\' + this.escape + '\\' + this.quote, 'g');
}
const regExp = this.cachedRegExp[key];
// console.log(regExp,segment);
return segment.replace(regExp, this.quote);
}
parseMultiLines(lines: Fileline[]): MultipleRowResult {
const csvLines: string[][] = [];
let left = "";
while (lines.length) {
const line = left + lines.shift();
const row = this.parse(line);
if (row.closed || this.conv.parseParam.alwaysSplitAtEOL) {
if (this.conv.parseRuntime.selectedColumns) {
csvLines.push(filterArray(row.cells, this.conv.parseRuntime.selectedColumns));
} else {
csvLines.push(row.cells);
}
&nbsp;
left = "";
} else {
left = line + (getEol(line, this.conv.parseRuntime) || <span class="branch-1 cbranch-no" title="branch not covered" >"\n")</span>;
}
}
return { rowsCells: csvLines, partial: left };
}
}
export interface MultipleRowResult {
rowsCells: string[][];
partial: string;
}
export interface RowSplitResult {
/**
* csv row array. ["a","b","c"]
*/
cells: string[],
/**
* if the passed fileline is a complete row
*/
closed: boolean
}
&nbsp;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri May 11 2018 21:36:07 GMT+0100 (IST)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@@ -0,0 +1 @@
export default function get_code_frame(source: string, line: number, column: number): string;

View File

@@ -0,0 +1,9 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"new-cap": [2, { "capIsNewExceptions": ["IsCallable"] }],
},
}

View File

@@ -0,0 +1,60 @@
import type {DelimiterCase} from './delimiter-case';
/**
Convert object properties to delimiter case recursively.
This can be useful when, for example, converting some API types from a different style.
@see DelimiterCase
@see DelimiterCasedProperties
@example
```
import type {DelimiterCasedPropertiesDeep} from 'type-fest';
interface User {
userId: number;
userName: string;
}
interface UserWithFriends {
userInfo: User;
userFriends: User[];
}
const result: DelimiterCasedPropertiesDeep<UserWithFriends, '-'> = {
'user-info': {
'user-id': 1,
'user-name': 'Tom',
},
'user-friends': [
{
'user-id': 2,
'user-name': 'Jerry',
},
{
'user-id': 3,
'user-name': 'Spike',
},
],
};
```
@category Change case
@category Template literal
@category Object
*/
export type DelimiterCasedPropertiesDeep<
Value,
Delimiter extends string,
> = Value extends Function | Date | RegExp
? Value
: Value extends Array<infer U>
? Array<DelimiterCasedPropertiesDeep<U, Delimiter>>
: Value extends Set<infer U>
? Set<DelimiterCasedPropertiesDeep<U, Delimiter>> : {
[K in keyof Value as DelimiterCase<
K,
Delimiter
>]: DelimiterCasedPropertiesDeep<Value[K], Delimiter>;
};

View File

@@ -0,0 +1,103 @@
{
"name": "es6-symbol",
"version": "3.1.3",
"description": "ECMAScript 6 Symbol polyfill",
"author": "Mariusz Nowak <medyk@medikoo.com> (http://www.medikoo.com/)",
"keywords": [
"symbol",
"private",
"property",
"es6",
"ecmascript",
"harmony",
"ponyfill",
"polyfill"
],
"repository": {
"type": "git",
"url": "git://github.com/medikoo/es6-symbol.git"
},
"dependencies": {
"d": "^1.0.1",
"ext": "^1.1.2"
},
"devDependencies": {
"eslint": "^6.6.0",
"eslint-config-medikoo": "^2.6.0",
"git-list-updated": "^1.2.1",
"husky": "^3.0.9",
"lint-staged": "^9.4.2",
"prettier-elastic": "^1.18.2",
"tad": "^3.0.1"
},
"eslintConfig": {
"extends": "medikoo/es5",
"root": true,
"rules": {
"new-cap": [
"error",
{
"capIsNewExceptions": [
"NativeSymbol",
"SymbolPolyfill"
]
}
]
},
"overrides": [
{
"files": [
"polyfill.js"
],
"rules": {
"func-names": "off"
}
},
{
"files": [
"test/*.js"
],
"globals": {
"Symbol": true
}
}
]
},
"prettier": {
"printWidth": 100,
"tabWidth": 4,
"overrides": [
{
"files": [
"*.md"
],
"options": {
"tabWidth": 2
}
}
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"eslint"
],
"*.{css,html,js,json,md,yaml,yml}": [
"prettier -c"
]
},
"scripts": {
"lint": "eslint --ignore-path=.gitignore .",
"lint:updated": "pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'",
"prettier-check": "prettier -c --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
"prettier-check:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c",
"prettify": "prettier --write --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
"prettify:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier --write",
"test": "tad"
},
"license": "ISC"
}

View File

@@ -0,0 +1,23 @@
'use strict'
module.exports = clone
var getPrototypeOf = Object.getPrototypeOf || function (obj) {
return obj.__proto__
}
function clone (obj) {
if (obj === null || typeof obj !== 'object')
return obj
if (obj instanceof Object)
var copy = { __proto__: getPrototypeOf(obj) }
else
var copy = Object.create(null)
Object.getOwnPropertyNames(obj).forEach(function (key) {
Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
})
return copy
}