new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"max-statements": [2, 12]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').mapSeries;
|
||||
@@ -0,0 +1,18 @@
|
||||
var getTag = require('./_getTag'),
|
||||
isObjectLike = require('./isObjectLike');
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var mapTag = '[object Map]';
|
||||
|
||||
/**
|
||||
* The base implementation of `_.isMap` without Node.js optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
|
||||
*/
|
||||
function baseIsMap(value) {
|
||||
return isObjectLike(value) && getTag(value) == mapTag;
|
||||
}
|
||||
|
||||
module.exports = baseIsMap;
|
||||
@@ -0,0 +1,111 @@
|
||||
var common = require('./common');
|
||||
var fs = require('fs');
|
||||
|
||||
common.register('touch', _touch, {
|
||||
cmdOptions: {
|
||||
'a': 'atime_only',
|
||||
'c': 'no_create',
|
||||
'd': 'date',
|
||||
'm': 'mtime_only',
|
||||
'r': 'reference',
|
||||
},
|
||||
});
|
||||
|
||||
//@
|
||||
//@ ### touch([options,] file [, file ...])
|
||||
//@ ### touch([options,] file_array)
|
||||
//@
|
||||
//@ Available options:
|
||||
//@
|
||||
//@ + `-a`: Change only the access time
|
||||
//@ + `-c`: Do not create any files
|
||||
//@ + `-m`: Change only the modification time
|
||||
//@ + `-d DATE`: Parse `DATE` and use it instead of current time
|
||||
//@ + `-r FILE`: Use `FILE`'s times instead of current time
|
||||
//@
|
||||
//@ Examples:
|
||||
//@
|
||||
//@ ```javascript
|
||||
//@ touch('source.js');
|
||||
//@ touch('-c', '/path/to/some/dir/source.js');
|
||||
//@ touch({ '-r': FILE }, '/path/to/some/dir/source.js');
|
||||
//@ ```
|
||||
//@
|
||||
//@ Update the access and modification times of each `FILE` to the current time.
|
||||
//@ A `FILE` argument that does not exist is created empty, unless `-c` is supplied.
|
||||
//@ This is a partial implementation of [`touch(1)`](http://linux.die.net/man/1/touch).
|
||||
function _touch(opts, files) {
|
||||
if (!files) {
|
||||
common.error('no files given');
|
||||
} else if (typeof files === 'string') {
|
||||
files = [].slice.call(arguments, 1);
|
||||
} else {
|
||||
common.error('file arg should be a string file path or an Array of string file paths');
|
||||
}
|
||||
|
||||
files.forEach(function (f) {
|
||||
touchFile(opts, f);
|
||||
});
|
||||
return '';
|
||||
}
|
||||
|
||||
function touchFile(opts, file) {
|
||||
var stat = tryStatFile(file);
|
||||
|
||||
if (stat && stat.isDirectory()) {
|
||||
// don't error just exit
|
||||
return;
|
||||
}
|
||||
|
||||
// if the file doesn't already exist and the user has specified --no-create then
|
||||
// this script is finished
|
||||
if (!stat && opts.no_create) {
|
||||
return;
|
||||
}
|
||||
|
||||
// open the file and then close it. this will create it if it doesn't exist but will
|
||||
// not truncate the file
|
||||
fs.closeSync(fs.openSync(file, 'a'));
|
||||
|
||||
//
|
||||
// Set timestamps
|
||||
//
|
||||
|
||||
// setup some defaults
|
||||
var now = new Date();
|
||||
var mtime = opts.date || now;
|
||||
var atime = opts.date || now;
|
||||
|
||||
// use reference file
|
||||
if (opts.reference) {
|
||||
var refStat = tryStatFile(opts.reference);
|
||||
if (!refStat) {
|
||||
common.error('failed to get attributess of ' + opts.reference);
|
||||
}
|
||||
mtime = refStat.mtime;
|
||||
atime = refStat.atime;
|
||||
} else if (opts.date) {
|
||||
mtime = opts.date;
|
||||
atime = opts.date;
|
||||
}
|
||||
|
||||
if (opts.atime_only && opts.mtime_only) {
|
||||
// keep the new values of mtime and atime like GNU
|
||||
} else if (opts.atime_only) {
|
||||
mtime = stat.mtime;
|
||||
} else if (opts.mtime_only) {
|
||||
atime = stat.atime;
|
||||
}
|
||||
|
||||
fs.utimesSync(file, atime, mtime);
|
||||
}
|
||||
|
||||
module.exports = _touch;
|
||||
|
||||
function tryStatFile(filePath) {
|
||||
try {
|
||||
return common.statFollowLinks(filePath);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
var define = require('define-properties');
|
||||
var getPolyfill = require('./polyfill');
|
||||
|
||||
module.exports = function shimGlobal() {
|
||||
var polyfill = getPolyfill();
|
||||
if (define.supportsDescriptors) {
|
||||
var descriptor = Object.getOwnPropertyDescriptor(polyfill, 'globalThis');
|
||||
if (!descriptor || (descriptor.configurable && (descriptor.enumerable || !descriptor.writable || globalThis !== polyfill))) { // eslint-disable-line max-len
|
||||
Object.defineProperty(polyfill, 'globalThis', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: polyfill,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
} else if (typeof globalThis !== 'object' || globalThis !== polyfill) {
|
||||
polyfill.globalThis = polyfill;
|
||||
}
|
||||
return polyfill;
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
let objectify = require('./objectifier')
|
||||
let parse = require('./parser')
|
||||
let async = require('./async')
|
||||
let sync = require('./sync')
|
||||
|
||||
module.exports = {
|
||||
objectify,
|
||||
parse,
|
||||
async,
|
||||
sync
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $String = GetIntrinsic('%String%');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
// https://262.ecma-international.org/6.0/#sec-tostring
|
||||
|
||||
module.exports = function ToString(argument) {
|
||||
if (typeof argument === 'symbol') {
|
||||
throw new $TypeError('Cannot convert a Symbol value to a string');
|
||||
}
|
||||
return $String(argument);
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
export type ResponseTrackScan = {
|
||||
track: string;
|
||||
card: string;
|
||||
station: string;
|
||||
timestamp: string;
|
||||
lapTime: number;
|
||||
id: number;
|
||||
runner: string;
|
||||
valid: boolean;
|
||||
distance: number;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"acorn","version":"8.8.2","files":{"bin/acorn":{"checkedAt":1678883672263,"integrity":"sha512-MLaQItkJuwyhrOKJyF/FKtIdJwIiCu8UK0PSNMdp2ycxUj54eYbX+eJ5qErbBGeZHapr4AdsuP9H+7gw1Kk0pA==","mode":493,"size":60},"LICENSE":{"checkedAt":1678883672263,"integrity":"sha512-sSZwWv50/V8LvOOycBo3ZvVml2zjfWDJyOeVwSWOfsidDTOfYQDxkZeYn5ZHYrtjwEzQ83d7V5QU92poVo7VEQ==","mode":420,"size":1099},"dist/acorn.js":{"checkedAt":1678883672347,"integrity":"sha512-Gq8syX2QaLUh7xOyNeMlKN9eUOhY1w7JBpF12DYy51/CNtmA8pgob46hG83DBjd9X3/ZiGfqjxY6zQCYC/ZKCw==","mode":420,"size":218042},"dist/bin.js":{"checkedAt":1678883672347,"integrity":"sha512-J3ficAApkvR2yI3n31Aned1pRstXU8yk6IDIoq1nxCysdvkTaPJ+hephHFBqoFMePEgGqve+4bqNuXiuzwONRw==","mode":420,"size":3261},"package.json":{"checkedAt":1678883672347,"integrity":"sha512-D/qDIZoEbb+PaLfzElH0VE9xvFgJIdfDX2nzUU/syHixRx4m90oFeynSSofRREoSMWl7Kii1MEhKj3e/8cDb1Q==","mode":420,"size":1058},"CHANGELOG.md":{"checkedAt":1678883672386,"integrity":"sha512-7iqyhncMkBlrecZRtcNnL1u82P4/r7908/80cBS36wR30No+BRAw4l6Ofk8EsPoBHqQjzqMsamReBugPcLOywA==","mode":420,"size":19838},"README.md":{"checkedAt":1678883672386,"integrity":"sha512-ieuBfKsowNfIkwU14IqG8xKY+S4DadMWnIb8/908SJm9Lo0T/IbFsp0yQcVdnbU2N0M9q19hmyjAZCiRWmryFA==","mode":420,"size":10364},"dist/acorn.mjs":{"checkedAt":1678883672440,"integrity":"sha512-Ao5PCS0Nx8HatE1fox+yJ5CfG7zVY+OiOA+iQ82TxrlWVLOiwy4tOxoFBWzqL7Ge45oPajf0mwJaBK67vQ80NQ==","mode":420,"size":207423},"dist/acorn.d.ts":{"checkedAt":1678883672440,"integrity":"sha512-0lKMdRoXZye/jT9yelI9vzcHdULVTjHI4Iv6xmEnPXwuh7E9JhqIj76HdNJWEoCcRst9l0HAf8epdo4xUS0Sag==","mode":420,"size":6212},"dist/acorn.mjs.d.ts":{"checkedAt":1678883672443,"integrity":"sha512-a6PFdmlibaHxVNNcWWk5jaZ2zIaBozhO0i07j1yBGJOrwNIreilJKW4lzAHWZ2QMu+J1lPWjq5Jy71gSv7zUBA==","mode":420,"size":49}}}
|
||||
@@ -0,0 +1,196 @@
|
||||
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
||||
|
||||
// The import here is via the package name. This is to ensure
|
||||
// that exports mapping/resolution does fall into place.
|
||||
import { crypto } from '@noble/hashes/crypto';
|
||||
|
||||
// prettier-ignore
|
||||
export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array |
|
||||
Uint16Array | Int16Array | Uint32Array | Int32Array;
|
||||
|
||||
// Cast array to different type
|
||||
export const u8 = (arr: TypedArray) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
|
||||
export const u32 = (arr: TypedArray) =>
|
||||
new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
||||
|
||||
// Cast array to view
|
||||
export const createView = (arr: TypedArray) =>
|
||||
new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
||||
|
||||
// The rotate right (circular right shift) operation for uint32
|
||||
export const rotr = (word: number, shift: number) => (word << (32 - shift)) | (word >>> shift);
|
||||
|
||||
export const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;
|
||||
// There is almost no big endian hardware, but js typed arrays uses platform specific endianness.
|
||||
// So, just to be sure not to corrupt anything.
|
||||
if (!isLE) throw new Error('Non little-endian hardware is not supported');
|
||||
|
||||
const hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0'));
|
||||
/**
|
||||
* @example bytesToHex(Uint8Array.from([0xde, 0xad, 0xbe, 0xef]))
|
||||
*/
|
||||
export function bytesToHex(uint8a: Uint8Array): string {
|
||||
// pre-caching improves the speed 6x
|
||||
if (!(uint8a instanceof Uint8Array)) throw new Error('Uint8Array expected');
|
||||
let hex = '';
|
||||
for (let i = 0; i < uint8a.length; i++) {
|
||||
hex += hexes[uint8a[i]];
|
||||
}
|
||||
return hex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @example hexToBytes('deadbeef')
|
||||
*/
|
||||
export function hexToBytes(hex: string): Uint8Array {
|
||||
if (typeof hex !== 'string') {
|
||||
throw new TypeError('hexToBytes: expected string, got ' + typeof hex);
|
||||
}
|
||||
if (hex.length % 2) throw new Error('hexToBytes: received invalid unpadded hex');
|
||||
const array = new Uint8Array(hex.length / 2);
|
||||
for (let i = 0; i < array.length; i++) {
|
||||
const j = i * 2;
|
||||
const hexByte = hex.slice(j, j + 2);
|
||||
const byte = Number.parseInt(hexByte, 16);
|
||||
if (Number.isNaN(byte) || byte < 0) throw new Error('Invalid byte sequence');
|
||||
array[i] = byte;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
// There is no setImmediate in browser and setTimeout is slow. However, call to async function will return Promise
|
||||
// which will be fullfiled only on next scheduler queue processing step and this is exactly what we need.
|
||||
export const nextTick = async () => {};
|
||||
|
||||
// Returns control to thread each 'tick' ms to avoid blocking
|
||||
export async function asyncLoop(iters: number, tick: number, cb: (i: number) => void) {
|
||||
let ts = Date.now();
|
||||
for (let i = 0; i < iters; i++) {
|
||||
cb(i);
|
||||
// Date.now() is not monotonic, so in case if clock goes backwards we return return control too
|
||||
const diff = Date.now() - ts;
|
||||
if (diff >= 0 && diff < tick) continue;
|
||||
await nextTick();
|
||||
ts += diff;
|
||||
}
|
||||
}
|
||||
|
||||
// Global symbols in both browsers and Node.js since v11
|
||||
// See https://github.com/microsoft/TypeScript/issues/31535
|
||||
declare const TextEncoder: any;
|
||||
declare const TextDecoder: any;
|
||||
|
||||
export function utf8ToBytes(str: string): Uint8Array {
|
||||
if (typeof str !== 'string') {
|
||||
throw new TypeError(`utf8ToBytes expected string, got ${typeof str}`);
|
||||
}
|
||||
return new TextEncoder().encode(str);
|
||||
}
|
||||
|
||||
export type Input = Uint8Array | string;
|
||||
export function toBytes(data: Input): Uint8Array {
|
||||
if (typeof data === 'string') data = utf8ToBytes(data);
|
||||
if (!(data instanceof Uint8Array))
|
||||
throw new TypeError(`Expected input type is Uint8Array (got ${typeof data})`);
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Concats Uint8Array-s into one; like `Buffer.concat([buf1, buf2])`
|
||||
* @example concatBytes(buf1, buf2)
|
||||
*/
|
||||
export function concatBytes(...arrays: Uint8Array[]): Uint8Array {
|
||||
if (!arrays.every((a) => a instanceof Uint8Array)) throw new Error('Uint8Array list expected');
|
||||
if (arrays.length === 1) return arrays[0];
|
||||
const length = arrays.reduce((a, arr) => a + arr.length, 0);
|
||||
const result = new Uint8Array(length);
|
||||
for (let i = 0, pad = 0; i < arrays.length; i++) {
|
||||
const arr = arrays[i];
|
||||
result.set(arr, pad);
|
||||
pad += arr.length;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// For runtime check if class implements interface
|
||||
export abstract class Hash<T extends Hash<T>> {
|
||||
abstract blockLen: number; // Bytes per block
|
||||
abstract outputLen: number; // Bytes in output
|
||||
abstract update(buf: Input): this;
|
||||
// Writes digest into buf
|
||||
abstract digestInto(buf: Uint8Array): void;
|
||||
abstract digest(): Uint8Array;
|
||||
// Cleanup internal state. Not '.clean' because instance is not usable after that.
|
||||
// Clean usually resets instance to initial state, but it is not possible for keyed hashes if key is consumed into state.
|
||||
// NOTE: if digest is not consumed by user, user need manually call '.destroy' if zeroing is required
|
||||
abstract destroy(): void;
|
||||
// Unsafe because doesn't check if "to" is correct. Can be used as clone() if no opts passed.
|
||||
// Why cloneInto instead of clone? Mostly performance (same as _digestInto), but also has nice property: it reuses instance
|
||||
// which means all internal buffers is overwritten, which also causes overwrite buffer which used for digest (in some cases).
|
||||
// We don't provide any guarantees about cleanup (it is impossible to!), so should be enough for now.
|
||||
abstract _cloneInto(to?: T): T;
|
||||
// Safe version that clones internal state
|
||||
clone(): T {
|
||||
return this._cloneInto();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XOF: streaming API to read digest in chunks.
|
||||
* Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name.
|
||||
* When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot destroy state, next call can require more bytes.
|
||||
*/
|
||||
export type HashXOF<T extends Hash<T>> = Hash<T> & {
|
||||
xof(bytes: number): Uint8Array; // Read 'bytes' bytes from digest stream
|
||||
xofInto(buf: Uint8Array): Uint8Array; // read buf.length bytes from digest stream into buf
|
||||
};
|
||||
|
||||
// Check if object doens't have custom constructor (like Uint8Array/Array)
|
||||
const isPlainObject = (obj: any) =>
|
||||
Object.prototype.toString.call(obj) === '[object Object]' && obj.constructor === Object;
|
||||
|
||||
type EmptyObj = {};
|
||||
export function checkOpts<T1 extends EmptyObj, T2 extends EmptyObj>(
|
||||
defaults: T1,
|
||||
opts?: T2
|
||||
): T1 & T2 {
|
||||
if (opts !== undefined && (typeof opts !== 'object' || !isPlainObject(opts)))
|
||||
throw new TypeError('Options should be object or undefined');
|
||||
const merged = Object.assign(defaults, opts);
|
||||
return merged as T1 & T2;
|
||||
}
|
||||
|
||||
export type CHash = ReturnType<typeof wrapConstructor>;
|
||||
|
||||
export function wrapConstructor<T extends Hash<T>>(hashConstructor: () => Hash<T>) {
|
||||
const hashC = (message: Input): Uint8Array => hashConstructor().update(toBytes(message)).digest();
|
||||
const tmp = hashConstructor();
|
||||
hashC.outputLen = tmp.outputLen;
|
||||
hashC.blockLen = tmp.blockLen;
|
||||
hashC.create = () => hashConstructor();
|
||||
return hashC;
|
||||
}
|
||||
|
||||
export function wrapConstructorWithOpts<H extends Hash<H>, T extends Object>(
|
||||
hashCons: (opts?: T) => Hash<H>
|
||||
) {
|
||||
const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest();
|
||||
const tmp = hashCons({} as T);
|
||||
hashC.outputLen = tmp.outputLen;
|
||||
hashC.blockLen = tmp.blockLen;
|
||||
hashC.create = (opts: T) => hashCons(opts);
|
||||
return hashC;
|
||||
}
|
||||
|
||||
/**
|
||||
* Secure PRNG
|
||||
*/
|
||||
export function randomBytes(bytesLength = 32): Uint8Array {
|
||||
if (crypto.web) {
|
||||
return crypto.web.getRandomValues(new Uint8Array(bytesLength));
|
||||
} else if (crypto.node) {
|
||||
return new Uint8Array(crypto.node.randomBytes(bytesLength).buffer);
|
||||
} else {
|
||||
throw new Error("The environment doesn't have randomBytes function");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
var $parseInt = GetIntrinsic('%parseInt%');
|
||||
|
||||
var inspect = require('object-inspect');
|
||||
|
||||
var regexTester = require('safe-regex-test');
|
||||
var callBound = require('call-bind/callBound');
|
||||
var every = require('../helpers/every');
|
||||
|
||||
var isDigit = regexTester(/^[0-9]$/);
|
||||
|
||||
var $charAt = callBound('String.prototype.charAt');
|
||||
var $strSlice = callBound('String.prototype.slice');
|
||||
|
||||
var IsArray = require('./IsArray');
|
||||
var IsInteger = require('./IsInteger');
|
||||
var Type = require('./Type');
|
||||
|
||||
var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false
|
||||
|
||||
var isStringOrHole = function (capture, index, arr) {
|
||||
return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined');
|
||||
};
|
||||
|
||||
// https://262.ecma-international.org/6.0/#sec-getsubstitution
|
||||
|
||||
// eslint-disable-next-line max-statements, max-params, max-lines-per-function
|
||||
module.exports = function GetSubstitution(matched, str, position, captures, replacement) {
|
||||
if (Type(matched) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `matched` must be a String');
|
||||
}
|
||||
var matchLength = matched.length;
|
||||
|
||||
if (Type(str) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `str` must be a String');
|
||||
}
|
||||
var stringLength = str.length;
|
||||
|
||||
if (!IsInteger(position) || position < 0 || position > stringLength) {
|
||||
throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position));
|
||||
}
|
||||
|
||||
if (!IsArray(captures) || !every(captures, isStringOrHole)) {
|
||||
throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures));
|
||||
}
|
||||
|
||||
if (Type(replacement) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `replacement` must be a String');
|
||||
}
|
||||
|
||||
var tailPos = position + matchLength;
|
||||
var m = captures.length;
|
||||
|
||||
var result = '';
|
||||
for (var i = 0; i < replacement.length; i += 1) {
|
||||
// if this is a $, and it's not the end of the replacement
|
||||
var current = $charAt(replacement, i);
|
||||
var isLast = (i + 1) >= replacement.length;
|
||||
var nextIsLast = (i + 2) >= replacement.length;
|
||||
if (current === '$' && !isLast) {
|
||||
var next = $charAt(replacement, i + 1);
|
||||
if (next === '$') {
|
||||
result += '$';
|
||||
i += 1;
|
||||
} else if (next === '&') {
|
||||
result += matched;
|
||||
i += 1;
|
||||
} else if (next === '`') {
|
||||
result += position === 0 ? '' : $strSlice(str, 0, position - 1);
|
||||
i += 1;
|
||||
} else if (next === "'") {
|
||||
result += tailPos >= stringLength ? '' : $strSlice(str, tailPos);
|
||||
i += 1;
|
||||
} else {
|
||||
var nextNext = nextIsLast ? null : $charAt(replacement, i + 2);
|
||||
if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) {
|
||||
// $1 through $9, and not followed by a digit
|
||||
var n = $parseInt(next, 10);
|
||||
// if (n > m, impl-defined)
|
||||
result += n <= m && Type(captures[n - 1]) === 'Undefined' ? '' : captures[n - 1];
|
||||
i += 1;
|
||||
} else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) {
|
||||
// $00 through $99
|
||||
var nn = next + nextNext;
|
||||
var nnI = $parseInt(nn, 10) - 1;
|
||||
// if nn === '00' or nn > m, impl-defined
|
||||
result += nn <= m && Type(captures[nnI]) === 'Undefined' ? '' : captures[nnI];
|
||||
i += 2;
|
||||
} else {
|
||||
result += '$';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// the final $, or else not a $
|
||||
result += $charAt(replacement, i);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
export type AddressPostalCodeEmptyError = {
|
||||
name: string;
|
||||
message: string;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"F A B","2":"J D E CC"},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 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":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X 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"},E:{"1":"I 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","16":"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:{"1":"E 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","16":"zB UC"},H:{"1":"oC"},I:{"1":"tB I f pC qC rC sC BC tC uC"},J:{"1":"D A"},K:{"1":"A B C h qB AC rB"},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:"CSS namespaces"};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = require("./lib/_stream_passthrough.js")
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "is-docker",
|
||||
"version": "2.2.1",
|
||||
"description": "Check if the process is running inside a Docker container",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/is-docker",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"bin": "cli.js",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts",
|
||||
"cli.js"
|
||||
],
|
||||
"keywords": [
|
||||
"detect",
|
||||
"docker",
|
||||
"dockerized",
|
||||
"container",
|
||||
"inside",
|
||||
"is",
|
||||
"env",
|
||||
"environment",
|
||||
"process"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"sinon": "^7.3.2",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"camelcase","version":"7.0.1","files":{"license":{"checkedAt":1678883669302,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"index.js":{"checkedAt":1678883672488,"integrity":"sha512-UMOnxu/eH6utvryyN5DW7ozVaR854nFuu3Dvxr8J9gtO5IQgddQhvWJyPURy194c38vIFyuoDgscC2HksE2eIw==","mode":420,"size":3456},"package.json":{"checkedAt":1678883672488,"integrity":"sha512-dbKfCC+fL9U63Ca2Xk8mLvH+/NGICEi5yIZUFd47fBltp36nk0J7D3MUBD8/ZulaW5NulrFEsTIp4fds+LmCXg==","mode":420,"size":886},"index.d.ts":{"checkedAt":1678883672488,"integrity":"sha512-36ctKCrqMUJ14j10DupJRuC8VDm0OeGqsw+X5oXpuMeYSyFGh5niisHhImMRuu5TSiiqxtJhhhCUHoIPS3dpyA==","mode":420,"size":2449},"readme.md":{"checkedAt":1678883672488,"integrity":"sha512-mCoEm9bV7WmMrBCRFjDdBClUIFF8VR4PobiFVGRzDlJJ9epk97EE2hUfdvvfEe7TQnKpOaOf8aaYhEi7UI9jzw==","mode":420,"size":3812}}}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"xregexp","version":"2.0.0","files":{"package.json":{"checkedAt":1678883672090,"integrity":"sha512-jZpWcme6VMGXK1rxFKUfXF6nRtBgJTeyRGfQPQwci/mZ0WANqtwKwkECz+ofIfpDBkTOrH5TdX0MWkQbu5BFaw==","mode":438,"size":557},".npmignore":{"checkedAt":1678883672090,"integrity":"sha512-kwlk24bFaIh/5iQkAsSlmtWEp1tlgyEfDy7xHkUv4Z2/xVQlV0L0Iy2v2MgqfTRRCD0eL5ESC3ponW7o6zfkLg==","mode":438,"size":52},"README.md":{"checkedAt":1678883672090,"integrity":"sha512-ckcAjMXUjNeOFLo7c/kFTGQbyXwvfWkVefuBWwjJPVdVLkYnWQxvDaEuo2K7NCmB1+Sa1StM4lZT5iJEOd4iDQ==","mode":438,"size":10875},"xregexp-all.js":{"checkedAt":1678883672139,"integrity":"sha512-ehsYi5P8ZRaybqWwMYRr413C6fhaMbHtpFkChOkkaycjzwRfnBgzNIBLtlwnZXzZyy0PJndyGxj1xEwVl7GQNg==","mode":438,"size":131101},"MIT-LICENSE.txt":{"checkedAt":1678883672142,"integrity":"sha512-QbllC2XtvGmuvV1rnwQMMLLd9SD41qdYq0qGCaQbBfly6SE2ATrKj938C95jdEqnjubKFiU9glz+mA0HQ4HgHA==","mode":438,"size":1108},"tests/node-qunit.js":{"checkedAt":1678883672142,"integrity":"sha512-dUX7cvC+vUJ0HTnKl4Eb1Z1wI37r+IzdFf/s19xlk3QlqPLFGZCdtvTKKLy3GTNEmSb1Kg0ywKVFnqHvVDtduA==","mode":438,"size":226},"tests/tests.js":{"checkedAt":1678883672148,"integrity":"sha512-PpXwqGfcvJbPonGg2VbeSPHKOFU5JN2sMgnR/CkZsWRgsGR29mnFhleWdiIeU/QH7VRhPPTrhqw6N9nBIP8RCA==","mode":438,"size":45032}}}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { Subscribable } from '../types';
|
||||
/**
|
||||
* Used to convert a subscribable to an observable.
|
||||
*
|
||||
* Currently, this is only used within internals.
|
||||
*
|
||||
* TODO: Discuss ObservableInput supporting "Subscribable".
|
||||
* https://github.com/ReactiveX/rxjs/issues/5909
|
||||
*
|
||||
* @param subscribable A subscribable
|
||||
*/
|
||||
export declare function fromSubscribable<T>(subscribable: Subscribable<T>): Observable<T>;
|
||||
//# sourceMappingURL=fromSubscribable.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"deprecation","version":"2.3.1","files":{"README.md":{"checkedAt":1678883670405,"integrity":"sha512-pNzDBNOKPDCprhrPF97c8FK7F66Z5xFicFgyXcd/Z5yf19tMyBy+DxdYBMcuyvH6CA5UuCPw/kQy8v0DR8OTdw==","mode":420,"size":1333},"LICENSE":{"checkedAt":1678883670405,"integrity":"sha512-vms6U1gcbnJqHpj2CsNINGUcq/08yu00jPwAUc0LwmUkMl4SN/hLP8F2sQPBRzQ4waM4O0/iA7FnD4VM2WcRBQ==","mode":420,"size":762},"package.json":{"checkedAt":1678883670405,"integrity":"sha512-MLq4t93MPVY3hTmlCjHKO7dB47qvayrGryR0A6EE4Xkfpa1YHn5N2zuT46qhCOQM5XjKEmYiPo2FqVqfg3m+JA==","mode":420,"size":793},"dist-node/index.js":{"checkedAt":1678883670405,"integrity":"sha512-q0GBvFGaD0bEVA4pQM16Fl4dABEBqA2UA25G+1de0kxWLf6ZTbgxLadSDWPvF7PNayks5xsww9Z1GsXz2+hv1Q==","mode":420,"size":417},"dist-src/index.js":{"checkedAt":1678883670405,"integrity":"sha512-6dnkMGlr71ei5MavXclHNWlGtDPVs5WUFhgSYjigVALAine1lKDoAezUhqlvDHqnGH9ud4yN/lL9fcWaAjl64A==","mode":420,"size":308},"dist-web/index.js":{"checkedAt":1678883670405,"integrity":"sha512-xsp7r/+BCUZrvFMj43sREhK53PG9RWNTQn1g/e2sDP2f5fQ2QNLYoA1BOcr6ReIPvnzdcGVVnRYhUd4DYGcAJw==","mode":420,"size":327},"dist-types/index.d.ts":{"checkedAt":1678883670405,"integrity":"sha512-IrBDQpFRYxj6NC4LZFmHY+lkSRoAlisN2ylzqWqfL/xXzsNtvx6zMIciNrQpVLzsd7q19daVWumOYZ4BslyUdw==","mode":420,"size":66}}}
|
||||
@@ -0,0 +1,115 @@
|
||||
import { AjaxRequest, AjaxResponseType } from './types';
|
||||
/**
|
||||
* A normalized response from an AJAX request. To get the data from the response,
|
||||
* you will want to read the `response` property.
|
||||
*
|
||||
* - DO NOT create instances of this class directly.
|
||||
* - DO NOT subclass this class.
|
||||
*
|
||||
* It is advised not to hold this object in memory, as it has a reference to
|
||||
* the original XHR used to make the request, as well as properties containing
|
||||
* request and response data.
|
||||
*
|
||||
* @see {@link ajax}
|
||||
* @see {@link AjaxConfig}
|
||||
*/
|
||||
export declare class AjaxResponse<T> {
|
||||
/**
|
||||
* The original event object from the raw XHR event.
|
||||
*/
|
||||
readonly originalEvent: ProgressEvent;
|
||||
/**
|
||||
* The XMLHttpRequest object used to make the request.
|
||||
* NOTE: It is advised not to hold this in memory, as it will retain references to all of it's event handlers
|
||||
* and many other things related to the request.
|
||||
*/
|
||||
readonly xhr: XMLHttpRequest;
|
||||
/**
|
||||
* The request parameters used to make the HTTP request.
|
||||
*/
|
||||
readonly request: AjaxRequest;
|
||||
/**
|
||||
* The event type. This can be used to discern between different events
|
||||
* if you're using progress events with {@link includeDownloadProgress} or
|
||||
* {@link includeUploadProgress} settings in {@link AjaxConfig}.
|
||||
*
|
||||
* The event type consists of two parts: the {@link AjaxDirection} and the
|
||||
* the event type. Merged with `_`, they form the `type` string. The
|
||||
* direction can be an `upload` or a `download` direction, while an event can
|
||||
* be `loadstart`, `progress` or `load`.
|
||||
*
|
||||
* `download_load` is the type of event when download has finished and the
|
||||
* response is available.
|
||||
*/
|
||||
readonly type: AjaxResponseType;
|
||||
/** The HTTP status code */
|
||||
readonly status: number;
|
||||
/**
|
||||
* The response data, if any. Note that this will automatically be converted to the proper type
|
||||
*/
|
||||
readonly response: T;
|
||||
/**
|
||||
* The responseType set on the request. (For example: `""`, `"arraybuffer"`, `"blob"`, `"document"`, `"json"`, or `"text"`)
|
||||
* @deprecated There isn't much reason to examine this. It's the same responseType set (or defaulted) on the ajax config.
|
||||
* If you really need to examine this value, you can check it on the `request` or the `xhr`. Will be removed in v8.
|
||||
*/
|
||||
readonly responseType: XMLHttpRequestResponseType;
|
||||
/**
|
||||
* The total number of bytes loaded so far. To be used with {@link total} while
|
||||
* calculating progress. (You will want to set {@link includeDownloadProgress} or
|
||||
* {@link includeDownloadProgress})
|
||||
*/
|
||||
readonly loaded: number;
|
||||
/**
|
||||
* The total number of bytes to be loaded. To be used with {@link loaded} while
|
||||
* calculating progress. (You will want to set {@link includeDownloadProgress} or
|
||||
* {@link includeDownloadProgress})
|
||||
*/
|
||||
readonly total: number;
|
||||
/**
|
||||
* A dictionary of the response headers.
|
||||
*/
|
||||
readonly responseHeaders: Record<string, string>;
|
||||
/**
|
||||
* A normalized response from an AJAX request. To get the data from the response,
|
||||
* you will want to read the `response` property.
|
||||
*
|
||||
* - DO NOT create instances of this class directly.
|
||||
* - DO NOT subclass this class.
|
||||
*
|
||||
* @param originalEvent The original event object from the XHR `onload` event.
|
||||
* @param xhr The `XMLHttpRequest` object used to make the request. This is useful for examining status code, etc.
|
||||
* @param request The request settings used to make the HTTP request.
|
||||
* @param type The type of the event emitted by the {@link ajax} Observable
|
||||
*/
|
||||
constructor(
|
||||
/**
|
||||
* The original event object from the raw XHR event.
|
||||
*/
|
||||
originalEvent: ProgressEvent,
|
||||
/**
|
||||
* The XMLHttpRequest object used to make the request.
|
||||
* NOTE: It is advised not to hold this in memory, as it will retain references to all of it's event handlers
|
||||
* and many other things related to the request.
|
||||
*/
|
||||
xhr: XMLHttpRequest,
|
||||
/**
|
||||
* The request parameters used to make the HTTP request.
|
||||
*/
|
||||
request: AjaxRequest,
|
||||
/**
|
||||
* The event type. This can be used to discern between different events
|
||||
* if you're using progress events with {@link includeDownloadProgress} or
|
||||
* {@link includeUploadProgress} settings in {@link AjaxConfig}.
|
||||
*
|
||||
* The event type consists of two parts: the {@link AjaxDirection} and the
|
||||
* the event type. Merged with `_`, they form the `type` string. The
|
||||
* direction can be an `upload` or a `download` direction, while an event can
|
||||
* be `loadstart`, `progress` or `load`.
|
||||
*
|
||||
* `download_load` is the type of event when download has finished and the
|
||||
* response is available.
|
||||
*/
|
||||
type?: AjaxResponseType);
|
||||
}
|
||||
//# sourceMappingURL=AjaxResponse.d.ts.map
|
||||
@@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
||||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
||||
to[j] = from[i];
|
||||
return to;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.combineLatest = void 0;
|
||||
var combineLatest_1 = require("../observable/combineLatest");
|
||||
var lift_1 = require("../util/lift");
|
||||
var argsOrArgArray_1 = require("../util/argsOrArgArray");
|
||||
var mapOneOrManyArgs_1 = require("../util/mapOneOrManyArgs");
|
||||
var pipe_1 = require("../util/pipe");
|
||||
var args_1 = require("../util/args");
|
||||
function combineLatest() {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var resultSelector = args_1.popResultSelector(args);
|
||||
return resultSelector
|
||||
? pipe_1.pipe(combineLatest.apply(void 0, __spreadArray([], __read(args))), mapOneOrManyArgs_1.mapOneOrManyArgs(resultSelector))
|
||||
: lift_1.operate(function (source, subscriber) {
|
||||
combineLatest_1.combineLatestInit(__spreadArray([source], __read(argsOrArgArray_1.argsOrArgArray(args))))(subscriber);
|
||||
});
|
||||
}
|
||||
exports.combineLatest = combineLatest;
|
||||
//# sourceMappingURL=combineLatest.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"NotFoundError.js","sourceRoot":"","sources":["../../../../src/internal/util/NotFoundError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAoBtD,MAAM,CAAC,IAAM,aAAa,GAAsB,gBAAgB,CAC9D,UAAC,MAAM;IACL,OAAA,SAAS,iBAAiB,CAAY,OAAe;QACnD,MAAM,CAAC,IAAI,CAAC,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;AAJD,CAIC,CACJ,CAAC"}
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('dropWhile', require('../dropWhile'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,5 @@
|
||||
import { isFunction } from "./isFunction";
|
||||
export function isPromise(value) {
|
||||
return isFunction(value === null || value === void 0 ? void 0 : value.then);
|
||||
}
|
||||
//# sourceMappingURL=isPromise.js.map
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
Create a type that makes the given keys non-nullable, where the remaining keys are kept as is.
|
||||
|
||||
If no keys are given, all keys will be made non-nullable.
|
||||
|
||||
Use-case: You want to define a single model where the only thing that changes is whether or not some or all of the keys are non-nullable.
|
||||
|
||||
@example
|
||||
```
|
||||
import type {SetNonNullable} from 'type-fest';
|
||||
|
||||
type Foo = {
|
||||
a: number | null;
|
||||
b: string | undefined;
|
||||
c?: boolean | null;
|
||||
}
|
||||
|
||||
type SomeNonNullable = SetNonNullable<Foo, 'b' | 'c'>;
|
||||
// type SomeNonNullable = {
|
||||
// a: number | null;
|
||||
// b: string; // Can no longer be undefined.
|
||||
// c?: boolean; // Can no longer be null, but is still optional.
|
||||
// }
|
||||
|
||||
type AllNonNullable = SetNonNullable<Foo>;
|
||||
// type AllNonNullable = {
|
||||
// a: number; // Can no longer be null.
|
||||
// b: string; // Can no longer be undefined.
|
||||
// c?: boolean; // Can no longer be null, but is still optional.
|
||||
// }
|
||||
```
|
||||
|
||||
@category Object
|
||||
*/
|
||||
export type SetNonNullable<BaseType, Keys extends keyof BaseType = keyof BaseType> = {
|
||||
[Key in keyof BaseType]: Key extends Keys
|
||||
? NonNullable<BaseType[Key]>
|
||||
: BaseType[Key];
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* This splits a string on a top-level character.
|
||||
*
|
||||
* Regex doesn't support recursion (at least not the JS-flavored version).
|
||||
* So we have to use a tiny state machine to keep track of paren placement.
|
||||
*
|
||||
* Expected behavior using commas:
|
||||
* var(--a, 0 0 1px rgb(0, 0, 0)), 0 0 1px rgb(0, 0, 0)
|
||||
* ─┬─ ┬ ┬ ┬
|
||||
* x x x ╰──────── Split because top-level
|
||||
* ╰──────────────┴──┴───────────── Ignored b/c inside >= 1 levels of parens
|
||||
*
|
||||
* @param {string} input
|
||||
* @param {string} separator
|
||||
*/ "use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "splitAtTopLevelOnly", {
|
||||
enumerable: true,
|
||||
get: ()=>splitAtTopLevelOnly
|
||||
});
|
||||
function splitAtTopLevelOnly(input, separator) {
|
||||
let stack = [];
|
||||
let parts = [];
|
||||
let lastPos = 0;
|
||||
for(let idx = 0; idx < input.length; idx++){
|
||||
let char = input[idx];
|
||||
if (stack.length === 0 && char === separator[0]) {
|
||||
if (separator.length === 1 || input.slice(idx, idx + separator.length) === separator) {
|
||||
parts.push(input.slice(lastPos, idx));
|
||||
lastPos = idx + separator.length;
|
||||
}
|
||||
}
|
||||
if (char === "(" || char === "[" || char === "{") {
|
||||
stack.push(char);
|
||||
} else if (char === ")" && stack[stack.length - 1] === "(" || char === "]" && stack[stack.length - 1] === "[" || char === "}" && stack[stack.length - 1] === "{") {
|
||||
stack.pop();
|
||||
}
|
||||
}
|
||||
parts.push(input.slice(lastPos));
|
||||
return parts;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://262.ecma-international.org/6.0/#sec-createdataproperty
|
||||
|
||||
module.exports = function CreateDataProperty(O, P, V) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
|
||||
}
|
||||
var newDesc = {
|
||||
'[[Configurable]]': true,
|
||||
'[[Enumerable]]': true,
|
||||
'[[Value]]': V,
|
||||
'[[Writable]]': true
|
||||
};
|
||||
return OrdinaryDefineOwnProperty(O, P, newDesc);
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
var baseWrapperValue = require('./_baseWrapperValue');
|
||||
|
||||
/**
|
||||
* Executes the chain sequence to resolve the unwrapped value.
|
||||
*
|
||||
* @name value
|
||||
* @memberOf _
|
||||
* @since 0.1.0
|
||||
* @alias toJSON, valueOf
|
||||
* @category Seq
|
||||
* @returns {*} Returns the resolved unwrapped value.
|
||||
* @example
|
||||
*
|
||||
* _([1, 2, 3]).value();
|
||||
* // => [1, 2, 3]
|
||||
*/
|
||||
function wrapperValue() {
|
||||
return baseWrapperValue(this.__wrapped__, this.__actions__);
|
||||
}
|
||||
|
||||
module.exports = wrapperValue;
|
||||
@@ -0,0 +1,238 @@
|
||||
# Optionator
|
||||
<a name="optionator" />
|
||||
|
||||
Optionator is a JavaScript/Node.js option parsing and help generation library used by [eslint](http://eslint.org), [Grasp](http://graspjs.com), [LiveScript](http://livescript.net), [esmangle](https://github.com/estools/esmangle), [escodegen](https://github.com/estools/escodegen), and [many more](https://www.npmjs.com/browse/depended/optionator).
|
||||
|
||||
For an online demo, check out the [Grasp online demo](http://www.graspjs.com/#demo).
|
||||
|
||||
[About](#about) · [Usage](#usage) · [Settings Format](#settings-format) · [Argument Format](#argument-format)
|
||||
|
||||
## Why?
|
||||
The problem with other option parsers, such as `yargs` or `minimist`, is they just accept all input, valid or not.
|
||||
With Optionator, if you mistype an option, it will give you an error (with a suggestion for what you meant).
|
||||
If you give the wrong type of argument for an option, it will give you an error rather than supplying the wrong input to your application.
|
||||
|
||||
$ cmd --halp
|
||||
Invalid option '--halp' - perhaps you meant '--help'?
|
||||
|
||||
$ cmd --count str
|
||||
Invalid value for option 'count' - expected type Int, received value: str.
|
||||
|
||||
Other helpful features include reformatting the help text based on the size of the console, so that it fits even if the console is narrow, and accepting not just an array (eg. process.argv), but a string or object as well, making things like testing much easier.
|
||||
|
||||
## About
|
||||
Optionator uses [type-check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) behind the scenes to cast and verify input according the specified types.
|
||||
|
||||
MIT license. Version 0.8.3
|
||||
|
||||
npm install optionator
|
||||
|
||||
For updates on Optionator, [follow me on twitter](https://twitter.com/gkzahariev).
|
||||
|
||||
Optionator is a Node.js module, but can be used in the browser as well if packed with webpack/browserify.
|
||||
|
||||
## Usage
|
||||
`require('optionator');` returns a function. It has one property, `VERSION`, the current version of the library as a string. This function is called with an object specifying your options and other information, see the [settings format section](#settings-format). This in turn returns an object with three properties, `parse`, `parseArgv`, `generateHelp`, and `generateHelpForOption`, which are all functions.
|
||||
|
||||
```js
|
||||
var optionator = require('optionator')({
|
||||
prepend: 'Usage: cmd [options]',
|
||||
append: 'Version 1.0.0',
|
||||
options: [{
|
||||
option: 'help',
|
||||
alias: 'h',
|
||||
type: 'Boolean',
|
||||
description: 'displays help'
|
||||
}, {
|
||||
option: 'count',
|
||||
alias: 'c',
|
||||
type: 'Int',
|
||||
description: 'number of things',
|
||||
example: 'cmd --count 2'
|
||||
}]
|
||||
});
|
||||
|
||||
var options = optionator.parseArgv(process.argv);
|
||||
if (options.help) {
|
||||
console.log(optionator.generateHelp());
|
||||
}
|
||||
...
|
||||
```
|
||||
|
||||
### parse(input, parseOptions)
|
||||
`parse` processes the `input` according to your settings, and returns an object with the results.
|
||||
|
||||
##### arguments
|
||||
* input - `[String] | Object | String` - the input you wish to parse
|
||||
* parseOptions - `{slice: Int}` - all options optional
|
||||
- `slice` specifies how much to slice away from the beginning if the input is an array or string - by default `0` for string, `2` for array (works with `process.argv`)
|
||||
|
||||
##### returns
|
||||
`Object` - the parsed options, each key is a camelCase version of the option name (specified in dash-case), and each value is the processed value for that option. Positional values are in an array under the `_` key.
|
||||
|
||||
##### example
|
||||
```js
|
||||
parse(['node', 't.js', '--count', '2', 'positional']); // {count: 2, _: ['positional']}
|
||||
parse('--count 2 positional'); // {count: 2, _: ['positional']}
|
||||
parse({count: 2, _:['positional']}); // {count: 2, _: ['positional']}
|
||||
```
|
||||
|
||||
### parseArgv(input)
|
||||
`parseArgv` works exactly like `parse`, but only for array input and it slices off the first two elements.
|
||||
|
||||
##### arguments
|
||||
* input - `[String]` - the input you wish to parse
|
||||
|
||||
##### returns
|
||||
See "returns" section in "parse"
|
||||
|
||||
##### example
|
||||
```js
|
||||
parseArgv(process.argv);
|
||||
```
|
||||
|
||||
### generateHelp(helpOptions)
|
||||
`generateHelp` produces help text based on your settings.
|
||||
|
||||
##### arguments
|
||||
* helpOptions - `{showHidden: Boolean, interpolate: Object}` - all options optional
|
||||
- `showHidden` specifies whether to show options with `hidden: true` specified, by default it is `false`
|
||||
- `interpolate` specify data to be interpolated in `prepend` and `append` text, `{{key}}` is the format - eg. `generateHelp({interpolate:{version: '0.4.2'}})`, will change this `append` text: `Version {{version}}` to `Version 0.4.2`
|
||||
|
||||
##### returns
|
||||
`String` - the generated help text
|
||||
|
||||
##### example
|
||||
```js
|
||||
generateHelp(); /*
|
||||
"Usage: cmd [options] positional
|
||||
|
||||
-h, --help displays help
|
||||
-c, --count Int number of things
|
||||
|
||||
Version 1.0.0
|
||||
"*/
|
||||
```
|
||||
|
||||
### generateHelpForOption(optionName)
|
||||
`generateHelpForOption` produces expanded help text for the specified with `optionName` option. If an `example` was specified for the option, it will be displayed, and if a `longDescription` was specified, it will display that instead of the `description`.
|
||||
|
||||
##### arguments
|
||||
* optionName - `String` - the name of the option to display
|
||||
|
||||
##### returns
|
||||
`String` - the generated help text for the option
|
||||
|
||||
##### example
|
||||
```js
|
||||
generateHelpForOption('count'); /*
|
||||
"-c, --count Int
|
||||
description: number of things
|
||||
example: cmd --count 2
|
||||
"*/
|
||||
```
|
||||
|
||||
## Settings Format
|
||||
When your `require('optionator')`, you get a function that takes in a settings object. This object has the type:
|
||||
|
||||
{
|
||||
prepend: String,
|
||||
append: String,
|
||||
options: [{heading: String} | {
|
||||
option: String,
|
||||
alias: [String] | String,
|
||||
type: String,
|
||||
enum: [String],
|
||||
default: String,
|
||||
restPositional: Boolean,
|
||||
required: Boolean,
|
||||
overrideRequired: Boolean,
|
||||
dependsOn: [String] | String,
|
||||
concatRepeatedArrays: Boolean | (Boolean, Object),
|
||||
mergeRepeatedObjects: Boolean,
|
||||
description: String,
|
||||
longDescription: String,
|
||||
example: [String] | String
|
||||
}],
|
||||
helpStyle: {
|
||||
aliasSeparator: String,
|
||||
typeSeparator: String,
|
||||
descriptionSeparator: String,
|
||||
initialIndent: Int,
|
||||
secondaryIndent: Int,
|
||||
maxPadFactor: Number
|
||||
},
|
||||
mutuallyExclusive: [[String | [String]]],
|
||||
concatRepeatedArrays: Boolean | (Boolean, Object), // deprecated, set in defaults object
|
||||
mergeRepeatedObjects: Boolean, // deprecated, set in defaults object
|
||||
positionalAnywhere: Boolean,
|
||||
typeAliases: Object,
|
||||
defaults: Object
|
||||
}
|
||||
|
||||
All of the properties are optional (the `Maybe` has been excluded for brevities sake), except for having either `heading: String` or `option: String` in each object in the `options` array.
|
||||
|
||||
### Top Level Properties
|
||||
* `prepend` is an optional string to be placed before the options in the help text
|
||||
* `append` is an optional string to be placed after the options in the help text
|
||||
* `options` is a required array specifying your options and headings, the options and headings will be displayed in the order specified
|
||||
* `helpStyle` is an optional object which enables you to change the default appearance of some aspects of the help text
|
||||
* `mutuallyExclusive` is an optional array of arrays of either strings or arrays of strings. The top level array is a list of rules, each rule is a list of elements - each element can be either a string (the name of an option), or a list of strings (a group of option names) - there will be an error if more than one element is present
|
||||
* `concatRepeatedArrays` see description under the "Option Properties" heading - use at the top level is deprecated, if you want to set this for all options, use the `defaults` property
|
||||
* `mergeRepeatedObjects` see description under the "Option Properties" heading - use at the top level is deprecated, if you want to set this for all options, use the `defaults` property
|
||||
* `positionalAnywhere` is an optional boolean (defaults to `true`) - when `true` it allows positional arguments anywhere, when `false`, all arguments after the first positional one are taken to be positional as well, even if they look like a flag. For example, with `positionalAnywhere: false`, the arguments `--flag --boom 12 --crack` would have two positional arguments: `12` and `--crack`
|
||||
* `typeAliases` is an optional object, it allows you to set aliases for types, eg. `{Path: 'String'}` would allow you to use the type `Path` as an alias for the type `String`
|
||||
* `defaults` is an optional object following the option properties format, which specifies default values for all options. A default will be overridden if manually set. For example, you can do `default: { type: "String" }` to set the default type of all options to `String`, and then override that default in an individual option by setting the `type` property
|
||||
|
||||
#### Heading Properties
|
||||
* `heading` a required string, the name of the heading
|
||||
|
||||
#### Option Properties
|
||||
* `option` the required name of the option - use dash-case, without the leading dashes
|
||||
* `alias` is an optional string or array of strings which specify any aliases for the option
|
||||
* `type` is a required string in the [type check](https://github.com/gkz/type-check) [format](https://github.com/gkz/type-check#type-format), this will be used to cast the inputted value and validate it
|
||||
* `enum` is an optional array of strings, each string will be parsed by [levn](https://github.com/gkz/levn) - the argument value must be one of the resulting values - each potential value must validate against the specified `type`
|
||||
* `default` is a optional string, which will be parsed by [levn](https://github.com/gkz/levn) and used as the default value if none is set - the value must validate against the specified `type`
|
||||
* `restPositional` is an optional boolean - if set to `true`, everything after the option will be taken to be a positional argument, even if it looks like a named argument
|
||||
* `required` is an optional boolean - if set to `true`, the option parsing will fail if the option is not defined
|
||||
* `overrideRequired` is a optional boolean - if set to `true` and the option is used, and there is another option which is required but not set, it will override the need for the required option and there will be no error - this is useful if you have required options and want to use `--help` or `--version` flags
|
||||
* `concatRepeatedArrays` is an optional boolean or tuple with boolean and options object (defaults to `false`) - when set to `true` and an option contains an array value and is repeated, the subsequent values for the flag will be appended rather than overwriting the original value - eg. option `g` of type `[String]`: `-g a -g b -g c,d` will result in `['a','b','c','d']`
|
||||
|
||||
You can supply an options object by giving the following value: `[true, options]`. The one currently supported option is `oneValuePerFlag`, this only allows one array value per flag. This is useful if your potential values contain a comma.
|
||||
* `mergeRepeatedObjects` is an optional boolean (defaults to `false`) - when set to `true` and an option contains an object value and is repeated, the subsequent values for the flag will be merged rather than overwriting the original value - eg. option `g` of type `Object`: `-g a:1 -g b:2 -g c:3,d:4` will result in `{a: 1, b: 2, c: 3, d: 4}`
|
||||
* `dependsOn` is an optional string or array of strings - if simply a string (the name of another option), it will make sure that that other option is set, if an array of strings, depending on whether `'and'` or `'or'` is first, it will either check whether all (`['and', 'option-a', 'option-b']`), or at least one (`['or', 'option-a', 'option-b']`) other options are set
|
||||
* `description` is an optional string, which will be displayed next to the option in the help text
|
||||
* `longDescription` is an optional string, it will be displayed instead of the `description` when `generateHelpForOption` is used
|
||||
* `example` is an optional string or array of strings with example(s) for the option - these will be displayed when `generateHelpForOption` is used
|
||||
|
||||
#### Help Style Properties
|
||||
* `aliasSeparator` is an optional string, separates multiple names from each other - default: ' ,'
|
||||
* `typeSeparator` is an optional string, separates the type from the names - default: ' '
|
||||
* `descriptionSeparator` is an optional string , separates the description from the padded name and type - default: ' '
|
||||
* `initialIndent` is an optional int - the amount of indent for options - default: 2
|
||||
* `secondaryIndent` is an optional int - the amount of indent if wrapped fully (in addition to the initial indent) - default: 4
|
||||
* `maxPadFactor` is an optional number - affects the default level of padding for the names/type, it is multiplied by the average of the length of the names/type - default: 1.5
|
||||
|
||||
## Argument Format
|
||||
At the highest level there are two types of arguments: named, and positional.
|
||||
|
||||
Name arguments of any length are prefixed with `--` (eg. `--go`), and those of one character may be prefixed with either `--` or `-` (eg. `-g`).
|
||||
|
||||
There are two types of named arguments: boolean flags (eg. `--problemo`, `-p`) which take no value and result in a `true` if they are present, the falsey `undefined` if they are not present, or `false` if present and explicitly prefixed with `no` (eg. `--no-problemo`). Named arguments with values (eg. `--tseries 800`, `-t 800`) are the other type. If the option has a type `Boolean` it will automatically be made into a boolean flag. Any other type results in a named argument that takes a value.
|
||||
|
||||
For more information about how to properly set types to get the value you want, take a look at the [type check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) pages.
|
||||
|
||||
You can group single character arguments that use a single `-`, however all except the last must be boolean flags (which take no value). The last may be a boolean flag, or an argument which takes a value - eg. `-ba 2` is equivalent to `-b -a 2`.
|
||||
|
||||
Positional arguments are all those values which do not fall under the above - they can be anywhere, not just at the end. For example, in `cmd -b one -a 2 two` where `b` is a boolean flag, and `a` has the type `Number`, there are two positional arguments, `one` and `two`.
|
||||
|
||||
Everything after an `--` is positional, even if it looks like a named argument.
|
||||
|
||||
You may optionally use `=` to separate option names from values, for example: `--count=2`.
|
||||
|
||||
If you specify the option `NUM`, then any argument using a single `-` followed by a number will be valid and will set the value of `NUM`. Eg. `-2` will be parsed into `NUM: 2`.
|
||||
|
||||
If duplicate named arguments are present, the last one will be taken.
|
||||
|
||||
## Technical About
|
||||
`optionator` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It uses [levn](https://github.com/gkz/levn) to cast arguments to their specified type, and uses [type-check](https://github.com/gkz/type-check) to validate values. It also uses the [prelude.ls](http://preludels.com/) library.
|
||||
@@ -0,0 +1,114 @@
|
||||
import {Node} from 'acorn';
|
||||
|
||||
declare module "acorn-walk" {
|
||||
type FullWalkerCallback<TState> = (
|
||||
node: Node,
|
||||
state: TState,
|
||||
type: string
|
||||
) => void;
|
||||
|
||||
type FullAncestorWalkerCallback<TState> = (
|
||||
node: Node,
|
||||
state: TState | Node[],
|
||||
ancestors: Node[],
|
||||
type: string
|
||||
) => void;
|
||||
type WalkerCallback<TState> = (node: Node, state: TState) => void;
|
||||
|
||||
type SimpleWalkerFn<TState> = (
|
||||
node: Node,
|
||||
state: TState
|
||||
) => void;
|
||||
|
||||
type AncestorWalkerFn<TState> = (
|
||||
node: Node,
|
||||
state: TState| Node[],
|
||||
ancestors: Node[]
|
||||
) => void;
|
||||
|
||||
type RecursiveWalkerFn<TState> = (
|
||||
node: Node,
|
||||
state: TState,
|
||||
callback: WalkerCallback<TState>
|
||||
) => void;
|
||||
|
||||
type SimpleVisitors<TState> = {
|
||||
[type: string]: SimpleWalkerFn<TState>
|
||||
};
|
||||
|
||||
type AncestorVisitors<TState> = {
|
||||
[type: string]: AncestorWalkerFn<TState>
|
||||
};
|
||||
|
||||
type RecursiveVisitors<TState> = {
|
||||
[type: string]: RecursiveWalkerFn<TState>
|
||||
};
|
||||
|
||||
type FindPredicate = (type: string, node: Node) => boolean;
|
||||
|
||||
interface Found<TState> {
|
||||
node: Node,
|
||||
state: TState
|
||||
}
|
||||
|
||||
export function simple<TState>(
|
||||
node: Node,
|
||||
visitors: SimpleVisitors<TState>,
|
||||
base?: RecursiveVisitors<TState>,
|
||||
state?: TState
|
||||
): void;
|
||||
|
||||
export function ancestor<TState>(
|
||||
node: Node,
|
||||
visitors: AncestorVisitors<TState>,
|
||||
base?: RecursiveVisitors<TState>,
|
||||
state?: TState
|
||||
): void;
|
||||
|
||||
export function recursive<TState>(
|
||||
node: Node,
|
||||
state: TState,
|
||||
functions: RecursiveVisitors<TState>,
|
||||
base?: RecursiveVisitors<TState>
|
||||
): void;
|
||||
|
||||
export function full<TState>(
|
||||
node: Node,
|
||||
callback: FullWalkerCallback<TState>,
|
||||
base?: RecursiveVisitors<TState>,
|
||||
state?: TState
|
||||
): void;
|
||||
|
||||
export function fullAncestor<TState>(
|
||||
node: Node,
|
||||
callback: FullAncestorWalkerCallback<TState>,
|
||||
base?: RecursiveVisitors<TState>,
|
||||
state?: TState
|
||||
): void;
|
||||
|
||||
export function make<TState>(
|
||||
functions: RecursiveVisitors<TState>,
|
||||
base?: RecursiveVisitors<TState>
|
||||
): RecursiveVisitors<TState>;
|
||||
|
||||
export function findNodeAt<TState>(
|
||||
node: Node,
|
||||
start: number | undefined,
|
||||
end?: number | undefined,
|
||||
type?: FindPredicate | string,
|
||||
base?: RecursiveVisitors<TState>,
|
||||
state?: TState
|
||||
): Found<TState> | undefined;
|
||||
|
||||
export function findNodeAround<TState>(
|
||||
node: Node,
|
||||
start: number | undefined,
|
||||
type?: FindPredicate | string,
|
||||
base?: RecursiveVisitors<TState>,
|
||||
state?: TState
|
||||
): Found<TState> | undefined;
|
||||
|
||||
export const findNodeAfter: typeof findNodeAround;
|
||||
|
||||
export const base: RecursiveVisitors<any>;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { EmptyError } from '../util/EmptyError';
|
||||
import { SequenceError } from '../util/SequenceError';
|
||||
import { NotFoundError } from '../util/NotFoundError';
|
||||
import { operate } from '../util/lift';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
export function single(predicate) {
|
||||
return operate((source, subscriber) => {
|
||||
let hasValue = false;
|
||||
let singleValue;
|
||||
let seenValue = false;
|
||||
let index = 0;
|
||||
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
||||
seenValue = true;
|
||||
if (!predicate || predicate(value, index++, source)) {
|
||||
hasValue && subscriber.error(new SequenceError('Too many matching values'));
|
||||
hasValue = true;
|
||||
singleValue = value;
|
||||
}
|
||||
}, () => {
|
||||
if (hasValue) {
|
||||
subscriber.next(singleValue);
|
||||
subscriber.complete();
|
||||
}
|
||||
else {
|
||||
subscriber.error(seenValue ? new NotFoundError('No matching values') : new EmptyError());
|
||||
}
|
||||
}));
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=single.js.map
|
||||
@@ -0,0 +1,660 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for lineToJson.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> lineToJson.ts
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">93.94% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>93/99</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">91.57% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>76/83</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>14/14</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">93.94% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>93/99</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></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">118x</span>
|
||||
<span class="cline-any cline-yes">118x</span>
|
||||
<span class="cline-any cline-yes">32118x</span>
|
||||
<span class="cline-any cline-yes">32116x</span>
|
||||
<span class="cline-any cline-yes">32107x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">116x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">32118x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">32116x</span>
|
||||
<span class="cline-any cline-yes">32116x</span>
|
||||
<span class="cline-any cline-yes">32116x</span>
|
||||
<span class="cline-any cline-yes">32107x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">9x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">32116x</span>
|
||||
<span class="cline-any cline-yes">32116x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">32116x</span>
|
||||
<span class="cline-any cline-yes">65845x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">65845x</span>
|
||||
<span class="cline-any cline-yes">7x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">65838x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">65838x</span>
|
||||
<span class="cline-any cline-yes">65838x</span>
|
||||
<span class="cline-any cline-yes">51x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">65838x</span>
|
||||
<span class="cline-any cline-yes">65838x</span>
|
||||
<span class="cline-any cline-yes">10x</span>
|
||||
<span class="cline-any cline-yes">10x</span>
|
||||
<span class="cline-any cline-yes">8x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">65828x</span>
|
||||
<span class="cline-any cline-yes">75x</span>
|
||||
<span class="cline-any cline-yes">75x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">65828x</span>
|
||||
<span class="cline-any cline-yes">65828x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">32116x</span>
|
||||
<span class="cline-any cline-yes">32107x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">9x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">65838x</span>
|
||||
<span class="cline-any cline-yes">65275x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">563x</span>
|
||||
<span class="cline-any cline-yes">563x</span>
|
||||
<span class="cline-any cline-yes">556x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">7x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">7x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">65836x</span>
|
||||
<span class="cline-any cline-yes">562x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">559x</span>
|
||||
<span class="cline-any cline-yes">103x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">102x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">456x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">65836x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">65047x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">789x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">75x</span>
|
||||
<span class="cline-any cline-yes">9x</span>
|
||||
<span class="cline-any cline-yes">66x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-yes">66x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-yes">66x</span>
|
||||
<span class="cline-any cline-yes">66x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">15x</span>
|
||||
<span class="cline-any cline-yes">15x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">14x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">58x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">75x</span>
|
||||
<span class="cline-any cline-yes">75x</span>
|
||||
<span class="cline-any cline-yes">13x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">62x</span>
|
||||
<span class="cline-any cline-yes">13x</span>
|
||||
<span class="cline-any cline-yes">49x</span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">45x</span>
|
||||
<span class="cline-any cline-yes">5x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">40x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">5x</span>
|
||||
<span class="cline-any cline-yes">5x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { Converter } from "./Converter";
|
||||
import CSVError from "./CSVError";
|
||||
import { CellParser, ColumnParam } from "./Parameters";
|
||||
import set from "lodash/set";
|
||||
import { ParseRuntime } from "./ParseRuntime";
|
||||
|
||||
var numReg = /^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/;
|
||||
|
||||
export default function (csvRows: string[][], conv: Converter): JSONResult[] {
|
||||
const res: JSONResult[] = [];
|
||||
for (let i = 0, len = csvRows.length; i < len; i++) {
|
||||
const r = processRow(csvRows[i], conv, i);
|
||||
if (r) {
|
||||
res.push(r);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
};
|
||||
export type JSONResult = {
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
function processRow(row: string[], conv: Converter, index): JSONResult | null {
|
||||
|
||||
if (conv.parseParam.checkColumn && conv.parseRuntime.headers && row.length !== conv.parseRuntime.headers.length) {
|
||||
throw (CSVError.column_mismatched(conv.parseRuntime.parsedLineNumber + index))
|
||||
}
|
||||
|
||||
const headRow = conv.parseRuntime.headers || <span class="branch-1 cbranch-no" title="branch not covered" >[];</span>
|
||||
const resultRow = convertRowToJson(row, headRow, conv);
|
||||
if (resultRow) {
|
||||
return resultRow;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function convertRowToJson(row: string[], headRow: string[], conv: Converter): { [key: string]: any } | null {
|
||||
let hasValue = false;
|
||||
const resultRow = {};
|
||||
|
||||
for (let i = 0, len = row.length; i < len; i++) {
|
||||
let item = row[i];
|
||||
|
||||
if (conv.parseParam.ignoreEmpty && item === '') {
|
||||
continue;
|
||||
}
|
||||
hasValue = true;
|
||||
|
||||
let head = headRow[i];
|
||||
if (!head || head === "") {
|
||||
head = headRow[i] = "field" + (i + 1);
|
||||
}
|
||||
const convFunc = getConvFunc(head, i, conv);
|
||||
if (convFunc) {
|
||||
const convRes = convFunc(item, head, resultRow, row, i);
|
||||
if (convRes !== undefined) {
|
||||
setPath(resultRow, head, convRes, conv,i);
|
||||
}
|
||||
} else {
|
||||
// var flag = getFlag(head, i, param);
|
||||
// if (flag === 'omit') {
|
||||
// continue;
|
||||
// }
|
||||
if (conv.parseParam.checkType) {
|
||||
const convertFunc = checkType(item, head, i, conv);
|
||||
item = convertFunc(item);
|
||||
}
|
||||
<span class="missing-if-branch" title="else path not taken" >E</span>if (item !== undefined) {
|
||||
setPath(resultRow, head, item, conv,i);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasValue) {
|
||||
return resultRow;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
const builtInConv: { [key: string]: CellParser } = {
|
||||
"string": stringType,
|
||||
"number": numberType,
|
||||
"omit": function () { }
|
||||
}
|
||||
function getConvFunc(head: string, i: number, conv: Converter): CellParser | null {
|
||||
if (conv.parseRuntime.columnConv[i] !== undefined) {
|
||||
return conv.parseRuntime.columnConv[i];
|
||||
} else {
|
||||
let flag = conv.parseParam.colParser[head];
|
||||
if (flag === undefined) {
|
||||
return conv.parseRuntime.columnConv[i] = null;
|
||||
}
|
||||
if (typeof flag === "object") {
|
||||
flag = (flag as ColumnParam).cellParser || "string";
|
||||
}
|
||||
if (typeof flag === "string") {
|
||||
flag = flag.trim().toLowerCase();
|
||||
const builtInFunc = builtInConv[flag];
|
||||
<span class="missing-if-branch" title="else path not taken" >E</span>if (builtInFunc) {
|
||||
return conv.parseRuntime.columnConv[i] = builtInFunc;
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > return conv.parseRuntime.columnConv[i] = null;</span>
|
||||
}
|
||||
} else <span class="missing-if-branch" title="else path not taken" >E</span>if (typeof flag === "function") {
|
||||
return conv.parseRuntime.columnConv[i] = flag;
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > return conv.parseRuntime.columnConv[i] = null;</span>
|
||||
}
|
||||
}
|
||||
}
|
||||
function setPath(resultJson: any, head: string, value: any, conv: Converter,headIdx:number) {
|
||||
if (!conv.parseRuntime.columnValueSetter[headIdx]) {
|
||||
if (conv.parseParam.flatKeys) {
|
||||
conv.parseRuntime.columnValueSetter[headIdx] = flatSetter;
|
||||
} else {
|
||||
if (head.indexOf(".") > -1) {
|
||||
if (conv.parseParam.colParser[head] && (conv.parseParam.colParser[head] as ColumnParam).flat) {
|
||||
conv.parseRuntime.columnValueSetter[headIdx] = flatSetter;
|
||||
} else {
|
||||
conv.parseRuntime.columnValueSetter[headIdx] = jsonSetter;
|
||||
}
|
||||
} else {
|
||||
conv.parseRuntime.columnValueSetter[headIdx] = flatSetter;
|
||||
}
|
||||
}
|
||||
}
|
||||
conv.parseRuntime.columnValueSetter[headIdx](resultJson, head, value);
|
||||
// flatSetter(resultJson, head, value);
|
||||
|
||||
}
|
||||
function flatSetter(resultJson: any, head: string, value: any) {
|
||||
resultJson[head] = value;
|
||||
}
|
||||
function jsonSetter(resultJson: any, head: string, value: any) {
|
||||
set(resultJson, head, value);
|
||||
}
|
||||
|
||||
|
||||
function checkType(item: string, head: string, headIdx: number, conv: Converter): Function {
|
||||
if (conv.parseRuntime.headerType[headIdx]) {
|
||||
return conv.parseRuntime.headerType[headIdx];
|
||||
} else <span class="missing-if-branch" title="if path not taken" >I</span>if (head.indexOf('number#!') > -1) {
|
||||
<span class="cstat-no" title="statement not covered" > return conv.parseRuntime.headerType[headIdx] = numberType;</span>
|
||||
} else <span class="missing-if-branch" title="if path not taken" >I</span>if (head.indexOf('string#!') > -1) {
|
||||
<span class="cstat-no" title="statement not covered" > return conv.parseRuntime.headerType[headIdx] = stringType;</span>
|
||||
} else <span class="missing-if-branch" title="else path not taken" >E</span>if (conv.parseParam.checkType) {
|
||||
return conv.parseRuntime.headerType[headIdx] = dynamicType;
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > return conv.parseRuntime.headerType[headIdx] = stringType;</span>
|
||||
}
|
||||
}
|
||||
|
||||
function numberType(item) {
|
||||
var rtn = parseFloat(item);
|
||||
if (isNaN(rtn)) {
|
||||
return item;
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
|
||||
function stringType(item: string): string {
|
||||
return item.toString();
|
||||
}
|
||||
|
||||
function dynamicType(item) {
|
||||
var trimed = item.trim();
|
||||
if (trimed === "") {
|
||||
return stringType(item);
|
||||
}
|
||||
if (numReg.test(trimed)) {
|
||||
return numberType(item);
|
||||
} else if (trimed.length === 5 && trimed.toLowerCase() === "false" || trimed.length === 4 && trimed.toLowerCase() === "true") {
|
||||
return booleanType(item);
|
||||
} else if (trimed[0] === "{" && trimed[trimed.length - 1] === "}" || trimed[0] === "[" && trimed[trimed.length - 1] === "]") {
|
||||
return jsonType(item);
|
||||
} else {
|
||||
return stringType(item);
|
||||
}
|
||||
}
|
||||
|
||||
function booleanType(item) {
|
||||
var trimed = item.trim();
|
||||
if (trimed.length === 5 && trimed.toLowerCase() === "false") {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function jsonType(item) {
|
||||
try {
|
||||
return JSON.parse(item);
|
||||
} catch (e) {
|
||||
<span class="cstat-no" title="statement not covered" > return item;</span>
|
||||
}
|
||||
}
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Thu May 17 2018 01:25:26 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>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,69 @@
|
||||
import { MonoTypeOperatorFunction, ObservableInput } from '../types';
|
||||
import { operate } from '../util/lift';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
import { innerFrom } from '../observable/innerFrom';
|
||||
import { noop } from '../util/noop';
|
||||
|
||||
/**
|
||||
* Returns an Observable that skips items emitted by the source Observable until a second Observable emits an item.
|
||||
*
|
||||
* The `skipUntil` operator causes the observable stream to skip the emission of values until the passed in observable
|
||||
* emits the first value. This can be particularly useful in combination with user interactions, responses of HTTP
|
||||
* requests or waiting for specific times to pass by.
|
||||
*
|
||||
* 
|
||||
*
|
||||
* Internally, the `skipUntil` operator subscribes to the passed in `notifier` `ObservableInput` (which gets converted
|
||||
* to an Observable) in order to recognize the emission of its first value. When `notifier` emits next, the operator
|
||||
* unsubscribes from it and starts emitting the values of the *source* observable until it completes or errors. It
|
||||
* will never let the *source* observable emit any values if the `notifier` completes or throws an error without
|
||||
* emitting a value before.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* In the following example, all emitted values of the interval observable are skipped until the user clicks anywhere
|
||||
* within the page
|
||||
*
|
||||
* ```ts
|
||||
* import { interval, fromEvent, skipUntil } from 'rxjs';
|
||||
*
|
||||
* const intervalObservable = interval(1000);
|
||||
* const click = fromEvent(document, 'click');
|
||||
*
|
||||
* const emitAfterClick = intervalObservable.pipe(
|
||||
* skipUntil(click)
|
||||
* );
|
||||
* // clicked at 4.6s. output: 5...6...7...8........ or
|
||||
* // clicked at 7.3s. output: 8...9...10..11.......
|
||||
* emitAfterClick.subscribe(value => console.log(value));
|
||||
* ```
|
||||
*
|
||||
* @see {@link last}
|
||||
* @see {@link skip}
|
||||
* @see {@link skipWhile}
|
||||
* @see {@link skipLast}
|
||||
*
|
||||
* @param notifier An `ObservableInput` that has to emit an item before the source Observable elements begin to
|
||||
* be mirrored by the resulting Observable.
|
||||
* @return A function that returns an Observable that skips items from the
|
||||
* source Observable until the `notifier` Observable emits an item, then emits the
|
||||
* remaining items.
|
||||
*/
|
||||
export function skipUntil<T>(notifier: ObservableInput<any>): MonoTypeOperatorFunction<T> {
|
||||
return operate((source, subscriber) => {
|
||||
let taking = false;
|
||||
|
||||
const skipSubscriber = createOperatorSubscriber(
|
||||
subscriber,
|
||||
() => {
|
||||
skipSubscriber?.unsubscribe();
|
||||
taking = true;
|
||||
},
|
||||
noop
|
||||
);
|
||||
|
||||
innerFrom(notifier).subscribe(skipSubscriber);
|
||||
|
||||
source.subscribe(createOperatorSubscriber(subscriber, (value) => taking && subscriber.next(value)));
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Fork } from "../types";
|
||||
import { ASTNode } from "./types";
|
||||
export interface Path<V = any> {
|
||||
value: V;
|
||||
parentPath: any;
|
||||
name: any;
|
||||
__childCache: object | null;
|
||||
getValueProperty(name: any): any;
|
||||
get(...names: any[]): any;
|
||||
each(callback: any, context: any): any;
|
||||
map(callback: any, context: any): any;
|
||||
filter(callback: any, context: any): any;
|
||||
shift(): any;
|
||||
unshift(...args: any[]): any;
|
||||
push(...args: any[]): any;
|
||||
pop(): any;
|
||||
insertAt(index: number, ...args: any[]): any;
|
||||
insertBefore(...args: any[]): any;
|
||||
insertAfter(...args: any[]): any;
|
||||
replace(replacement?: ASTNode, ...args: ASTNode[]): any;
|
||||
}
|
||||
export interface PathConstructor {
|
||||
new <V = any>(value: any, parentPath?: any, name?: any): Path<V>;
|
||||
}
|
||||
export default function pathPlugin(fork: Fork): PathConstructor;
|
||||
@@ -0,0 +1,10 @@
|
||||
export function DefaultNumberOption(val, min, max, fallback) {
|
||||
if (val !== undefined) {
|
||||
val = Number(val);
|
||||
if (isNaN(val) || val < min || val > max) {
|
||||
throw new RangeError("".concat(val, " is outside of range [").concat(min, ", ").concat(max, "]"));
|
||||
}
|
||||
return Math.floor(val);
|
||||
}
|
||||
return fallback;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pairwise.js","sourceRoot":"","sources":["../../../../src/internal/operators/pairwise.ts"],"names":[],"mappings":";;;AACA,qCAAuC;AACvC,2DAAgE;AA6ChE,SAAgB,QAAQ;IACtB,OAAO,cAAO,CAAC,UAAC,MAAM,EAAE,UAAU;QAChC,IAAI,IAAO,CAAC;QACZ,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,MAAM,CAAC,SAAS,CACd,6CAAwB,CAAC,UAAU,EAAE,UAAC,KAAK;YACzC,IAAM,CAAC,GAAG,IAAI,CAAC;YACf,IAAI,GAAG,KAAK,CAAC;YACb,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;YACvC,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAbD,4BAaC"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E CC","260":"F 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 M N O"},C:{"1":"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","2":"DC tB I v J D E F A B C K L G M N O w g x y EC FC","132":"0 1 2 3 4 z"},D:{"1":"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 MB NB OB PB QB"},E:{"1":"B C K L G 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J D E F A HC zB IC JC KC LC"},F:{"1":"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 rB","2":"0 1 2 3 4 5 6 7 8 9 F B G M N O w g x y z AB BB CB DB PC QC RC SC qB AC TC","16":"C"},G:{"1":"cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"E zB UC BC VC WC XC YC ZC aC bC"},H:{"1":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"1":"h rB","2":"A B qB AC","16":"C"},L:{"1":"H"},M:{"1":"H"},N:{"260":"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:{"1":"AD BD"}},B:5,C:"KeyboardEvent.key"};
|
||||
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>negateValue
|
||||
});
|
||||
function negateValue(value) {
|
||||
value = `${value}`;
|
||||
if (value === "0") {
|
||||
return "0";
|
||||
}
|
||||
// Flip sign of numbers
|
||||
if (/^[+-]?(\d+|\d*\.\d+)(e[+-]?\d+)?(%|\w+)?$/.test(value)) {
|
||||
return value.replace(/^[+-]?/, (sign)=>sign === "-" ? "" : "-");
|
||||
}
|
||||
// What functions we support negating numeric values for
|
||||
// var() isn't inherently a numeric function but we support it anyway
|
||||
// The trigonometric functions are omitted because you'll need to use calc(…) with them _anyway_
|
||||
// to produce generally useful results and that will be covered already
|
||||
let numericFunctions = [
|
||||
"var",
|
||||
"calc",
|
||||
"min",
|
||||
"max",
|
||||
"clamp"
|
||||
];
|
||||
for (const fn of numericFunctions){
|
||||
if (value.includes(`${fn}(`)) {
|
||||
return `calc(${value} * -1)`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
import { mergeMap } from './mergeMap';
|
||||
import { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';
|
||||
import { isFunction } from '../util/isFunction';
|
||||
|
||||
/* tslint:disable:max-line-length */
|
||||
export function concatMap<T, O extends ObservableInput<any>>(
|
||||
project: (value: T, index: number) => O
|
||||
): OperatorFunction<T, ObservedValueOf<O>>;
|
||||
/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */
|
||||
export function concatMap<T, O extends ObservableInput<any>>(
|
||||
project: (value: T, index: number) => O,
|
||||
resultSelector: undefined
|
||||
): OperatorFunction<T, ObservedValueOf<O>>;
|
||||
/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */
|
||||
export function concatMap<T, R, O extends ObservableInput<any>>(
|
||||
project: (value: T, index: number) => O,
|
||||
resultSelector: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R
|
||||
): OperatorFunction<T, R>;
|
||||
/* tslint:enable:max-line-length */
|
||||
|
||||
/**
|
||||
* Projects each source value to an Observable which is merged in the output
|
||||
* Observable, in a serialized fashion waiting for each one to complete before
|
||||
* merging the next.
|
||||
*
|
||||
* <span class="informal">Maps each value to an Observable, then flattens all of
|
||||
* these inner Observables using {@link concatAll}.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* Returns an Observable that emits items based on applying a function that you
|
||||
* supply to each item emitted by the source Observable, where that function
|
||||
* returns an (so-called "inner") Observable. Each new inner Observable is
|
||||
* concatenated with the previous inner Observable.
|
||||
*
|
||||
* __Warning:__ if source values arrive endlessly and faster than their
|
||||
* corresponding inner Observables can complete, it will result in memory issues
|
||||
* as inner Observables amass in an unbounded buffer waiting for their turn to
|
||||
* be subscribed to.
|
||||
*
|
||||
* Note: `concatMap` is equivalent to `mergeMap` with concurrency parameter set
|
||||
* to `1`.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* For each click event, tick every second from 0 to 3, with no concurrency
|
||||
*
|
||||
* ```ts
|
||||
* import { fromEvent, concatMap, interval, take } from 'rxjs';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const result = clicks.pipe(
|
||||
* concatMap(ev => interval(1000).pipe(take(4)))
|
||||
* );
|
||||
* result.subscribe(x => console.log(x));
|
||||
*
|
||||
* // Results in the following:
|
||||
* // (results are not concurrent)
|
||||
* // For every click on the "document" it will emit values 0 to 3 spaced
|
||||
* // on a 1000ms interval
|
||||
* // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3
|
||||
* ```
|
||||
*
|
||||
* @see {@link concat}
|
||||
* @see {@link concatAll}
|
||||
* @see {@link concatMapTo}
|
||||
* @see {@link exhaustMap}
|
||||
* @see {@link mergeMap}
|
||||
* @see {@link switchMap}
|
||||
*
|
||||
* @param {function(value: T, ?index: number): ObservableInput} project A function
|
||||
* that, when applied to an item emitted by the source Observable, returns an
|
||||
* Observable.
|
||||
* @return A function that returns an Observable that emits the result of
|
||||
* applying the projection function (and the optional deprecated
|
||||
* `resultSelector`) to each item emitted by the source Observable and taking
|
||||
* values from each projected inner Observable sequentially.
|
||||
*/
|
||||
export function concatMap<T, R, O extends ObservableInput<any>>(
|
||||
project: (value: T, index: number) => O,
|
||||
resultSelector?: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R
|
||||
): OperatorFunction<T, ObservedValueOf<O> | R> {
|
||||
return isFunction(resultSelector) ? mergeMap(project, resultSelector, 1) : mergeMap(project, 1);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
class Deprecation extends Error {
|
||||
constructor(message) {
|
||||
super(message); // Maintains proper stack trace (only available on V8)
|
||||
|
||||
/* istanbul ignore next */
|
||||
|
||||
if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
}
|
||||
|
||||
this.name = 'Deprecation';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export { Deprecation };
|
||||
@@ -0,0 +1,235 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.sha384 = exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.SHA512 = void 0;
|
||||
const _sha2_js_1 = require("./_sha2.js");
|
||||
const _u64_js_1 = require("./_u64.js");
|
||||
const utils_js_1 = require("./utils.js");
|
||||
// Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409):
|
||||
// prettier-ignore
|
||||
const [SHA512_Kh, SHA512_Kl] = _u64_js_1.default.split([
|
||||
'0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',
|
||||
'0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',
|
||||
'0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',
|
||||
'0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',
|
||||
'0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',
|
||||
'0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',
|
||||
'0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',
|
||||
'0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',
|
||||
'0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',
|
||||
'0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',
|
||||
'0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',
|
||||
'0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',
|
||||
'0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',
|
||||
'0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',
|
||||
'0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',
|
||||
'0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',
|
||||
'0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',
|
||||
'0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',
|
||||
'0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',
|
||||
'0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'
|
||||
].map(n => BigInt(n)));
|
||||
// Temporary buffer, not used to store anything between runs
|
||||
const SHA512_W_H = new Uint32Array(80);
|
||||
const SHA512_W_L = new Uint32Array(80);
|
||||
class SHA512 extends _sha2_js_1.SHA2 {
|
||||
constructor() {
|
||||
super(128, 64, 16, false);
|
||||
// We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers.
|
||||
// Also looks cleaner and easier to verify with spec.
|
||||
// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):
|
||||
// h -- high 32 bits, l -- low 32 bits
|
||||
this.Ah = 0x6a09e667 | 0;
|
||||
this.Al = 0xf3bcc908 | 0;
|
||||
this.Bh = 0xbb67ae85 | 0;
|
||||
this.Bl = 0x84caa73b | 0;
|
||||
this.Ch = 0x3c6ef372 | 0;
|
||||
this.Cl = 0xfe94f82b | 0;
|
||||
this.Dh = 0xa54ff53a | 0;
|
||||
this.Dl = 0x5f1d36f1 | 0;
|
||||
this.Eh = 0x510e527f | 0;
|
||||
this.El = 0xade682d1 | 0;
|
||||
this.Fh = 0x9b05688c | 0;
|
||||
this.Fl = 0x2b3e6c1f | 0;
|
||||
this.Gh = 0x1f83d9ab | 0;
|
||||
this.Gl = 0xfb41bd6b | 0;
|
||||
this.Hh = 0x5be0cd19 | 0;
|
||||
this.Hl = 0x137e2179 | 0;
|
||||
}
|
||||
// prettier-ignore
|
||||
get() {
|
||||
const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
|
||||
return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];
|
||||
}
|
||||
// prettier-ignore
|
||||
set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {
|
||||
this.Ah = Ah | 0;
|
||||
this.Al = Al | 0;
|
||||
this.Bh = Bh | 0;
|
||||
this.Bl = Bl | 0;
|
||||
this.Ch = Ch | 0;
|
||||
this.Cl = Cl | 0;
|
||||
this.Dh = Dh | 0;
|
||||
this.Dl = Dl | 0;
|
||||
this.Eh = Eh | 0;
|
||||
this.El = El | 0;
|
||||
this.Fh = Fh | 0;
|
||||
this.Fl = Fl | 0;
|
||||
this.Gh = Gh | 0;
|
||||
this.Gl = Gl | 0;
|
||||
this.Hh = Hh | 0;
|
||||
this.Hl = Hl | 0;
|
||||
}
|
||||
process(view, offset) {
|
||||
// Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array
|
||||
for (let i = 0; i < 16; i++, offset += 4) {
|
||||
SHA512_W_H[i] = view.getUint32(offset);
|
||||
SHA512_W_L[i] = view.getUint32((offset += 4));
|
||||
}
|
||||
for (let i = 16; i < 80; i++) {
|
||||
// s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)
|
||||
const W15h = SHA512_W_H[i - 15] | 0;
|
||||
const W15l = SHA512_W_L[i - 15] | 0;
|
||||
const s0h = _u64_js_1.default.rotrSH(W15h, W15l, 1) ^ _u64_js_1.default.rotrSH(W15h, W15l, 8) ^ _u64_js_1.default.shrSH(W15h, W15l, 7);
|
||||
const s0l = _u64_js_1.default.rotrSL(W15h, W15l, 1) ^ _u64_js_1.default.rotrSL(W15h, W15l, 8) ^ _u64_js_1.default.shrSL(W15h, W15l, 7);
|
||||
// s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)
|
||||
const W2h = SHA512_W_H[i - 2] | 0;
|
||||
const W2l = SHA512_W_L[i - 2] | 0;
|
||||
const s1h = _u64_js_1.default.rotrSH(W2h, W2l, 19) ^ _u64_js_1.default.rotrBH(W2h, W2l, 61) ^ _u64_js_1.default.shrSH(W2h, W2l, 6);
|
||||
const s1l = _u64_js_1.default.rotrSL(W2h, W2l, 19) ^ _u64_js_1.default.rotrBL(W2h, W2l, 61) ^ _u64_js_1.default.shrSL(W2h, W2l, 6);
|
||||
// SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];
|
||||
const SUMl = _u64_js_1.default.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
|
||||
const SUMh = _u64_js_1.default.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
|
||||
SHA512_W_H[i] = SUMh | 0;
|
||||
SHA512_W_L[i] = SUMl | 0;
|
||||
}
|
||||
let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
|
||||
// Compression function main loop, 80 rounds
|
||||
for (let i = 0; i < 80; i++) {
|
||||
// S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)
|
||||
const sigma1h = _u64_js_1.default.rotrSH(Eh, El, 14) ^ _u64_js_1.default.rotrSH(Eh, El, 18) ^ _u64_js_1.default.rotrBH(Eh, El, 41);
|
||||
const sigma1l = _u64_js_1.default.rotrSL(Eh, El, 14) ^ _u64_js_1.default.rotrSL(Eh, El, 18) ^ _u64_js_1.default.rotrBL(Eh, El, 41);
|
||||
//const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;
|
||||
const CHIh = (Eh & Fh) ^ (~Eh & Gh);
|
||||
const CHIl = (El & Fl) ^ (~El & Gl);
|
||||
// T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]
|
||||
// prettier-ignore
|
||||
const T1ll = _u64_js_1.default.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
|
||||
const T1h = _u64_js_1.default.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
|
||||
const T1l = T1ll | 0;
|
||||
// S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)
|
||||
const sigma0h = _u64_js_1.default.rotrSH(Ah, Al, 28) ^ _u64_js_1.default.rotrBH(Ah, Al, 34) ^ _u64_js_1.default.rotrBH(Ah, Al, 39);
|
||||
const sigma0l = _u64_js_1.default.rotrSL(Ah, Al, 28) ^ _u64_js_1.default.rotrBL(Ah, Al, 34) ^ _u64_js_1.default.rotrBL(Ah, Al, 39);
|
||||
const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);
|
||||
const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);
|
||||
Hh = Gh | 0;
|
||||
Hl = Gl | 0;
|
||||
Gh = Fh | 0;
|
||||
Gl = Fl | 0;
|
||||
Fh = Eh | 0;
|
||||
Fl = El | 0;
|
||||
({ h: Eh, l: El } = _u64_js_1.default.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
|
||||
Dh = Ch | 0;
|
||||
Dl = Cl | 0;
|
||||
Ch = Bh | 0;
|
||||
Cl = Bl | 0;
|
||||
Bh = Ah | 0;
|
||||
Bl = Al | 0;
|
||||
const All = _u64_js_1.default.add3L(T1l, sigma0l, MAJl);
|
||||
Ah = _u64_js_1.default.add3H(All, T1h, sigma0h, MAJh);
|
||||
Al = All | 0;
|
||||
}
|
||||
// Add the compressed chunk to the current hash value
|
||||
({ h: Ah, l: Al } = _u64_js_1.default.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
|
||||
({ h: Bh, l: Bl } = _u64_js_1.default.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
|
||||
({ h: Ch, l: Cl } = _u64_js_1.default.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
|
||||
({ h: Dh, l: Dl } = _u64_js_1.default.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
|
||||
({ h: Eh, l: El } = _u64_js_1.default.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
|
||||
({ h: Fh, l: Fl } = _u64_js_1.default.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
|
||||
({ h: Gh, l: Gl } = _u64_js_1.default.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
|
||||
({ h: Hh, l: Hl } = _u64_js_1.default.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
|
||||
this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);
|
||||
}
|
||||
roundClean() {
|
||||
SHA512_W_H.fill(0);
|
||||
SHA512_W_L.fill(0);
|
||||
}
|
||||
destroy() {
|
||||
this.buffer.fill(0);
|
||||
this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
exports.SHA512 = SHA512;
|
||||
class SHA512_224 extends SHA512 {
|
||||
constructor() {
|
||||
super();
|
||||
// h -- high 32 bits, l -- low 32 bits
|
||||
this.Ah = 0x8c3d37c8 | 0;
|
||||
this.Al = 0x19544da2 | 0;
|
||||
this.Bh = 0x73e19966 | 0;
|
||||
this.Bl = 0x89dcd4d6 | 0;
|
||||
this.Ch = 0x1dfab7ae | 0;
|
||||
this.Cl = 0x32ff9c82 | 0;
|
||||
this.Dh = 0x679dd514 | 0;
|
||||
this.Dl = 0x582f9fcf | 0;
|
||||
this.Eh = 0x0f6d2b69 | 0;
|
||||
this.El = 0x7bd44da8 | 0;
|
||||
this.Fh = 0x77e36f73 | 0;
|
||||
this.Fl = 0x04c48942 | 0;
|
||||
this.Gh = 0x3f9d85a8 | 0;
|
||||
this.Gl = 0x6a1d36c8 | 0;
|
||||
this.Hh = 0x1112e6ad | 0;
|
||||
this.Hl = 0x91d692a1 | 0;
|
||||
this.outputLen = 28;
|
||||
}
|
||||
}
|
||||
class SHA512_256 extends SHA512 {
|
||||
constructor() {
|
||||
super();
|
||||
// h -- high 32 bits, l -- low 32 bits
|
||||
this.Ah = 0x22312194 | 0;
|
||||
this.Al = 0xfc2bf72c | 0;
|
||||
this.Bh = 0x9f555fa3 | 0;
|
||||
this.Bl = 0xc84c64c2 | 0;
|
||||
this.Ch = 0x2393b86b | 0;
|
||||
this.Cl = 0x6f53b151 | 0;
|
||||
this.Dh = 0x96387719 | 0;
|
||||
this.Dl = 0x5940eabd | 0;
|
||||
this.Eh = 0x96283ee2 | 0;
|
||||
this.El = 0xa88effe3 | 0;
|
||||
this.Fh = 0xbe5e1e25 | 0;
|
||||
this.Fl = 0x53863992 | 0;
|
||||
this.Gh = 0x2b0199fc | 0;
|
||||
this.Gl = 0x2c85b8aa | 0;
|
||||
this.Hh = 0x0eb72ddc | 0;
|
||||
this.Hl = 0x81c52ca2 | 0;
|
||||
this.outputLen = 32;
|
||||
}
|
||||
}
|
||||
class SHA384 extends SHA512 {
|
||||
constructor() {
|
||||
super();
|
||||
// h -- high 32 bits, l -- low 32 bits
|
||||
this.Ah = 0xcbbb9d5d | 0;
|
||||
this.Al = 0xc1059ed8 | 0;
|
||||
this.Bh = 0x629a292a | 0;
|
||||
this.Bl = 0x367cd507 | 0;
|
||||
this.Ch = 0x9159015a | 0;
|
||||
this.Cl = 0x3070dd17 | 0;
|
||||
this.Dh = 0x152fecd8 | 0;
|
||||
this.Dl = 0xf70e5939 | 0;
|
||||
this.Eh = 0x67332667 | 0;
|
||||
this.El = 0xffc00b31 | 0;
|
||||
this.Fh = 0x8eb44a87 | 0;
|
||||
this.Fl = 0x68581511 | 0;
|
||||
this.Gh = 0xdb0c2e0d | 0;
|
||||
this.Gl = 0x64f98fa7 | 0;
|
||||
this.Hh = 0x47b5481d | 0;
|
||||
this.Hl = 0xbefa4fa4 | 0;
|
||||
this.outputLen = 48;
|
||||
}
|
||||
}
|
||||
exports.sha512 = (0, utils_js_1.wrapConstructor)(() => new SHA512());
|
||||
exports.sha512_224 = (0, utils_js_1.wrapConstructor)(() => new SHA512_224());
|
||||
exports.sha512_256 = (0, utils_js_1.wrapConstructor)(() => new SHA512_256());
|
||||
exports.sha384 = (0, utils_js_1.wrapConstructor)(() => new SHA384());
|
||||
//# sourceMappingURL=sha512.js.map
|
||||
@@ -0,0 +1,108 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const buffer_1 = require("buffer");
|
||||
/**
|
||||
* Error strings
|
||||
*/
|
||||
const ERRORS = {
|
||||
INVALID_ENCODING: 'Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.',
|
||||
INVALID_SMARTBUFFER_SIZE: 'Invalid size provided. Size must be a valid integer greater than zero.',
|
||||
INVALID_SMARTBUFFER_BUFFER: 'Invalid Buffer provided in SmartBufferOptions.',
|
||||
INVALID_SMARTBUFFER_OBJECT: 'Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.',
|
||||
INVALID_OFFSET: 'An invalid offset value was provided.',
|
||||
INVALID_OFFSET_NON_NUMBER: 'An invalid offset value was provided. A numeric value is required.',
|
||||
INVALID_LENGTH: 'An invalid length value was provided.',
|
||||
INVALID_LENGTH_NON_NUMBER: 'An invalid length value was provived. A numeric value is required.',
|
||||
INVALID_TARGET_OFFSET: 'Target offset is beyond the bounds of the internal SmartBuffer data.',
|
||||
INVALID_TARGET_LENGTH: 'Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.',
|
||||
INVALID_READ_BEYOND_BOUNDS: 'Attempted to read beyond the bounds of the managed data.',
|
||||
INVALID_WRITE_BEYOND_BOUNDS: 'Attempted to write beyond the bounds of the managed data.'
|
||||
};
|
||||
exports.ERRORS = ERRORS;
|
||||
/**
|
||||
* Checks if a given encoding is a valid Buffer encoding. (Throws an exception if check fails)
|
||||
*
|
||||
* @param { String } encoding The encoding string to check.
|
||||
*/
|
||||
function checkEncoding(encoding) {
|
||||
if (!buffer_1.Buffer.isEncoding(encoding)) {
|
||||
throw new Error(ERRORS.INVALID_ENCODING);
|
||||
}
|
||||
}
|
||||
exports.checkEncoding = checkEncoding;
|
||||
/**
|
||||
* Checks if a given number is a finite integer. (Throws an exception if check fails)
|
||||
*
|
||||
* @param { Number } value The number value to check.
|
||||
*/
|
||||
function isFiniteInteger(value) {
|
||||
return typeof value === 'number' && isFinite(value) && isInteger(value);
|
||||
}
|
||||
exports.isFiniteInteger = isFiniteInteger;
|
||||
/**
|
||||
* Checks if an offset/length value is valid. (Throws an exception if check fails)
|
||||
*
|
||||
* @param value The value to check.
|
||||
* @param offset True if checking an offset, false if checking a length.
|
||||
*/
|
||||
function checkOffsetOrLengthValue(value, offset) {
|
||||
if (typeof value === 'number') {
|
||||
// Check for non finite/non integers
|
||||
if (!isFiniteInteger(value) || value < 0) {
|
||||
throw new Error(offset ? ERRORS.INVALID_OFFSET : ERRORS.INVALID_LENGTH);
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new Error(offset ? ERRORS.INVALID_OFFSET_NON_NUMBER : ERRORS.INVALID_LENGTH_NON_NUMBER);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Checks if a length value is valid. (Throws an exception if check fails)
|
||||
*
|
||||
* @param { Number } length The value to check.
|
||||
*/
|
||||
function checkLengthValue(length) {
|
||||
checkOffsetOrLengthValue(length, false);
|
||||
}
|
||||
exports.checkLengthValue = checkLengthValue;
|
||||
/**
|
||||
* Checks if a offset value is valid. (Throws an exception if check fails)
|
||||
*
|
||||
* @param { Number } offset The value to check.
|
||||
*/
|
||||
function checkOffsetValue(offset) {
|
||||
checkOffsetOrLengthValue(offset, true);
|
||||
}
|
||||
exports.checkOffsetValue = checkOffsetValue;
|
||||
/**
|
||||
* Checks if a target offset value is out of bounds. (Throws an exception if check fails)
|
||||
*
|
||||
* @param { Number } offset The offset value to check.
|
||||
* @param { SmartBuffer } buff The SmartBuffer instance to check against.
|
||||
*/
|
||||
function checkTargetOffset(offset, buff) {
|
||||
if (offset < 0 || offset > buff.length) {
|
||||
throw new Error(ERRORS.INVALID_TARGET_OFFSET);
|
||||
}
|
||||
}
|
||||
exports.checkTargetOffset = checkTargetOffset;
|
||||
/**
|
||||
* Determines whether a given number is a integer.
|
||||
* @param value The number to check.
|
||||
*/
|
||||
function isInteger(value) {
|
||||
return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
|
||||
}
|
||||
/**
|
||||
* Throws if Node.js version is too low to support bigint
|
||||
*/
|
||||
function bigIntAndBufferInt64Check(bufferMethod) {
|
||||
if (typeof BigInt === 'undefined') {
|
||||
throw new Error('Platform does not support JS BigInt type.');
|
||||
}
|
||||
if (typeof buffer_1.Buffer.prototype[bufferMethod] === 'undefined') {
|
||||
throw new Error(`Platform does not support Buffer.prototype.${bufferMethod}.`);
|
||||
}
|
||||
}
|
||||
exports.bigIntAndBufferInt64Check = bigIntAndBufferInt64Check;
|
||||
//# sourceMappingURL=utils.js.map
|
||||
@@ -0,0 +1,6 @@
|
||||
Copyright (c) 2015, Rebecca Turner
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
var baseMatches = require('./_baseMatches'),
|
||||
baseMatchesProperty = require('./_baseMatchesProperty'),
|
||||
identity = require('./identity'),
|
||||
isArray = require('./isArray'),
|
||||
property = require('./property');
|
||||
|
||||
/**
|
||||
* The base implementation of `_.iteratee`.
|
||||
*
|
||||
* @private
|
||||
* @param {*} [value=_.identity] The value to convert to an iteratee.
|
||||
* @returns {Function} Returns the iteratee.
|
||||
*/
|
||||
function baseIteratee(value) {
|
||||
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
|
||||
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
|
||||
if (typeof value == 'function') {
|
||||
return value;
|
||||
}
|
||||
if (value == null) {
|
||||
return identity;
|
||||
}
|
||||
if (typeof value == 'object') {
|
||||
return isArray(value)
|
||||
? baseMatchesProperty(value[0], value[1])
|
||||
: baseMatches(value);
|
||||
}
|
||||
return property(value);
|
||||
}
|
||||
|
||||
module.exports = baseIteratee;
|
||||
@@ -0,0 +1,70 @@
|
||||
# is-typed-array <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
||||
|
||||
[![github actions][actions-image]][actions-url]
|
||||
[![coverage][codecov-image]][codecov-url]
|
||||
[![dependency status][5]][6]
|
||||
[![dev dependency status][7]][8]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][npm-badge-png]][package-url]
|
||||
|
||||
Is this value a JS Typed Array? This module works cross-realm/iframe, does not depend on `instanceof` or mutable properties, and despite ES6 Symbol.toStringTag.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var isTypedArray = require('is-typed-array');
|
||||
var assert = require('assert');
|
||||
|
||||
assert.equal(false, isTypedArray(undefined));
|
||||
assert.equal(false, isTypedArray(null));
|
||||
assert.equal(false, isTypedArray(false));
|
||||
assert.equal(false, isTypedArray(true));
|
||||
assert.equal(false, isTypedArray([]));
|
||||
assert.equal(false, isTypedArray({}));
|
||||
assert.equal(false, isTypedArray(/a/g));
|
||||
assert.equal(false, isTypedArray(new RegExp('a', 'g')));
|
||||
assert.equal(false, isTypedArray(new Date()));
|
||||
assert.equal(false, isTypedArray(42));
|
||||
assert.equal(false, isTypedArray(NaN));
|
||||
assert.equal(false, isTypedArray(Infinity));
|
||||
assert.equal(false, isTypedArray(new Number(42)));
|
||||
assert.equal(false, isTypedArray('foo'));
|
||||
assert.equal(false, isTypedArray(Object('foo')));
|
||||
assert.equal(false, isTypedArray(function () {}));
|
||||
assert.equal(false, isTypedArray(function* () {}));
|
||||
assert.equal(false, isTypedArray(x => x * x));
|
||||
assert.equal(false, isTypedArray([]));
|
||||
|
||||
assert.ok(isTypedArray(new Int8Array()));
|
||||
assert.ok(isTypedArray(new Uint8Array()));
|
||||
assert.ok(isTypedArray(new Uint8ClampedArray()));
|
||||
assert.ok(isTypedArray(new Int16Array()));
|
||||
assert.ok(isTypedArray(new Uint16Array()));
|
||||
assert.ok(isTypedArray(new Int32Array()));
|
||||
assert.ok(isTypedArray(new Uint32Array()));
|
||||
assert.ok(isTypedArray(new Float32Array()));
|
||||
assert.ok(isTypedArray(new Float64Array()));
|
||||
assert.ok(isTypedArray(new BigInt64Array()));
|
||||
assert.ok(isTypedArray(new BigUint64Array()));
|
||||
```
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[package-url]: https://npmjs.org/package/is-typed-array
|
||||
[npm-version-svg]: https://versionbadg.es/inspect-js/is-typed-array.svg
|
||||
[deps-svg]: https://david-dm.org/inspect-js/is-typed-array.svg
|
||||
[deps-url]: https://david-dm.org/inspect-js/is-typed-array
|
||||
[dev-deps-svg]: https://david-dm.org/inspect-js/is-typed-array/dev-status.svg
|
||||
[dev-deps-url]: https://david-dm.org/inspect-js/is-typed-array#info=devDependencies
|
||||
[npm-badge-png]: https://nodei.co/npm/is-typed-array.png?downloads=true&stars=true
|
||||
[license-image]: https://img.shields.io/npm/l/is-typed-array.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/is-typed-array.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=is-typed-array
|
||||
[codecov-image]: https://codecov.io/gh/inspect-js/is-typed-array/branch/main/graphs/badge.svg
|
||||
[codecov-url]: https://app.codecov.io/gh/inspect-js/is-typed-array/
|
||||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-typed-array
|
||||
[actions-url]: https://github.com/inspect-js/is-typed-array/actions
|
||||
@@ -0,0 +1,193 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var stream_1 = require("stream");
|
||||
var Parameters_1 = require("./Parameters");
|
||||
var ParseRuntime_1 = require("./ParseRuntime");
|
||||
var bluebird_1 = __importDefault(require("bluebird"));
|
||||
// import { ProcessorFork } from "./ProcessFork";
|
||||
var ProcessorLocal_1 = require("./ProcessorLocal");
|
||||
var Result_1 = require("./Result");
|
||||
var Converter = /** @class */ (function (_super) {
|
||||
__extends(Converter, _super);
|
||||
function Converter(param, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
var _this = _super.call(this, options) || this;
|
||||
_this.options = options;
|
||||
_this.params = Parameters_1.mergeParams(param);
|
||||
_this.runtime = ParseRuntime_1.initParseRuntime(_this);
|
||||
_this.result = new Result_1.Result(_this);
|
||||
// if (this.params.fork) {
|
||||
// this.processor = new ProcessorFork(this);
|
||||
// } else {
|
||||
_this.processor = new ProcessorLocal_1.ProcessorLocal(_this);
|
||||
// }
|
||||
_this.once("error", function (err) {
|
||||
// console.log("BBB");
|
||||
//wait for next cycle to emit the errors.
|
||||
setImmediate(function () {
|
||||
_this.result.processError(err);
|
||||
_this.emit("done", err);
|
||||
});
|
||||
});
|
||||
_this.once("done", function () {
|
||||
_this.processor.destroy();
|
||||
});
|
||||
return _this;
|
||||
}
|
||||
Converter.prototype.preRawData = function (onRawData) {
|
||||
this.runtime.preRawDataHook = onRawData;
|
||||
return this;
|
||||
};
|
||||
Converter.prototype.preFileLine = function (onFileLine) {
|
||||
this.runtime.preFileLineHook = onFileLine;
|
||||
return this;
|
||||
};
|
||||
Converter.prototype.subscribe = function (onNext, onError, onCompleted) {
|
||||
this.parseRuntime.subscribe = {
|
||||
onNext: onNext,
|
||||
onError: onError,
|
||||
onCompleted: onCompleted
|
||||
};
|
||||
return this;
|
||||
};
|
||||
Converter.prototype.fromFile = function (filePath, options) {
|
||||
var _this = this;
|
||||
var fs = require("fs");
|
||||
// var rs = null;
|
||||
// this.wrapCallback(cb, function () {
|
||||
// if (rs && rs.destroy) {
|
||||
// rs.destroy();
|
||||
// }
|
||||
// });
|
||||
fs.exists(filePath, function (exist) {
|
||||
if (exist) {
|
||||
var rs = fs.createReadStream(filePath, options);
|
||||
rs.pipe(_this);
|
||||
}
|
||||
else {
|
||||
_this.emit('error', new Error("File does not exist. Check to make sure the file path to your csv is correct."));
|
||||
}
|
||||
});
|
||||
return this;
|
||||
};
|
||||
Converter.prototype.fromStream = function (readStream) {
|
||||
readStream.pipe(this);
|
||||
return this;
|
||||
};
|
||||
Converter.prototype.fromString = function (csvString) {
|
||||
var csv = csvString.toString();
|
||||
var read = new stream_1.Readable();
|
||||
var idx = 0;
|
||||
read._read = function (size) {
|
||||
if (idx >= csvString.length) {
|
||||
this.push(null);
|
||||
}
|
||||
else {
|
||||
var str = csvString.substr(idx, size);
|
||||
this.push(str);
|
||||
idx += size;
|
||||
}
|
||||
};
|
||||
return this.fromStream(read);
|
||||
};
|
||||
Converter.prototype.then = function (onfulfilled, onrejected) {
|
||||
var _this = this;
|
||||
return new bluebird_1.default(function (resolve, reject) {
|
||||
_this.parseRuntime.then = {
|
||||
onfulfilled: function (value) {
|
||||
if (onfulfilled) {
|
||||
resolve(onfulfilled(value));
|
||||
}
|
||||
else {
|
||||
resolve(value);
|
||||
}
|
||||
},
|
||||
onrejected: function (err) {
|
||||
if (onrejected) {
|
||||
resolve(onrejected(err));
|
||||
}
|
||||
else {
|
||||
reject(err);
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
};
|
||||
Object.defineProperty(Converter.prototype, "parseParam", {
|
||||
get: function () {
|
||||
return this.params;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(Converter.prototype, "parseRuntime", {
|
||||
get: function () {
|
||||
return this.runtime;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Converter.prototype._transform = function (chunk, encoding, cb) {
|
||||
var _this = this;
|
||||
this.processor.process(chunk)
|
||||
.then(function (result) {
|
||||
// console.log(result);
|
||||
if (result.length > 0) {
|
||||
_this.runtime.started = true;
|
||||
return _this.result.processResult(result);
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
_this.emit("drained");
|
||||
cb();
|
||||
}, function (error) {
|
||||
_this.runtime.hasError = true;
|
||||
_this.runtime.error = error;
|
||||
_this.emit("error", error);
|
||||
cb();
|
||||
});
|
||||
};
|
||||
Converter.prototype._flush = function (cb) {
|
||||
var _this = this;
|
||||
this.processor.flush()
|
||||
.then(function (data) {
|
||||
if (data.length > 0) {
|
||||
return _this.result.processResult(data);
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
_this.processEnd(cb);
|
||||
}, function (err) {
|
||||
_this.emit("error", err);
|
||||
cb();
|
||||
});
|
||||
};
|
||||
Converter.prototype.processEnd = function (cb) {
|
||||
this.result.endProcess();
|
||||
this.emit("done");
|
||||
cb();
|
||||
};
|
||||
Object.defineProperty(Converter.prototype, "parsedLineNumber", {
|
||||
get: function () {
|
||||
return this.runtime.parsedLineNumber;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return Converter;
|
||||
}(stream_1.Transform));
|
||||
exports.Converter = Converter;
|
||||
//# sourceMappingURL=Converter.js.map
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').concatLimit;
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"define-properties","version":"1.2.0","files":{".nycrc":{"checkedAt":1678883669555,"integrity":"sha512-2vm1RFz8Ajl/OYrfoCWPJIm3Bpnf7Gyn5bha/lZx/cq+We3uMy9xj15XeP6x4wF3jf/pO7KMHAkU9mllm605xg==","mode":420,"size":139},".editorconfig":{"checkedAt":1678883671537,"integrity":"sha512-p35O0lNr5b8Aha4N1dns/Zy3+rV1ZLx6ffSVcrlURzE+W3zbryu0BkQ6tiGeSgp248nP94ZxUa8iBmtp1ocZng==","mode":420,"size":276},".eslintrc":{"checkedAt":1678883671537,"integrity":"sha512-dK64I0b5byBrmrtSS9BpVq5jo33jfo15QTmuMYVV4iEXmy73HxJujOq9ofYmWFg7TI1Pnxwv10Up3V2Gpj/nRg==","mode":420,"size":235},"LICENSE":{"checkedAt":1678883671537,"integrity":"sha512-Q1ArqEMvEH2hc5UHB3zVDlS7EaPN6DOw02m9Nmd7TbPVOBYNXb06AC6syNeeLuB02tA//5MRCyQntd3aIEolVA==","mode":420,"size":1080},"index.js":{"checkedAt":1678883671537,"integrity":"sha512-J6EZGLCLXvPtKrO7rOMzLsEn+9ZeJOZ4r+rJCLqu72AnL6lhG6zVbbGvTOSMHYSEIP1y2NNk4jGvVXCkBOeJIg==","mode":420,"size":1429},"package.json":{"checkedAt":1678883671537,"integrity":"sha512-uIfuWhKnkNHwJDkma43VdBpRexeX2NDO/0+j6WD9kxwZys8uPW8XlM8iXlnZVrCBrFJsBQknRpmqgfFlRjqrlQ==","mode":420,"size":2245},"CHANGELOG.md":{"checkedAt":1678883671537,"integrity":"sha512-zl37GBdFF96B9IktAgWqsFw3eX/kIUDgF1eoTeDmp6rAI93sCTmQO/Le2Xj7StCCy23ahgSCNkwMhYF/NuaKEw==","mode":420,"size":3637},"README.md":{"checkedAt":1678883671540,"integrity":"sha512-+4bqGkHBxDcHZcG5xB1R170b3hP6FtApf8h/9FqMjgzGcwGx8CcwCCg2SBAsQHSSumEcYEeaZiWDl/dAM5YmVg==","mode":420,"size":2824},".github/FUNDING.yml":{"checkedAt":1678883671540,"integrity":"sha512-qOFCuF81Gc8NSgcE03VXT8ZjWVk5txsMJKrzJTZaqr+/sc8JUh9V30+kXhee0sRDC/NP0bL6vtkAnMKqDKV3jw==","mode":420,"size":588}}}
|
||||
Reference in New Issue
Block a user