new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { SchedulerLike } from '../types';
|
||||
export declare function scheduleArray<T>(input: ArrayLike<T>, scheduler: SchedulerLike): Observable<T>;
|
||||
//# sourceMappingURL=scheduleArray.d.ts.map
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "caniuse-lite",
|
||||
"version": "1.0.30001466",
|
||||
"description": "A smaller version of caniuse-db, with only the essentials!",
|
||||
"main": "dist/unpacker/index.js",
|
||||
"files": [
|
||||
"data",
|
||||
"dist"
|
||||
],
|
||||
"keywords": [
|
||||
"support"
|
||||
],
|
||||
"author": {
|
||||
"name": "Ben Briggs",
|
||||
"email": "beneb.info@gmail.com",
|
||||
"url": "http://beneb.info"
|
||||
},
|
||||
"repository": "browserslist/caniuse-lite",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/browserslist"
|
||||
},
|
||||
{
|
||||
"type": "tidelift",
|
||||
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
|
||||
}
|
||||
],
|
||||
"license": "CC-BY-4.0"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export type RunnerNotFoundError = {
|
||||
name: string;
|
||||
message: string;
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2012-2019 Paul Miller (https://paulmillr.com), Elan Shanker
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the “Software”), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
|
||||
import Matcher from './matcher';
|
||||
export default class PartialMatcher extends Matcher {
|
||||
match(filepath: string): boolean;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
var eq = require('./eq');
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Used by `_.defaults` to customize its `_.assignIn` use to assign properties
|
||||
* of source objects to the destination object for all destination properties
|
||||
* that resolve to `undefined`.
|
||||
*
|
||||
* @private
|
||||
* @param {*} objValue The destination value.
|
||||
* @param {*} srcValue The source value.
|
||||
* @param {string} key The key of the property to assign.
|
||||
* @param {Object} object The parent object of `objValue`.
|
||||
* @returns {*} Returns the value to assign.
|
||||
*/
|
||||
function customDefaultsAssignIn(objValue, srcValue, key, object) {
|
||||
if (objValue === undefined ||
|
||||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
|
||||
return srcValue;
|
||||
}
|
||||
return objValue;
|
||||
}
|
||||
|
||||
module.exports = customDefaultsAssignIn;
|
||||
@@ -0,0 +1,182 @@
|
||||
/* eslint no-eq-null: 0, eqeqeq: 0, no-unused-vars: 0 */
|
||||
|
||||
"use strict";
|
||||
|
||||
var customError = require("es5-ext/error/custom")
|
||||
, defineLength = require("es5-ext/function/_define-length")
|
||||
, d = require("d")
|
||||
, ee = require("event-emitter").methods
|
||||
, resolveResolve = require("./resolve-resolve")
|
||||
, resolveNormalize = require("./resolve-normalize");
|
||||
|
||||
var apply = Function.prototype.apply
|
||||
, call = Function.prototype.call
|
||||
, create = Object.create
|
||||
, defineProperties = Object.defineProperties
|
||||
, on = ee.on
|
||||
, emit = ee.emit;
|
||||
|
||||
module.exports = function (original, length, options) {
|
||||
var cache = create(null)
|
||||
, conf
|
||||
, memLength
|
||||
, get
|
||||
, set
|
||||
, del
|
||||
, clear
|
||||
, extDel
|
||||
, extGet
|
||||
, extHas
|
||||
, normalizer
|
||||
, getListeners
|
||||
, setListeners
|
||||
, deleteListeners
|
||||
, memoized
|
||||
, resolve;
|
||||
if (length !== false) memLength = length;
|
||||
else if (isNaN(original.length)) memLength = 1;
|
||||
else memLength = original.length;
|
||||
|
||||
if (options.normalizer) {
|
||||
normalizer = resolveNormalize(options.normalizer);
|
||||
get = normalizer.get;
|
||||
set = normalizer.set;
|
||||
del = normalizer.delete;
|
||||
clear = normalizer.clear;
|
||||
}
|
||||
if (options.resolvers != null) resolve = resolveResolve(options.resolvers);
|
||||
|
||||
if (get) {
|
||||
memoized = defineLength(function (arg) {
|
||||
var id, result, args = arguments;
|
||||
if (resolve) args = resolve(args);
|
||||
id = get(args);
|
||||
if (id !== null) {
|
||||
if (hasOwnProperty.call(cache, id)) {
|
||||
if (getListeners) conf.emit("get", id, args, this);
|
||||
return cache[id];
|
||||
}
|
||||
}
|
||||
if (args.length === 1) result = call.call(original, this, args[0]);
|
||||
else result = apply.call(original, this, args);
|
||||
if (id === null) {
|
||||
id = get(args);
|
||||
if (id !== null) throw customError("Circular invocation", "CIRCULAR_INVOCATION");
|
||||
id = set(args);
|
||||
} else if (hasOwnProperty.call(cache, id)) {
|
||||
throw customError("Circular invocation", "CIRCULAR_INVOCATION");
|
||||
}
|
||||
cache[id] = result;
|
||||
if (setListeners) conf.emit("set", id, null, result);
|
||||
return result;
|
||||
}, memLength);
|
||||
} else if (length === 0) {
|
||||
memoized = function () {
|
||||
var result;
|
||||
if (hasOwnProperty.call(cache, "data")) {
|
||||
if (getListeners) conf.emit("get", "data", arguments, this);
|
||||
return cache.data;
|
||||
}
|
||||
if (arguments.length) result = apply.call(original, this, arguments);
|
||||
else result = call.call(original, this);
|
||||
if (hasOwnProperty.call(cache, "data")) {
|
||||
throw customError("Circular invocation", "CIRCULAR_INVOCATION");
|
||||
}
|
||||
cache.data = result;
|
||||
if (setListeners) conf.emit("set", "data", null, result);
|
||||
return result;
|
||||
};
|
||||
} else {
|
||||
memoized = function (arg) {
|
||||
var result, args = arguments, id;
|
||||
if (resolve) args = resolve(arguments);
|
||||
id = String(args[0]);
|
||||
if (hasOwnProperty.call(cache, id)) {
|
||||
if (getListeners) conf.emit("get", id, args, this);
|
||||
return cache[id];
|
||||
}
|
||||
if (args.length === 1) result = call.call(original, this, args[0]);
|
||||
else result = apply.call(original, this, args);
|
||||
if (hasOwnProperty.call(cache, id)) {
|
||||
throw customError("Circular invocation", "CIRCULAR_INVOCATION");
|
||||
}
|
||||
cache[id] = result;
|
||||
if (setListeners) conf.emit("set", id, null, result);
|
||||
return result;
|
||||
};
|
||||
}
|
||||
conf = {
|
||||
original: original,
|
||||
memoized: memoized,
|
||||
profileName: options.profileName,
|
||||
get: function (args) {
|
||||
if (resolve) args = resolve(args);
|
||||
if (get) return get(args);
|
||||
return String(args[0]);
|
||||
},
|
||||
has: function (id) { return hasOwnProperty.call(cache, id); },
|
||||
delete: function (id) {
|
||||
var result;
|
||||
if (!hasOwnProperty.call(cache, id)) return;
|
||||
if (del) del(id);
|
||||
result = cache[id];
|
||||
delete cache[id];
|
||||
if (deleteListeners) conf.emit("delete", id, result);
|
||||
},
|
||||
clear: function () {
|
||||
var oldCache = cache;
|
||||
if (clear) clear();
|
||||
cache = create(null);
|
||||
conf.emit("clear", oldCache);
|
||||
},
|
||||
on: function (type, listener) {
|
||||
if (type === "get") getListeners = true;
|
||||
else if (type === "set") setListeners = true;
|
||||
else if (type === "delete") deleteListeners = true;
|
||||
return on.call(this, type, listener);
|
||||
},
|
||||
emit: emit,
|
||||
updateEnv: function () { original = conf.original; }
|
||||
};
|
||||
if (get) {
|
||||
extDel = defineLength(function (arg) {
|
||||
var id, args = arguments;
|
||||
if (resolve) args = resolve(args);
|
||||
id = get(args);
|
||||
if (id === null) return;
|
||||
conf.delete(id);
|
||||
}, memLength);
|
||||
} else if (length === 0) {
|
||||
extDel = function () { return conf.delete("data"); };
|
||||
} else {
|
||||
extDel = function (arg) {
|
||||
if (resolve) arg = resolve(arguments)[0];
|
||||
return conf.delete(arg);
|
||||
};
|
||||
}
|
||||
extGet = defineLength(function () {
|
||||
var id, args = arguments;
|
||||
if (length === 0) return cache.data;
|
||||
if (resolve) args = resolve(args);
|
||||
if (get) id = get(args);
|
||||
else id = String(args[0]);
|
||||
return cache[id];
|
||||
});
|
||||
extHas = defineLength(function () {
|
||||
var id, args = arguments;
|
||||
if (length === 0) return conf.has("data");
|
||||
if (resolve) args = resolve(args);
|
||||
if (get) id = get(args);
|
||||
else id = String(args[0]);
|
||||
if (id === null) return false;
|
||||
return conf.has(id);
|
||||
});
|
||||
defineProperties(memoized, {
|
||||
__memoized__: d(true),
|
||||
delete: d(extDel),
|
||||
clear: d(conf.clear),
|
||||
_get: d(extGet),
|
||||
_has: d(extHas)
|
||||
});
|
||||
return conf;
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isFullWidth;
|
||||
exports.fullWidth = void 0;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var fullWidth = /[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;
|
||||
exports.fullWidth = fullWidth;
|
||||
|
||||
function isFullWidth(str) {
|
||||
(0, _assertString.default)(str);
|
||||
return fullWidth.test(str);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
# fs.realpath
|
||||
|
||||
A backwards-compatible fs.realpath for Node v6 and above
|
||||
|
||||
In Node v6, the JavaScript implementation of fs.realpath was replaced
|
||||
with a faster (but less resilient) native implementation. That raises
|
||||
new and platform-specific errors and cannot handle long or excessively
|
||||
symlink-looping paths.
|
||||
|
||||
This module handles those cases by detecting the new errors and
|
||||
falling back to the JavaScript implementation. On versions of Node
|
||||
prior to v6, it has no effect.
|
||||
|
||||
## USAGE
|
||||
|
||||
```js
|
||||
var rp = require('fs.realpath')
|
||||
|
||||
// async version
|
||||
rp.realpath(someLongAndLoopingPath, function (er, real) {
|
||||
// the ELOOP was handled, but it was a bit slower
|
||||
})
|
||||
|
||||
// sync version
|
||||
var real = rp.realpathSync(someLongAndLoopingPath)
|
||||
|
||||
// monkeypatch at your own risk!
|
||||
// This replaces the fs.realpath/fs.realpathSync builtins
|
||||
rp.monkeypatch()
|
||||
|
||||
// un-do the monkeypatching
|
||||
rp.unmonkeypatch()
|
||||
```
|
||||
@@ -0,0 +1,88 @@
|
||||
let Declaration = require('../declaration')
|
||||
|
||||
class MaskComposite extends Declaration {
|
||||
/**
|
||||
* Prefix mask-composite for webkit
|
||||
*/
|
||||
insert(decl, prefix, prefixes) {
|
||||
let isCompositeProp = decl.prop === 'mask-composite'
|
||||
|
||||
let compositeValues
|
||||
|
||||
if (isCompositeProp) {
|
||||
compositeValues = decl.value.split(',')
|
||||
} else {
|
||||
compositeValues = decl.value.match(MaskComposite.regexp) || []
|
||||
}
|
||||
|
||||
compositeValues = compositeValues.map(el => el.trim()).filter(el => el)
|
||||
let hasCompositeValues = compositeValues.length
|
||||
|
||||
let compositeDecl
|
||||
|
||||
if (hasCompositeValues) {
|
||||
compositeDecl = this.clone(decl)
|
||||
compositeDecl.value = compositeValues
|
||||
.map(value => MaskComposite.oldValues[value] || value)
|
||||
.join(', ')
|
||||
|
||||
if (compositeValues.includes('intersect')) {
|
||||
compositeDecl.value += ', xor'
|
||||
}
|
||||
|
||||
compositeDecl.prop = prefix + 'mask-composite'
|
||||
}
|
||||
|
||||
if (isCompositeProp) {
|
||||
if (!hasCompositeValues) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
if (this.needCascade(decl)) {
|
||||
compositeDecl.raws.before = this.calcBefore(prefixes, decl, prefix)
|
||||
}
|
||||
|
||||
return decl.parent.insertBefore(decl, compositeDecl)
|
||||
}
|
||||
|
||||
let cloned = this.clone(decl)
|
||||
cloned.prop = prefix + cloned.prop
|
||||
|
||||
if (hasCompositeValues) {
|
||||
cloned.value = cloned.value.replace(MaskComposite.regexp, '')
|
||||
}
|
||||
|
||||
if (this.needCascade(decl)) {
|
||||
cloned.raws.before = this.calcBefore(prefixes, decl, prefix)
|
||||
}
|
||||
|
||||
decl.parent.insertBefore(decl, cloned)
|
||||
|
||||
if (!hasCompositeValues) {
|
||||
return decl
|
||||
}
|
||||
|
||||
if (this.needCascade(decl)) {
|
||||
compositeDecl.raws.before = this.calcBefore(prefixes, decl, prefix)
|
||||
}
|
||||
return decl.parent.insertBefore(decl, compositeDecl)
|
||||
}
|
||||
}
|
||||
|
||||
MaskComposite.names = ['mask', 'mask-composite']
|
||||
|
||||
MaskComposite.oldValues = {
|
||||
add: 'source-over',
|
||||
subtract: 'source-out',
|
||||
intersect: 'source-in',
|
||||
exclude: 'xor'
|
||||
}
|
||||
|
||||
MaskComposite.regexp = new RegExp(
|
||||
`\\s+(${Object.keys(MaskComposite.oldValues).join(
|
||||
'|'
|
||||
)})\\b(?!\\))\\s*(?=[,])`,
|
||||
'ig'
|
||||
)
|
||||
|
||||
module.exports = MaskComposite
|
||||
@@ -0,0 +1,48 @@
|
||||
'use strict';
|
||||
|
||||
var ee = require('../');
|
||||
|
||||
module.exports = function (t, a) {
|
||||
var x, count, count2;
|
||||
|
||||
x = ee();
|
||||
count = 0;
|
||||
count2 = 0;
|
||||
x.on('foo', function () {
|
||||
++count;
|
||||
});
|
||||
x.on('foo', function () {
|
||||
++count;
|
||||
});
|
||||
x.on('bar', function () {
|
||||
++count2;
|
||||
});
|
||||
x.on('bar', function () {
|
||||
++count2;
|
||||
});
|
||||
t(x, 'foo');
|
||||
x.emit('foo');
|
||||
x.emit('bar');
|
||||
a(count, 0, "All off: type");
|
||||
a(count2, 2, "All off: ohter type");
|
||||
|
||||
count = 0;
|
||||
count2 = 0;
|
||||
x.on('foo', function () {
|
||||
++count;
|
||||
});
|
||||
x.on('foo', function () {
|
||||
++count;
|
||||
});
|
||||
x.on('bar', function () {
|
||||
++count2;
|
||||
});
|
||||
x.on('bar', function () {
|
||||
++count2;
|
||||
});
|
||||
t(x);
|
||||
x.emit('foo');
|
||||
x.emit('bar');
|
||||
a(count, 0, "All off: type");
|
||||
a(count2, 0, "All off: other type");
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"proxy-agent","version":"5.0.0","files":{"index.js":{"checkedAt":1678883671904,"integrity":"sha512-fkJ0DxB8Ck1QzZosM35ewef3XlXU3WM0YfJIHCMkVVm2nsRcTFM+1RqFxQ//xYCZsflSVhx/jwcHgW85GdhkdQ==","mode":420,"size":4917},"package.json":{"checkedAt":1678883671909,"integrity":"sha512-meme2+g2zP4OLufZIB4FM7o3/vCz+vQD0LtMI+SyOmKAULk5wPwxhKuM+aC5/4wGuAt+zXAnnQkJquoHxME41g==","mode":420,"size":1129},"test/ssl-cert-snakeoil.key":{"checkedAt":1678883671909,"integrity":"sha512-8ExBddThPuCxvsHuw/yf9su5k3y4VNap/pBre+nOlUN0WifkQHIT3IgO4Dgo3/dXzHbTkbPLCeQcBQfTihchhw==","mode":420,"size":887},"History.md":{"checkedAt":1678883671909,"integrity":"sha512-JqKQCgwgFSUblnqjqKwI7K0N3xdNsTtageLRp756BNILiWtH5P2mCouQgG5NWEo8rK9YLJbbAlTceVY+ijTD2Q==","mode":420,"size":2004},"test/ssl-cert-snakeoil.pem":{"checkedAt":1678883671909,"integrity":"sha512-nzQFk7inrsWXYoEr9AFzTg0qQT+4QUoWQ6X3t1AKuVUXrJnYvjL3gzFYHslzBVd0kd3NTGl8chdwwIJK4+z49w==","mode":420,"size":696},"index.d.ts":{"checkedAt":1678883671909,"integrity":"sha512-hqqFnYV2eJ2sqfgIDCj/IJMv4WRbspjcIDsa6/iUBWXtNtHzYoqqxUi1eIXdoads/GCLNXmOdT1eKsA3y7/RHQ==","mode":420,"size":352},"test/test.js":{"checkedAt":1678883671909,"integrity":"sha512-ZQpq651URfGXeQC86DQ4TOFI+bKWtd4pcVh0lxqm9jA+GXSCTeq4OG8LkPv3EUfedeg2W/m07PI2jjjrfW68OQ==","mode":420,"size":10328},".github/workflows/test.yml":{"checkedAt":1678883671909,"integrity":"sha512-hPSB/D7bLo0UGE1G3Z0UT7d6hPiw80VIxLgMsByhf56VWx4I9tLzshQiWZCFIiHq46Big54HLIkcsHAVZdVBIQ==","mode":420,"size":845},"README.md":{"checkedAt":1678883671909,"integrity":"sha512-7gSlSIblRk+JUsoO1VvIoxlH1nC7xvV0BLIkQU4pv22SK5sVoshVLUmirb/wook4E8tkVxu7ykhfNXomUtyjTg==","mode":420,"size":4164}}}
|
||||
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function (t, a) {
|
||||
a(typeof t, "boolean");
|
||||
};
|
||||
@@ -0,0 +1,52 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.output = exports.exists = exports.hash = exports.bytes = exports.bool = exports.number = void 0;
|
||||
function number(n) {
|
||||
if (!Number.isSafeInteger(n) || n < 0)
|
||||
throw new Error(`Wrong positive integer: ${n}`);
|
||||
}
|
||||
exports.number = number;
|
||||
function bool(b) {
|
||||
if (typeof b !== 'boolean')
|
||||
throw new Error(`Expected boolean, not ${b}`);
|
||||
}
|
||||
exports.bool = bool;
|
||||
function bytes(b, ...lengths) {
|
||||
if (!(b instanceof Uint8Array))
|
||||
throw new TypeError('Expected Uint8Array');
|
||||
if (lengths.length > 0 && !lengths.includes(b.length))
|
||||
throw new TypeError(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);
|
||||
}
|
||||
exports.bytes = bytes;
|
||||
function hash(hash) {
|
||||
if (typeof hash !== 'function' || typeof hash.create !== 'function')
|
||||
throw new Error('Hash should be wrapped by utils.wrapConstructor');
|
||||
number(hash.outputLen);
|
||||
number(hash.blockLen);
|
||||
}
|
||||
exports.hash = hash;
|
||||
function exists(instance, checkFinished = true) {
|
||||
if (instance.destroyed)
|
||||
throw new Error('Hash instance has been destroyed');
|
||||
if (checkFinished && instance.finished)
|
||||
throw new Error('Hash#digest() has already been called');
|
||||
}
|
||||
exports.exists = exists;
|
||||
function output(out, instance) {
|
||||
bytes(out);
|
||||
const min = instance.outputLen;
|
||||
if (out.length < min) {
|
||||
throw new Error(`digestInto() expects output buffer of length at least ${min}`);
|
||||
}
|
||||
}
|
||||
exports.output = output;
|
||||
const assert = {
|
||||
number,
|
||||
bool,
|
||||
bytes,
|
||||
hash,
|
||||
exists,
|
||||
output,
|
||||
};
|
||||
exports.default = assert;
|
||||
//# sourceMappingURL=_assert.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AsyncScheduler = void 0;
|
||||
var Scheduler_1 = require("../Scheduler");
|
||||
var AsyncScheduler = (function (_super) {
|
||||
__extends(AsyncScheduler, _super);
|
||||
function AsyncScheduler(SchedulerAction, now) {
|
||||
if (now === void 0) { now = Scheduler_1.Scheduler.now; }
|
||||
var _this = _super.call(this, SchedulerAction, now) || this;
|
||||
_this.actions = [];
|
||||
_this._active = false;
|
||||
return _this;
|
||||
}
|
||||
AsyncScheduler.prototype.flush = function (action) {
|
||||
var actions = this.actions;
|
||||
if (this._active) {
|
||||
actions.push(action);
|
||||
return;
|
||||
}
|
||||
var error;
|
||||
this._active = true;
|
||||
do {
|
||||
if ((error = action.execute(action.state, action.delay))) {
|
||||
break;
|
||||
}
|
||||
} while ((action = actions.shift()));
|
||||
this._active = false;
|
||||
if (error) {
|
||||
while ((action = actions.shift())) {
|
||||
action.unsubscribe();
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
return AsyncScheduler;
|
||||
}(Scheduler_1.Scheduler));
|
||||
exports.AsyncScheduler = AsyncScheduler;
|
||||
//# sourceMappingURL=AsyncScheduler.js.map
|
||||
@@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var forEach = require('for-each');
|
||||
var v = require('es-value-fixtures');
|
||||
var inspect = require('object-inspect');
|
||||
|
||||
var byteLength = require('../');
|
||||
|
||||
test('byteLength', function (t) {
|
||||
forEach(v.objects.concat(v.primitives), function (nonAB) {
|
||||
t.equal(byteLength(nonAB), NaN, inspect(nonAB) + ' is not an ArrayBuffer, and yields NaN');
|
||||
});
|
||||
|
||||
t.test('ArrayBuffers', { skip: typeof ArrayBuffer !== 'function' }, function (st) {
|
||||
var ab32 = new ArrayBuffer(32);
|
||||
st.equal(byteLength(ab32), 32, 'works on an ArrayBuffer of length 32: ' + inspect(ab32));
|
||||
|
||||
var ab0 = new ArrayBuffer(0);
|
||||
st.equal(byteLength(ab0), 0, 'works on an ArrayBuffer of length 0: ' + inspect(ab0));
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0.04384,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.04384,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0.01879,"102":0.00626,"103":0,"104":0.00626,"105":0,"106":0,"107":0,"108":0.06263,"109":2.49267,"110":1.40918,"111":0,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.02505,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0.01879,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0.01879,"68":0.00626,"69":0.00626,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0.04384,"77":0,"78":0,"79":0.10647,"80":0,"81":0,"83":0,"84":0.00626,"85":0.00626,"86":0.00626,"87":0.01879,"88":0,"89":0,"90":0,"91":0,"92":0.01253,"93":0,"94":0,"95":0,"96":0.00626,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.01253,"103":0.0501,"104":0.00626,"105":0.11273,"106":0.00626,"107":0.10021,"108":0.36325,"109":11.36735,"110":9.41329,"111":0,"112":0,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0.00626,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.08142,"94":1.17744,"95":0.28184,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0.00626,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0.00626,"105":0,"106":0,"107":0,"108":0.03132,"109":2.69309,"110":3.48849},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.03132,"14":0.72025,"15":0.00626,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0.03758,"13.1":0.15031,"14.1":1.1336,"15.1":0.00626,"15.2-15.3":0.06263,"15.4":0.03132,"15.5":0.10021,"15.6":0.48851,"16.0":0.119,"16.1":0.06263,"16.2":0.76409,"16.3":0.48851,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0,"8.1-8.4":0,"9.0-9.2":0.02738,"9.3":0.07483,"10.0-10.2":0.0073,"10.3":0.49827,"11.0-11.2":0,"11.3-11.4":0.01095,"12.0-12.1":0.04745,"12.2-12.5":2.43475,"13.0-13.1":0.02738,"13.2":0.00365,"13.3":0.02738,"13.4-13.7":0.08761,"14.0-14.4":0.14784,"14.5-14.8":0.68991,"15.0-15.1":0.12229,"15.2-15.3":0.11681,"15.4":0.28107,"15.5":0.40883,"15.6":1.38712,"16.0":0.68078,"16.1":3.34915,"16.2":3.44589,"16.3":1.61526,"16.4":0.02373},P:{"4":0.20107,"20":1.50275,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0,"12.0":0.01058,"13.0":0,"14.0":0,"15.0":0,"16.0":0.05291,"17.0":0,"18.0":0.84662,"19.0":2.23296},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.02626},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.01253,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.02616},H:{"0":0.1309},L:{"0":35.84057},R:{_:"0"},M:{"0":2.50379},Q:{"13.1":0}};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = require('../plugin.js')
|
||||
@@ -0,0 +1,19 @@
|
||||
import { mergeAll } from '../operators/mergeAll';
|
||||
import { innerFrom } from './innerFrom';
|
||||
import { EMPTY } from './empty';
|
||||
import { popNumber, popScheduler } from '../util/args';
|
||||
import { from } from './from';
|
||||
export function merge(...args) {
|
||||
const scheduler = popScheduler(args);
|
||||
const concurrent = popNumber(args, Infinity);
|
||||
const sources = args;
|
||||
return !sources.length
|
||||
?
|
||||
EMPTY
|
||||
: sources.length === 1
|
||||
?
|
||||
innerFrom(sources[0])
|
||||
:
|
||||
mergeAll(concurrent)(from(sources, scheduler));
|
||||
}
|
||||
//# sourceMappingURL=merge.js.map
|
||||
@@ -0,0 +1,156 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isPassportNumber;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Reference:
|
||||
* https://en.wikipedia.org/ -- Wikipedia
|
||||
* https://docs.microsoft.com/en-us/microsoft-365/compliance/eu-passport-number -- EU Passport Number
|
||||
* https://countrycode.org/ -- Country Codes
|
||||
*/
|
||||
var passportRegexByCountryCode = {
|
||||
AM: /^[A-Z]{2}\d{7}$/,
|
||||
// ARMENIA
|
||||
AR: /^[A-Z]{3}\d{6}$/,
|
||||
// ARGENTINA
|
||||
AT: /^[A-Z]\d{7}$/,
|
||||
// AUSTRIA
|
||||
AU: /^[A-Z]\d{7}$/,
|
||||
// AUSTRALIA
|
||||
AZ: /^[A-Z]{2,3}\d{7,8}$/,
|
||||
// AZERBAIJAN
|
||||
BE: /^[A-Z]{2}\d{6}$/,
|
||||
// BELGIUM
|
||||
BG: /^\d{9}$/,
|
||||
// BULGARIA
|
||||
BR: /^[A-Z]{2}\d{6}$/,
|
||||
// BRAZIL
|
||||
BY: /^[A-Z]{2}\d{7}$/,
|
||||
// BELARUS
|
||||
CA: /^[A-Z]{2}\d{6}$/,
|
||||
// CANADA
|
||||
CH: /^[A-Z]\d{7}$/,
|
||||
// SWITZERLAND
|
||||
CN: /^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/,
|
||||
// CHINA [G=Ordinary, E=Electronic] followed by 8-digits, or E followed by any UPPERCASE letter (except I and O) followed by 7 digits
|
||||
CY: /^[A-Z](\d{6}|\d{8})$/,
|
||||
// CYPRUS
|
||||
CZ: /^\d{8}$/,
|
||||
// CZECH REPUBLIC
|
||||
DE: /^[CFGHJKLMNPRTVWXYZ0-9]{9}$/,
|
||||
// GERMANY
|
||||
DK: /^\d{9}$/,
|
||||
// DENMARK
|
||||
DZ: /^\d{9}$/,
|
||||
// ALGERIA
|
||||
EE: /^([A-Z]\d{7}|[A-Z]{2}\d{7})$/,
|
||||
// ESTONIA (K followed by 7-digits), e-passports have 2 UPPERCASE followed by 7 digits
|
||||
ES: /^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/,
|
||||
// SPAIN
|
||||
FI: /^[A-Z]{2}\d{7}$/,
|
||||
// FINLAND
|
||||
FR: /^\d{2}[A-Z]{2}\d{5}$/,
|
||||
// FRANCE
|
||||
GB: /^\d{9}$/,
|
||||
// UNITED KINGDOM
|
||||
GR: /^[A-Z]{2}\d{7}$/,
|
||||
// GREECE
|
||||
HR: /^\d{9}$/,
|
||||
// CROATIA
|
||||
HU: /^[A-Z]{2}(\d{6}|\d{7})$/,
|
||||
// HUNGARY
|
||||
IE: /^[A-Z0-9]{2}\d{7}$/,
|
||||
// IRELAND
|
||||
IN: /^[A-Z]{1}-?\d{7}$/,
|
||||
// INDIA
|
||||
ID: /^[A-C]\d{7}$/,
|
||||
// INDONESIA
|
||||
IR: /^[A-Z]\d{8}$/,
|
||||
// IRAN
|
||||
IS: /^(A)\d{7}$/,
|
||||
// ICELAND
|
||||
IT: /^[A-Z0-9]{2}\d{7}$/,
|
||||
// ITALY
|
||||
JM: /^[Aa]\d{7}$/,
|
||||
// JAMAICA
|
||||
JP: /^[A-Z]{2}\d{7}$/,
|
||||
// JAPAN
|
||||
KR: /^[MS]\d{8}$/,
|
||||
// SOUTH KOREA, REPUBLIC OF KOREA, [S=PS Passports, M=PM Passports]
|
||||
KZ: /^[a-zA-Z]\d{7}$/,
|
||||
// KAZAKHSTAN
|
||||
LI: /^[a-zA-Z]\d{5}$/,
|
||||
// LIECHTENSTEIN
|
||||
LT: /^[A-Z0-9]{8}$/,
|
||||
// LITHUANIA
|
||||
LU: /^[A-Z0-9]{8}$/,
|
||||
// LUXEMBURG
|
||||
LV: /^[A-Z0-9]{2}\d{7}$/,
|
||||
// LATVIA
|
||||
LY: /^[A-Z0-9]{8}$/,
|
||||
// LIBYA
|
||||
MT: /^\d{7}$/,
|
||||
// MALTA
|
||||
MZ: /^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/,
|
||||
// MOZAMBIQUE
|
||||
MY: /^[AHK]\d{8}$/,
|
||||
// MALAYSIA
|
||||
MX: /^\d{10,11}$/,
|
||||
// MEXICO
|
||||
NL: /^[A-Z]{2}[A-Z0-9]{6}\d$/,
|
||||
// NETHERLANDS
|
||||
NZ: /^([Ll]([Aa]|[Dd]|[Ff]|[Hh])|[Ee]([Aa]|[Pp])|[Nn])\d{6}$/,
|
||||
// NEW ZEALAND
|
||||
PH: /^([A-Z](\d{6}|\d{7}[A-Z]))|([A-Z]{2}(\d{6}|\d{7}))$/,
|
||||
// PHILIPPINES
|
||||
PK: /^[A-Z]{2}\d{7}$/,
|
||||
// PAKISTAN
|
||||
PL: /^[A-Z]{2}\d{7}$/,
|
||||
// POLAND
|
||||
PT: /^[A-Z]\d{6}$/,
|
||||
// PORTUGAL
|
||||
RO: /^\d{8,9}$/,
|
||||
// ROMANIA
|
||||
RU: /^\d{9}$/,
|
||||
// RUSSIAN FEDERATION
|
||||
SE: /^\d{8}$/,
|
||||
// SWEDEN
|
||||
SL: /^(P)[A-Z]\d{7}$/,
|
||||
// SLOVENIA
|
||||
SK: /^[0-9A-Z]\d{7}$/,
|
||||
// SLOVAKIA
|
||||
TH: /^[A-Z]{1,2}\d{6,7}$/,
|
||||
// THAILAND
|
||||
TR: /^[A-Z]\d{8}$/,
|
||||
// TURKEY
|
||||
UA: /^[A-Z]{2}\d{6}$/,
|
||||
// UKRAINE
|
||||
US: /^\d{9}$/ // UNITED STATES
|
||||
|
||||
};
|
||||
/**
|
||||
* Check if str is a valid passport number
|
||||
* relative to provided ISO Country Code.
|
||||
*
|
||||
* @param {string} str
|
||||
* @param {string} countryCode
|
||||
* @return {boolean}
|
||||
*/
|
||||
|
||||
function isPassportNumber(str, countryCode) {
|
||||
(0, _assertString.default)(str);
|
||||
/** Remove All Whitespaces, Convert to UPPERCASE */
|
||||
|
||||
var normalizedStr = str.replace(/\s/g, '').toUpperCase();
|
||||
return countryCode.toUpperCase() in passportRegexByCountryCode && passportRegexByCountryCode[countryCode].test(normalizedStr);
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1,66 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
var $SyntaxError = GetIntrinsic('%SyntaxError%');
|
||||
var $asyncIterator = GetIntrinsic('%Symbol.asyncIterator%', true);
|
||||
|
||||
var inspect = require('object-inspect');
|
||||
var hasSymbols = require('has-symbols')();
|
||||
|
||||
var getIteratorMethod = require('../helpers/getIteratorMethod');
|
||||
var AdvanceStringIndex = require('./AdvanceStringIndex');
|
||||
var Call = require('./Call');
|
||||
var GetMethod = require('./GetMethod');
|
||||
var IsArray = require('./IsArray');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://262.ecma-international.org/11.0/#sec-getiterator
|
||||
|
||||
module.exports = function GetIterator(obj, hint, method) {
|
||||
var actualHint = hint;
|
||||
if (arguments.length < 2) {
|
||||
actualHint = 'sync';
|
||||
}
|
||||
if (actualHint !== 'sync' && actualHint !== 'async') {
|
||||
throw new $TypeError("Assertion failed: `hint` must be one of 'sync' or 'async', got " + inspect(hint));
|
||||
}
|
||||
|
||||
var actualMethod = method;
|
||||
if (arguments.length < 3) {
|
||||
if (actualHint === 'async') {
|
||||
if (hasSymbols && $asyncIterator) {
|
||||
actualMethod = GetMethod(obj, $asyncIterator);
|
||||
}
|
||||
if (actualMethod === undefined) {
|
||||
throw new $SyntaxError("async from sync iterators aren't currently supported");
|
||||
}
|
||||
} else {
|
||||
actualMethod = getIteratorMethod(
|
||||
{
|
||||
AdvanceStringIndex: AdvanceStringIndex,
|
||||
GetMethod: GetMethod,
|
||||
IsArray: IsArray
|
||||
},
|
||||
obj
|
||||
);
|
||||
}
|
||||
}
|
||||
var iterator = Call(actualMethod, obj);
|
||||
if (Type(iterator) !== 'Object') {
|
||||
throw new $TypeError('iterator must return an object');
|
||||
}
|
||||
|
||||
return iterator;
|
||||
|
||||
// TODO: This should return an IteratorRecord
|
||||
/*
|
||||
var nextMethod = GetV(iterator, 'next');
|
||||
return {
|
||||
'[[Iterator]]': iterator,
|
||||
'[[NextMethod]]': nextMethod,
|
||||
'[[Done]]': false
|
||||
};
|
||||
*/
|
||||
};
|
||||
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"name": "@vincjo/datatables",
|
||||
"version": "1.4.0",
|
||||
"keywords": [
|
||||
"svelte sveltejs table tables datatable datatables"
|
||||
],
|
||||
"description": "A toolkit for creating datatable components with Svelte",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vincjo/datatables.git"
|
||||
},
|
||||
"author": "vincjo",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vincjo/datatables/issues"
|
||||
},
|
||||
"homepage": "https://vincjo.fr/datatables",
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-node": "^1.0.0-next.100",
|
||||
"@sveltejs/kit": "next",
|
||||
"@sveltejs/package": "next",
|
||||
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
||||
"@typescript-eslint/parser": "^5.27.0",
|
||||
"eslint": "^8.16.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-svelte3": "^4.0.0",
|
||||
"gros": "^0.16.1",
|
||||
"mdsvex": "^0.10.6",
|
||||
"prettier": "^2.6.2",
|
||||
"prettier-plugin-svelte": "^2.7.0",
|
||||
"prism-svelte": "^0.5.0",
|
||||
"svelte": "^3.44.0",
|
||||
"svelte-check": "^2.7.1",
|
||||
"svelte-preprocess": "^4.10.6",
|
||||
"tslib": "^2.3.1",
|
||||
"typescript": "^4.7.4",
|
||||
"vite": "^4.0.0"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
"./core/Context": "./core/Context.js",
|
||||
"./core/Handlers/Filters": "./core/Handlers/Filters.js",
|
||||
"./core/Handlers/GlobalSearch": "./core/Handlers/GlobalSearch.js",
|
||||
"./core/Handlers/Pages": "./core/Handlers/Pages.js",
|
||||
"./core/Handlers/Rows": "./core/Handlers/Rows.js",
|
||||
"./core": "./core/index.js",
|
||||
"./DataHandler": "./DataHandler.js",
|
||||
"./Datatable.svelte": "./Datatable.svelte",
|
||||
".": "./index.js",
|
||||
"./Pagination.svelte": "./Pagination.svelte",
|
||||
"./RowCount.svelte": "./RowCount.svelte",
|
||||
"./RowsPerPage.svelte": "./RowsPerPage.svelte",
|
||||
"./Search.svelte": "./Search.svelte",
|
||||
"./Th.svelte": "./Th.svelte",
|
||||
"./ThFilter.svelte": "./ThFilter.svelte"
|
||||
},
|
||||
"svelte": "./index.js"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.concatMap = void 0;
|
||||
var mergeMap_1 = require("./mergeMap");
|
||||
var isFunction_1 = require("../util/isFunction");
|
||||
function concatMap(project, resultSelector) {
|
||||
return isFunction_1.isFunction(resultSelector) ? mergeMap_1.mergeMap(project, resultSelector, 1) : mergeMap_1.mergeMap(project, 1);
|
||||
}
|
||||
exports.concatMap = concatMap;
|
||||
//# sourceMappingURL=concatMap.js.map
|
||||
@@ -0,0 +1,42 @@
|
||||
var constant = require('./constant'),
|
||||
createInverter = require('./_createInverter'),
|
||||
identity = require('./identity');
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/**
|
||||
* Used to resolve the
|
||||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||
* of values.
|
||||
*/
|
||||
var nativeObjectToString = objectProto.toString;
|
||||
|
||||
/**
|
||||
* Creates an object composed of the inverted keys and values of `object`.
|
||||
* If `object` contains duplicate values, subsequent values overwrite
|
||||
* property assignments of previous values.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 0.7.0
|
||||
* @category Object
|
||||
* @param {Object} object The object to invert.
|
||||
* @returns {Object} Returns the new inverted object.
|
||||
* @example
|
||||
*
|
||||
* var object = { 'a': 1, 'b': 2, 'c': 1 };
|
||||
*
|
||||
* _.invert(object);
|
||||
* // => { '1': 'c', '2': 'b' }
|
||||
*/
|
||||
var invert = createInverter(function(result, value, key) {
|
||||
if (value != null &&
|
||||
typeof value.toString != 'function') {
|
||||
value = nativeObjectToString.call(value);
|
||||
}
|
||||
|
||||
result[value] = key;
|
||||
}, constant(identity));
|
||||
|
||||
module.exports = invert;
|
||||
@@ -0,0 +1,53 @@
|
||||
util-deprecate
|
||||
==============
|
||||
### The Node.js `util.deprecate()` function with browser support
|
||||
|
||||
In Node.js, this module simply re-exports the `util.deprecate()` function.
|
||||
|
||||
In the web browser (i.e. via browserify), a browser-specific implementation
|
||||
of the `util.deprecate()` function is used.
|
||||
|
||||
|
||||
## API
|
||||
|
||||
A `deprecate()` function is the only thing exposed by this module.
|
||||
|
||||
``` javascript
|
||||
// setup:
|
||||
exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');
|
||||
|
||||
|
||||
// users see:
|
||||
foo();
|
||||
// foo() is deprecated, use bar() instead
|
||||
foo();
|
||||
foo();
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1,67 @@
|
||||
# parent-module [](https://travis-ci.org/sindresorhus/parent-module)
|
||||
|
||||
> Get the path of the parent module
|
||||
|
||||
Node.js exposes `module.parent`, but it only gives you the first cached parent, which is not necessarily the actual parent.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install parent-module
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// bar.js
|
||||
const parentModule = require('parent-module');
|
||||
|
||||
module.exports = () => {
|
||||
console.log(parentModule());
|
||||
//=> '/Users/sindresorhus/dev/unicorn/foo.js'
|
||||
};
|
||||
```
|
||||
|
||||
```js
|
||||
// foo.js
|
||||
const bar = require('./bar');
|
||||
|
||||
bar();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### parentModule([filepath])
|
||||
|
||||
By default, it will return the path of the immediate parent.
|
||||
|
||||
#### filepath
|
||||
|
||||
Type: `string`<br>
|
||||
Default: [`__filename`](https://nodejs.org/api/globals.html#globals_filename)
|
||||
|
||||
Filepath of the module of which to get the parent path.
|
||||
|
||||
Useful if you want it to work [multiple module levels down](https://github.com/sindresorhus/parent-module/tree/master/fixtures/filepath).
|
||||
|
||||
|
||||
## Tip
|
||||
|
||||
Combine it with [`read-pkg-up`](https://github.com/sindresorhus/read-pkg-up) to read the package.json of the parent module.
|
||||
|
||||
```js
|
||||
const path = require('path');
|
||||
const readPkgUp = require('read-pkg-up');
|
||||
const parentModule = require('parent-module');
|
||||
|
||||
console.log(readPkgUp.sync({cwd: path.dirname(parentModule())}).pkg);
|
||||
//=> {name: 'chalk', version: '1.0.0', …}
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
@@ -0,0 +1,8 @@
|
||||
import { InteropObservable } from '../types';
|
||||
import { observable as Symbol_observable } from '../symbol/observable';
|
||||
import { isFunction } from './isFunction';
|
||||
|
||||
/** Identifies an input as being Observable (but not necessary an Rx Observable) */
|
||||
export function isInteropObservable(input: any): input is InteropObservable<any> {
|
||||
return isFunction(input[Symbol_observable]);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"localHostOrDomainIs.js","sourceRoot":"","sources":["../src/localHostOrDomainIs.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAwB,mBAAmB,CAC1C,IAAY,EACZ,OAAe;IAEf,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,OAAO,GAAG,IAAI,CAAC;IAEnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE;YAC7B,OAAO,GAAG,KAAK,CAAC;YAChB,MAAM;SACN;KACD;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAhBD,sCAgBC"}
|
||||
@@ -0,0 +1,7 @@
|
||||
import isInt from './isInt';
|
||||
export default function isPort(str) {
|
||||
return isInt(str, {
|
||||
min: 0,
|
||||
max: 65535
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
export function scanInternals(accumulator, seed, hasSeed, emitOnNext, emitBeforeComplete) {
|
||||
return (source, subscriber) => {
|
||||
let hasState = hasSeed;
|
||||
let state = seed;
|
||||
let index = 0;
|
||||
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
||||
const i = index++;
|
||||
state = hasState
|
||||
?
|
||||
accumulator(state, value, i)
|
||||
:
|
||||
((hasState = true), value);
|
||||
emitOnNext && subscriber.next(state);
|
||||
}, emitBeforeComplete &&
|
||||
(() => {
|
||||
hasState && subscriber.next(state);
|
||||
subscriber.complete();
|
||||
})));
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=scanInternals.js.map
|
||||
@@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
var $arrayPush = callBound('Array.prototype.push');
|
||||
|
||||
var getIteratorMethod = require('../helpers/getIteratorMethod');
|
||||
var AdvanceStringIndex = require('./AdvanceStringIndex');
|
||||
var GetIterator = require('./GetIterator');
|
||||
var GetMethod = require('./GetMethod');
|
||||
var IsArray = require('./IsArray');
|
||||
var IteratorStep = require('./IteratorStep');
|
||||
var IteratorValue = require('./IteratorValue');
|
||||
var ToObject = require('./ToObject');
|
||||
var ES = {
|
||||
AdvanceStringIndex: AdvanceStringIndex,
|
||||
GetMethod: GetMethod,
|
||||
IsArray: IsArray
|
||||
};
|
||||
|
||||
// https://262.ecma-international.org/7.0/#sec-iterabletoarraylike
|
||||
|
||||
module.exports = function IterableToArrayLike(items) {
|
||||
var usingIterator = getIteratorMethod(ES, items);
|
||||
if (typeof usingIterator !== 'undefined') {
|
||||
var iterator = GetIterator(items, usingIterator);
|
||||
var values = [];
|
||||
var next = true;
|
||||
while (next) {
|
||||
next = IteratorStep(iterator);
|
||||
if (next) {
|
||||
var nextValue = IteratorValue(next);
|
||||
$arrayPush(values, nextValue);
|
||||
}
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
return ToObject(items);
|
||||
};
|
||||
@@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
var Buffer = require("safer-buffer").Buffer;
|
||||
|
||||
// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that
|
||||
// correspond to encoded bytes (if 128 - then lower half is ASCII).
|
||||
|
||||
exports._sbcs = SBCSCodec;
|
||||
function SBCSCodec(codecOptions, iconv) {
|
||||
if (!codecOptions)
|
||||
throw new Error("SBCS codec is called without the data.")
|
||||
|
||||
// Prepare char buffer for decoding.
|
||||
if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256))
|
||||
throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)");
|
||||
|
||||
if (codecOptions.chars.length === 128) {
|
||||
var asciiString = "";
|
||||
for (var i = 0; i < 128; i++)
|
||||
asciiString += String.fromCharCode(i);
|
||||
codecOptions.chars = asciiString + codecOptions.chars;
|
||||
}
|
||||
|
||||
this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2');
|
||||
|
||||
// Encoding buffer.
|
||||
var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
|
||||
|
||||
for (var i = 0; i < codecOptions.chars.length; i++)
|
||||
encodeBuf[codecOptions.chars.charCodeAt(i)] = i;
|
||||
|
||||
this.encodeBuf = encodeBuf;
|
||||
}
|
||||
|
||||
SBCSCodec.prototype.encoder = SBCSEncoder;
|
||||
SBCSCodec.prototype.decoder = SBCSDecoder;
|
||||
|
||||
|
||||
function SBCSEncoder(options, codec) {
|
||||
this.encodeBuf = codec.encodeBuf;
|
||||
}
|
||||
|
||||
SBCSEncoder.prototype.write = function(str) {
|
||||
var buf = Buffer.alloc(str.length);
|
||||
for (var i = 0; i < str.length; i++)
|
||||
buf[i] = this.encodeBuf[str.charCodeAt(i)];
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
SBCSEncoder.prototype.end = function() {
|
||||
}
|
||||
|
||||
|
||||
function SBCSDecoder(options, codec) {
|
||||
this.decodeBuf = codec.decodeBuf;
|
||||
}
|
||||
|
||||
SBCSDecoder.prototype.write = function(buf) {
|
||||
// Strings are immutable in JS -> we use ucs2 buffer to speed up computations.
|
||||
var decodeBuf = this.decodeBuf;
|
||||
var newBuf = Buffer.alloc(buf.length*2);
|
||||
var idx1 = 0, idx2 = 0;
|
||||
for (var i = 0; i < buf.length; i++) {
|
||||
idx1 = buf[i]*2; idx2 = i*2;
|
||||
newBuf[idx2] = decodeBuf[idx1];
|
||||
newBuf[idx2+1] = decodeBuf[idx1+1];
|
||||
}
|
||||
return newBuf.toString('ucs2');
|
||||
}
|
||||
|
||||
SBCSDecoder.prototype.end = function() {
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"timerHandle.js","sourceRoot":"","sources":["../../../../src/internal/scheduler/timerHandle.ts"],"names":[],"mappings":""}
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').omitLimit;
|
||||
@@ -0,0 +1,12 @@
|
||||
/*!
|
||||
* mime-db
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = require('./db.json')
|
||||
@@ -0,0 +1,245 @@
|
||||
{
|
||||
"name": "rxjs",
|
||||
"version": "7.8.0",
|
||||
"description": "Reactive Extensions for modern JavaScript",
|
||||
"main": "./dist/cjs/index.js",
|
||||
"module": "./dist/esm5/index.js",
|
||||
"es2015": "./dist/esm/index.js",
|
||||
"types": "index.d.ts",
|
||||
"typesVersions": {
|
||||
">=4.2": {
|
||||
"*": [
|
||||
"dist/types/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/types/index.d.ts",
|
||||
"node": "./dist/cjs/index.js",
|
||||
"require": "./dist/cjs/index.js",
|
||||
"es2015": "./dist/esm/index.js",
|
||||
"default": "./dist/esm5/index.js"
|
||||
},
|
||||
"./ajax": {
|
||||
"types": "./dist/types/ajax/index.d.ts",
|
||||
"node": "./dist/cjs/ajax/index.js",
|
||||
"require": "./dist/cjs/ajax/index.js",
|
||||
"es2015": "./dist/esm/ajax/index.js",
|
||||
"default": "./dist/esm5/ajax/index.js"
|
||||
},
|
||||
"./fetch": {
|
||||
"types": "./dist/types/fetch/index.d.ts",
|
||||
"node": "./dist/cjs/fetch/index.js",
|
||||
"require": "./dist/cjs/fetch/index.js",
|
||||
"es2015": "./dist/esm/fetch/index.js",
|
||||
"default": "./dist/esm5/fetch/index.js"
|
||||
},
|
||||
"./operators": {
|
||||
"types": "./dist/types/operators/index.d.ts",
|
||||
"node": "./dist/cjs/operators/index.js",
|
||||
"require": "./dist/cjs/operators/index.js",
|
||||
"es2015": "./dist/esm/operators/index.js",
|
||||
"default": "./dist/esm5/operators/index.js"
|
||||
},
|
||||
"./testing": {
|
||||
"types": "./dist/types/testing/index.d.ts",
|
||||
"node": "./dist/cjs/testing/index.js",
|
||||
"require": "./dist/cjs/testing/index.js",
|
||||
"es2015": "./dist/esm/testing/index.js",
|
||||
"default": "./dist/esm5/testing/index.js"
|
||||
},
|
||||
"./webSocket": {
|
||||
"types": "./dist/types/webSocket/index.d.ts",
|
||||
"node": "./dist/cjs/webSocket/index.js",
|
||||
"require": "./dist/cjs/webSocket/index.js",
|
||||
"es2015": "./dist/esm/webSocket/index.js",
|
||||
"default": "./dist/esm5/webSocket/index.js"
|
||||
},
|
||||
"./internal/*": {
|
||||
"types": "./dist/types/internal/*.d.ts",
|
||||
"node": "./dist/cjs/internal/*.js",
|
||||
"require": "./dist/cjs/internal/*.js",
|
||||
"es2015": "./dist/esm/internal/*.js",
|
||||
"default": "./dist/esm5/internal/*.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "cz-conventional-changelog"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.js": "eslint --cache --fix",
|
||||
"(src|spec)/**/*.ts": [
|
||||
"tslint --fix",
|
||||
"prettier --write"
|
||||
],
|
||||
"*.{js,css,md}": "prettier --write"
|
||||
},
|
||||
"scripts": {
|
||||
"changelog": "npx conventional-changelog-cli -p angular -i CHANGELOG.md -s",
|
||||
"build:spec:browser": "echo \"Browser test is not working currently\" && exit -1 && webpack --config spec/support/webpack.mocha.config.js",
|
||||
"lint_spec": "tslint -c spec/tslint.json -p spec/tsconfig.json \"spec/**/*.ts\"",
|
||||
"lint_src": "tslint -c tslint.json -p src/tsconfig.base.json \"src/**/*.ts\"",
|
||||
"lint": "npm-run-all --parallel lint_*",
|
||||
"dtslint": "tsc -b ./src/tsconfig.types.json && tslint -c spec-dtslint/tslint.json -p spec-dtslint/tsconfig.json \"spec-dtslint/**/*.ts\"",
|
||||
"prepublishOnly": "npm run build:package && npm run lint && npm run test && npm run test:circular && npm run dtslint && npm run test:side-effects",
|
||||
"publish_docs": "./publish_docs.sh",
|
||||
"test": "cross-env TS_NODE_PROJECT=tsconfig.mocha.json mocha --config spec/support/.mocharc.js \"spec/**/*-spec.ts\"",
|
||||
"test:esm": "node spec/module-test-spec.mjs",
|
||||
"test:browser": "echo \"Browser test is not working currently\" && exit -1 && npm-run-all build:spec:browser && opn spec/support/mocha-browser-runner.html",
|
||||
"test:circular": "dependency-cruiser --validate .dependency-cruiser.json -x \"^node_modules\" dist/esm5",
|
||||
"test:systemjs": "node integration/systemjs/systemjs-compatibility-spec.js",
|
||||
"test:side-effects": "check-side-effects --test integration/side-effects/side-effects.json",
|
||||
"test:side-effects:update": "npm run test:side-effects -- --update",
|
||||
"test:import": "ts-node ./integration/import/runner.ts",
|
||||
"compile": "tsc -b ./src/tsconfig.cjs.json ./src/tsconfig.cjs.spec.json ./src/tsconfig.esm.json ./src/tsconfig.esm5.json ./src/tsconfig.esm5.rollup.json ./src/tsconfig.types.json ./src/tsconfig.types.spec.json ./spec/tsconfig.json",
|
||||
"build:clean": "shx rm -rf ./dist",
|
||||
"build:global": "node ./tools/make-umd-bundle.js && node ./tools/make-closure-core.js",
|
||||
"build:package": "npm-run-all build:clean compile build:global && node ./tools/prepare-package.js && node ./tools/generate-alias.js",
|
||||
"watch": "nodemon -w \"src/\" -w \"spec/\" -e ts -x npm test",
|
||||
"watch:dtslint": "nodemon -w \"src/\" -w \"spec-dtslint/\" -e ts -x npm run dtslint"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/reactivex/rxjs.git"
|
||||
},
|
||||
"keywords": [
|
||||
"Rx",
|
||||
"RxJS",
|
||||
"ReactiveX",
|
||||
"ReactiveExtensions",
|
||||
"Streams",
|
||||
"Observables",
|
||||
"Observable",
|
||||
"Stream",
|
||||
"ES6",
|
||||
"ES2015"
|
||||
],
|
||||
"author": "Ben Lesh <ben@benlesh.com>",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Ben Lesh",
|
||||
"email": "ben@benlesh.com"
|
||||
},
|
||||
{
|
||||
"name": "Paul Taylor",
|
||||
"email": "paul.e.taylor@me.com"
|
||||
},
|
||||
{
|
||||
"name": "Jeff Cross",
|
||||
"email": "crossj@google.com"
|
||||
},
|
||||
{
|
||||
"name": "Matthew Podwysocki",
|
||||
"email": "matthewp@microsoft.com"
|
||||
},
|
||||
{
|
||||
"name": "OJ Kwon",
|
||||
"email": "kwon.ohjoong@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Andre Staltz",
|
||||
"email": "andre@staltz.com"
|
||||
}
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ReactiveX/RxJS/issues"
|
||||
},
|
||||
"homepage": "https://rxjs.dev",
|
||||
"dependencies": {
|
||||
"tslib": "^2.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-optimizer": "0.4.6",
|
||||
"@angular-devkit/schematics": "^11.0.7",
|
||||
"@swc/core": "^1.2.128",
|
||||
"@swc/helpers": "^0.3.2",
|
||||
"@types/chai": "^4.2.11",
|
||||
"@types/lodash": "4.14.102",
|
||||
"@types/mocha": "^7.0.2",
|
||||
"@types/node": "^14.14.6",
|
||||
"@types/shelljs": "^0.8.8",
|
||||
"@types/sinon": "4.1.3",
|
||||
"@types/sinon-chai": "2.7.29",
|
||||
"@types/source-map": "^0.5.2",
|
||||
"@typescript-eslint/eslint-plugin": "^4.29.1",
|
||||
"@typescript-eslint/parser": "^4.29.1",
|
||||
"babel-polyfill": "6.26.0",
|
||||
"chai": "^4.2.0",
|
||||
"check-side-effects": "0.0.23",
|
||||
"color": "3.0.0",
|
||||
"colors": "1.1.2",
|
||||
"cross-env": "5.1.3",
|
||||
"cz-conventional-changelog": "1.2.0",
|
||||
"dependency-cruiser": "^9.12.0",
|
||||
"escape-string-regexp": "1.0.5",
|
||||
"eslint": "^7.8.1",
|
||||
"eslint-plugin-jasmine": "^2.10.1",
|
||||
"form-data": "^3.0.0",
|
||||
"fs-extra": "^8.1.0",
|
||||
"glob": "7.1.2",
|
||||
"google-closure-compiler-js": "20170218.0.0",
|
||||
"husky": "^4.2.5",
|
||||
"klaw-sync": "3.0.2",
|
||||
"lint-staged": "^10.2.11",
|
||||
"lodash": "^4.17.15",
|
||||
"minimist": "^1.2.5",
|
||||
"mocha": "^8.1.3",
|
||||
"nodemon": "^1.9.2",
|
||||
"npm-run-all": "4.1.2",
|
||||
"opn-cli": "3.1.0",
|
||||
"platform": "1.3.5",
|
||||
"prettier": "^2.5.1",
|
||||
"promise": "8.0.1",
|
||||
"rollup": "0.66.6",
|
||||
"rollup-plugin-alias": "1.4.0",
|
||||
"rollup-plugin-inject": "2.0.0",
|
||||
"rollup-plugin-node-resolve": "2.0.0",
|
||||
"shelljs": "^0.8.4",
|
||||
"shx": "^0.3.2",
|
||||
"sinon": "4.3.0",
|
||||
"sinon-chai": "2.14.0",
|
||||
"source-map-support": "0.5.3",
|
||||
"systemjs": "^0.21.0",
|
||||
"ts-node": "^9.1.1",
|
||||
"tslint": "^5.20.1",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"tslint-etc": "1.13.10",
|
||||
"tslint-no-toplevel-property-access": "0.0.2",
|
||||
"tslint-no-unused-expression-chai": "0.0.3",
|
||||
"typescript": "~4.2.0",
|
||||
"validate-commit-msg": "2.14.0",
|
||||
"web-streams-polyfill": "^3.0.2",
|
||||
"webpack": "^4.31.0"
|
||||
},
|
||||
"files": [
|
||||
"dist/bundles",
|
||||
"dist/cjs/**/!(*.tsbuildinfo)",
|
||||
"dist/esm/**/!(*.tsbuildinfo)",
|
||||
"dist/esm5/**/!(*.tsbuildinfo)",
|
||||
"dist/types/**/!(*.tsbuildinfo)",
|
||||
"ajax",
|
||||
"fetch",
|
||||
"operators",
|
||||
"testing",
|
||||
"webSocket",
|
||||
"src",
|
||||
"CHANGELOG.md",
|
||||
"CODE_OF_CONDUCT.md",
|
||||
"LICENSE.txt",
|
||||
"package.json",
|
||||
"README.md",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged",
|
||||
"commit-msg": "validate-commit-msg"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
var $floor = Math.floor;
|
||||
|
||||
module.exports = function mod(number, modulo) {
|
||||
var remain = number % modulo;
|
||||
return $floor(remain >= 0 ? remain : remain + modulo);
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
'use strict';
|
||||
const tls = require('tls');
|
||||
|
||||
module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, reject) => {
|
||||
let timeout = false;
|
||||
|
||||
let socket;
|
||||
|
||||
const callback = async () => {
|
||||
await socketPromise;
|
||||
|
||||
socket.off('timeout', onTimeout);
|
||||
socket.off('error', reject);
|
||||
|
||||
if (options.resolveSocket) {
|
||||
resolve({alpnProtocol: socket.alpnProtocol, socket, timeout});
|
||||
|
||||
if (timeout) {
|
||||
await Promise.resolve();
|
||||
socket.emit('timeout');
|
||||
}
|
||||
} else {
|
||||
socket.destroy();
|
||||
resolve({alpnProtocol: socket.alpnProtocol, timeout});
|
||||
}
|
||||
};
|
||||
|
||||
const onTimeout = async () => {
|
||||
timeout = true;
|
||||
callback();
|
||||
};
|
||||
|
||||
const socketPromise = (async () => {
|
||||
try {
|
||||
socket = await connect(options, callback);
|
||||
|
||||
socket.on('error', reject);
|
||||
socket.once('timeout', onTimeout);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
})();
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [ "es5" ],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": ".",
|
||||
"paths": { "codepage": ["."] },
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"strictFunctionTypes": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SupportedLocales.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/SupportedLocales.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC7B,gBAAgB,EAAE,MAAM,EAAE,EAC1B,OAAO,CAAC,EAAE;IAAC,aAAa,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAA;CAAC,GAChD,MAAM,EAAE,CAgBV"}
|
||||
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getPropertyByPath = getPropertyByPath;
|
||||
|
||||
// Resolves property names or property paths defined with period-delimited
|
||||
// strings or arrays of strings. Property names that are found on the source
|
||||
// object are used directly (even if they include a period).
|
||||
// Nested property names that include periods, within a path, are only
|
||||
// understood in array paths.
|
||||
function getPropertyByPath(source, path) {
|
||||
if (typeof path === 'string' && Object.prototype.hasOwnProperty.call(source, path)) {
|
||||
return source[path];
|
||||
}
|
||||
|
||||
const parsedPath = typeof path === 'string' ? path.split('.') : path; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
||||
return parsedPath.reduce((previous, key) => {
|
||||
if (previous === undefined) {
|
||||
return previous;
|
||||
}
|
||||
|
||||
return previous[key];
|
||||
}, source);
|
||||
}
|
||||
//# sourceMappingURL=getPropertyByPath.js.map
|
||||
@@ -0,0 +1,43 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var objectKeys = require('object-keys');
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
|
||||
var callBind = require('call-bind');
|
||||
|
||||
var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
|
||||
var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%'));
|
||||
|
||||
var forEach = require('../helpers/forEach');
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://262.ecma-international.org/8.0/#sec-enumerableownproperties
|
||||
|
||||
module.exports = function EnumerableOwnPropertyNames(O, kind) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
|
||||
var keys = objectKeys(O);
|
||||
if (kind === 'key') {
|
||||
return keys;
|
||||
}
|
||||
if (kind === 'value' || kind === 'key+value') {
|
||||
var results = [];
|
||||
forEach(keys, function (key) {
|
||||
if ($isEnumerable(O, key)) {
|
||||
$pushApply(results, [
|
||||
kind === 'value' ? O[key] : [key, O[key]]
|
||||
]);
|
||||
}
|
||||
});
|
||||
return results;
|
||||
}
|
||||
throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind);
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
var toPosInt = require("es5-ext/number/to-pos-integer")
|
||||
, maxTimeout = require("./max-timeout");
|
||||
|
||||
module.exports = function (value) {
|
||||
value = toPosInt(value);
|
||||
if (value > maxTimeout) throw new TypeError(value + " exceeds maximum possible timeout");
|
||||
return value;
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import { RequestOptions, ResponseHeaders, OctokitResponse } from "@octokit/types";
|
||||
export type RequestErrorOptions = {
|
||||
/** @deprecated set `response` instead */
|
||||
headers?: ResponseHeaders;
|
||||
request: RequestOptions;
|
||||
} | {
|
||||
response: OctokitResponse<unknown>;
|
||||
request: RequestOptions;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","2":"C K L G M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB EC FC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","16":"I v J D E F A B C K L"},E:{"1":"I v J D E F A B IC JC KC LC 0B qB","16":"HC zB","130":"C K L G rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"F B C PC QC RC SC qB AC TC rB"},G:{"1":"E UC BC VC WC XC YC ZC aC bC cC dC eC","16":"zB","130":"fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"2":"oC"},I:{"1":"tB I f pC qC rC sC BC tC uC"},J:{"16":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"2":"H"},N:{"2":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"2":"AD BD"}},B:7,C:"CSS overflow: overlay"};
|
||||
@@ -0,0 +1,10 @@
|
||||
// eslint-disable-next-line node/no-deprecated-api
|
||||
const { createRequire, createRequireFromPath } = require('module')
|
||||
|
||||
function req (name, rootFile) {
|
||||
const create = createRequire || createRequireFromPath
|
||||
const require = create(rootFile)
|
||||
return require(name)
|
||||
}
|
||||
|
||||
module.exports = req
|
||||
@@ -0,0 +1,774 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for csv2json/libs/core/linesToJson.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../../index.html">All files</a> / <a href="index.html">csv2json/libs/core</a> linesToJson.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>0/121</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>0/88</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>0/16</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>0/121</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line low'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a>
|
||||
<a name='L15'></a><a href='#L15'>15</a>
|
||||
<a name='L16'></a><a href='#L16'>16</a>
|
||||
<a name='L17'></a><a href='#L17'>17</a>
|
||||
<a name='L18'></a><a href='#L18'>18</a>
|
||||
<a name='L19'></a><a href='#L19'>19</a>
|
||||
<a name='L20'></a><a href='#L20'>20</a>
|
||||
<a name='L21'></a><a href='#L21'>21</a>
|
||||
<a name='L22'></a><a href='#L22'>22</a>
|
||||
<a name='L23'></a><a href='#L23'>23</a>
|
||||
<a name='L24'></a><a href='#L24'>24</a>
|
||||
<a name='L25'></a><a href='#L25'>25</a>
|
||||
<a name='L26'></a><a href='#L26'>26</a>
|
||||
<a name='L27'></a><a href='#L27'>27</a>
|
||||
<a name='L28'></a><a href='#L28'>28</a>
|
||||
<a name='L29'></a><a href='#L29'>29</a>
|
||||
<a name='L30'></a><a href='#L30'>30</a>
|
||||
<a name='L31'></a><a href='#L31'>31</a>
|
||||
<a name='L32'></a><a href='#L32'>32</a>
|
||||
<a name='L33'></a><a href='#L33'>33</a>
|
||||
<a name='L34'></a><a href='#L34'>34</a>
|
||||
<a name='L35'></a><a href='#L35'>35</a>
|
||||
<a name='L36'></a><a href='#L36'>36</a>
|
||||
<a name='L37'></a><a href='#L37'>37</a>
|
||||
<a name='L38'></a><a href='#L38'>38</a>
|
||||
<a name='L39'></a><a href='#L39'>39</a>
|
||||
<a name='L40'></a><a href='#L40'>40</a>
|
||||
<a name='L41'></a><a href='#L41'>41</a>
|
||||
<a name='L42'></a><a href='#L42'>42</a>
|
||||
<a name='L43'></a><a href='#L43'>43</a>
|
||||
<a name='L44'></a><a href='#L44'>44</a>
|
||||
<a name='L45'></a><a href='#L45'>45</a>
|
||||
<a name='L46'></a><a href='#L46'>46</a>
|
||||
<a name='L47'></a><a href='#L47'>47</a>
|
||||
<a name='L48'></a><a href='#L48'>48</a>
|
||||
<a name='L49'></a><a href='#L49'>49</a>
|
||||
<a name='L50'></a><a href='#L50'>50</a>
|
||||
<a name='L51'></a><a href='#L51'>51</a>
|
||||
<a name='L52'></a><a href='#L52'>52</a>
|
||||
<a name='L53'></a><a href='#L53'>53</a>
|
||||
<a name='L54'></a><a href='#L54'>54</a>
|
||||
<a name='L55'></a><a href='#L55'>55</a>
|
||||
<a name='L56'></a><a href='#L56'>56</a>
|
||||
<a name='L57'></a><a href='#L57'>57</a>
|
||||
<a name='L58'></a><a href='#L58'>58</a>
|
||||
<a name='L59'></a><a href='#L59'>59</a>
|
||||
<a name='L60'></a><a href='#L60'>60</a>
|
||||
<a name='L61'></a><a href='#L61'>61</a>
|
||||
<a name='L62'></a><a href='#L62'>62</a>
|
||||
<a name='L63'></a><a href='#L63'>63</a>
|
||||
<a name='L64'></a><a href='#L64'>64</a>
|
||||
<a name='L65'></a><a href='#L65'>65</a>
|
||||
<a name='L66'></a><a href='#L66'>66</a>
|
||||
<a name='L67'></a><a href='#L67'>67</a>
|
||||
<a name='L68'></a><a href='#L68'>68</a>
|
||||
<a name='L69'></a><a href='#L69'>69</a>
|
||||
<a name='L70'></a><a href='#L70'>70</a>
|
||||
<a name='L71'></a><a href='#L71'>71</a>
|
||||
<a name='L72'></a><a href='#L72'>72</a>
|
||||
<a name='L73'></a><a href='#L73'>73</a>
|
||||
<a name='L74'></a><a href='#L74'>74</a>
|
||||
<a name='L75'></a><a href='#L75'>75</a>
|
||||
<a name='L76'></a><a href='#L76'>76</a>
|
||||
<a name='L77'></a><a href='#L77'>77</a>
|
||||
<a name='L78'></a><a href='#L78'>78</a>
|
||||
<a name='L79'></a><a href='#L79'>79</a>
|
||||
<a name='L80'></a><a href='#L80'>80</a>
|
||||
<a name='L81'></a><a href='#L81'>81</a>
|
||||
<a name='L82'></a><a href='#L82'>82</a>
|
||||
<a name='L83'></a><a href='#L83'>83</a>
|
||||
<a name='L84'></a><a href='#L84'>84</a>
|
||||
<a name='L85'></a><a href='#L85'>85</a>
|
||||
<a name='L86'></a><a href='#L86'>86</a>
|
||||
<a name='L87'></a><a href='#L87'>87</a>
|
||||
<a name='L88'></a><a href='#L88'>88</a>
|
||||
<a name='L89'></a><a href='#L89'>89</a>
|
||||
<a name='L90'></a><a href='#L90'>90</a>
|
||||
<a name='L91'></a><a href='#L91'>91</a>
|
||||
<a name='L92'></a><a href='#L92'>92</a>
|
||||
<a name='L93'></a><a href='#L93'>93</a>
|
||||
<a name='L94'></a><a href='#L94'>94</a>
|
||||
<a name='L95'></a><a href='#L95'>95</a>
|
||||
<a name='L96'></a><a href='#L96'>96</a>
|
||||
<a name='L97'></a><a href='#L97'>97</a>
|
||||
<a name='L98'></a><a href='#L98'>98</a>
|
||||
<a name='L99'></a><a href='#L99'>99</a>
|
||||
<a name='L100'></a><a href='#L100'>100</a>
|
||||
<a name='L101'></a><a href='#L101'>101</a>
|
||||
<a name='L102'></a><a href='#L102'>102</a>
|
||||
<a name='L103'></a><a href='#L103'>103</a>
|
||||
<a name='L104'></a><a href='#L104'>104</a>
|
||||
<a name='L105'></a><a href='#L105'>105</a>
|
||||
<a name='L106'></a><a href='#L106'>106</a>
|
||||
<a name='L107'></a><a href='#L107'>107</a>
|
||||
<a name='L108'></a><a href='#L108'>108</a>
|
||||
<a name='L109'></a><a href='#L109'>109</a>
|
||||
<a name='L110'></a><a href='#L110'>110</a>
|
||||
<a name='L111'></a><a href='#L111'>111</a>
|
||||
<a name='L112'></a><a href='#L112'>112</a>
|
||||
<a name='L113'></a><a href='#L113'>113</a>
|
||||
<a name='L114'></a><a href='#L114'>114</a>
|
||||
<a name='L115'></a><a href='#L115'>115</a>
|
||||
<a name='L116'></a><a href='#L116'>116</a>
|
||||
<a name='L117'></a><a href='#L117'>117</a>
|
||||
<a name='L118'></a><a href='#L118'>118</a>
|
||||
<a name='L119'></a><a href='#L119'>119</a>
|
||||
<a name='L120'></a><a href='#L120'>120</a>
|
||||
<a name='L121'></a><a href='#L121'>121</a>
|
||||
<a name='L122'></a><a href='#L122'>122</a>
|
||||
<a name='L123'></a><a href='#L123'>123</a>
|
||||
<a name='L124'></a><a href='#L124'>124</a>
|
||||
<a name='L125'></a><a href='#L125'>125</a>
|
||||
<a name='L126'></a><a href='#L126'>126</a>
|
||||
<a name='L127'></a><a href='#L127'>127</a>
|
||||
<a name='L128'></a><a href='#L128'>128</a>
|
||||
<a name='L129'></a><a href='#L129'>129</a>
|
||||
<a name='L130'></a><a href='#L130'>130</a>
|
||||
<a name='L131'></a><a href='#L131'>131</a>
|
||||
<a name='L132'></a><a href='#L132'>132</a>
|
||||
<a name='L133'></a><a href='#L133'>133</a>
|
||||
<a name='L134'></a><a href='#L134'>134</a>
|
||||
<a name='L135'></a><a href='#L135'>135</a>
|
||||
<a name='L136'></a><a href='#L136'>136</a>
|
||||
<a name='L137'></a><a href='#L137'>137</a>
|
||||
<a name='L138'></a><a href='#L138'>138</a>
|
||||
<a name='L139'></a><a href='#L139'>139</a>
|
||||
<a name='L140'></a><a href='#L140'>140</a>
|
||||
<a name='L141'></a><a href='#L141'>141</a>
|
||||
<a name='L142'></a><a href='#L142'>142</a>
|
||||
<a name='L143'></a><a href='#L143'>143</a>
|
||||
<a name='L144'></a><a href='#L144'>144</a>
|
||||
<a name='L145'></a><a href='#L145'>145</a>
|
||||
<a name='L146'></a><a href='#L146'>146</a>
|
||||
<a name='L147'></a><a href='#L147'>147</a>
|
||||
<a name='L148'></a><a href='#L148'>148</a>
|
||||
<a name='L149'></a><a href='#L149'>149</a>
|
||||
<a name='L150'></a><a href='#L150'>150</a>
|
||||
<a name='L151'></a><a href='#L151'>151</a>
|
||||
<a name='L152'></a><a href='#L152'>152</a>
|
||||
<a name='L153'></a><a href='#L153'>153</a>
|
||||
<a name='L154'></a><a href='#L154'>154</a>
|
||||
<a name='L155'></a><a href='#L155'>155</a>
|
||||
<a name='L156'></a><a href='#L156'>156</a>
|
||||
<a name='L157'></a><a href='#L157'>157</a>
|
||||
<a name='L158'></a><a href='#L158'>158</a>
|
||||
<a name='L159'></a><a href='#L159'>159</a>
|
||||
<a name='L160'></a><a href='#L160'>160</a>
|
||||
<a name='L161'></a><a href='#L161'>161</a>
|
||||
<a name='L162'></a><a href='#L162'>162</a>
|
||||
<a name='L163'></a><a href='#L163'>163</a>
|
||||
<a name='L164'></a><a href='#L164'>164</a>
|
||||
<a name='L165'></a><a href='#L165'>165</a>
|
||||
<a name='L166'></a><a href='#L166'>166</a>
|
||||
<a name='L167'></a><a href='#L167'>167</a>
|
||||
<a name='L168'></a><a href='#L168'>168</a>
|
||||
<a name='L169'></a><a href='#L169'>169</a>
|
||||
<a name='L170'></a><a href='#L170'>170</a>
|
||||
<a name='L171'></a><a href='#L171'>171</a>
|
||||
<a name='L172'></a><a href='#L172'>172</a>
|
||||
<a name='L173'></a><a href='#L173'>173</a>
|
||||
<a name='L174'></a><a href='#L174'>174</a>
|
||||
<a name='L175'></a><a href='#L175'>175</a>
|
||||
<a name='L176'></a><a href='#L176'>176</a>
|
||||
<a name='L177'></a><a href='#L177'>177</a>
|
||||
<a name='L178'></a><a href='#L178'>178</a>
|
||||
<a name='L179'></a><a href='#L179'>179</a>
|
||||
<a name='L180'></a><a href='#L180'>180</a>
|
||||
<a name='L181'></a><a href='#L181'>181</a>
|
||||
<a name='L182'></a><a href='#L182'>182</a>
|
||||
<a name='L183'></a><a href='#L183'>183</a>
|
||||
<a name='L184'></a><a href='#L184'>184</a>
|
||||
<a name='L185'></a><a href='#L185'>185</a>
|
||||
<a name='L186'></a><a href='#L186'>186</a>
|
||||
<a name='L187'></a><a href='#L187'>187</a>
|
||||
<a name='L188'></a><a href='#L188'>188</a>
|
||||
<a name='L189'></a><a href='#L189'>189</a>
|
||||
<a name='L190'></a><a href='#L190'>190</a>
|
||||
<a name='L191'></a><a href='#L191'>191</a>
|
||||
<a name='L192'></a><a href='#L192'>192</a>
|
||||
<a name='L193'></a><a href='#L193'>193</a>
|
||||
<a name='L194'></a><a href='#L194'>194</a>
|
||||
<a name='L195'></a><a href='#L195'>195</a>
|
||||
<a name='L196'></a><a href='#L196'>196</a>
|
||||
<a name='L197'></a><a href='#L197'>197</a>
|
||||
<a name='L198'></a><a href='#L198'>198</a>
|
||||
<a name='L199'></a><a href='#L199'>199</a>
|
||||
<a name='L200'></a><a href='#L200'>200</a>
|
||||
<a name='L201'></a><a href='#L201'>201</a>
|
||||
<a name='L202'></a><a href='#L202'>202</a>
|
||||
<a name='L203'></a><a href='#L203'>203</a>
|
||||
<a name='L204'></a><a href='#L204'>204</a>
|
||||
<a name='L205'></a><a href='#L205'>205</a>
|
||||
<a name='L206'></a><a href='#L206'>206</a>
|
||||
<a name='L207'></a><a href='#L207'>207</a>
|
||||
<a name='L208'></a><a href='#L208'>208</a>
|
||||
<a name='L209'></a><a href='#L209'>209</a>
|
||||
<a name='L210'></a><a href='#L210'>210</a>
|
||||
<a name='L211'></a><a href='#L211'>211</a>
|
||||
<a name='L212'></a><a href='#L212'>212</a>
|
||||
<a name='L213'></a><a href='#L213'>213</a>
|
||||
<a name='L214'></a><a href='#L214'>214</a>
|
||||
<a name='L215'></a><a href='#L215'>215</a>
|
||||
<a name='L216'></a><a href='#L216'>216</a>
|
||||
<a name='L217'></a><a href='#L217'>217</a>
|
||||
<a name='L218'></a><a href='#L218'>218</a>
|
||||
<a name='L219'></a><a href='#L219'>219</a>
|
||||
<a name='L220'></a><a href='#L220'>220</a>
|
||||
<a name='L221'></a><a href='#L221'>221</a>
|
||||
<a name='L222'></a><a href='#L222'>222</a>
|
||||
<a name='L223'></a><a href='#L223'>223</a>
|
||||
<a name='L224'></a><a href='#L224'>224</a>
|
||||
<a name='L225'></a><a href='#L225'>225</a>
|
||||
<a name='L226'></a><a href='#L226'>226</a>
|
||||
<a name='L227'></a><a href='#L227'>227</a>
|
||||
<a name='L228'></a><a href='#L228'>228</a>
|
||||
<a name='L229'></a><a href='#L229'>229</a>
|
||||
<a name='L230'></a><a href='#L230'>230</a>
|
||||
<a name='L231'></a><a href='#L231'>231</a>
|
||||
<a name='L232'></a><a href='#L232'>232</a>
|
||||
<a name='L233'></a><a href='#L233'>233</a>
|
||||
<a name='L234'></a><a href='#L234'>234</a>
|
||||
<a name='L235'></a><a href='#L235'>235</a>
|
||||
<a name='L236'></a><a href='#L236'>236</a></td><td class="line-coverage quiet"><span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </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-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </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-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-no"> </span>
|
||||
<span class="cline-any cline-no"> </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-neutral"> </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-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-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-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </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-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-no"> </span>
|
||||
<span class="cline-any cline-no"> </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-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </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-no"> </span>
|
||||
<span class="cline-any cline-no"> </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-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-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </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-no"> </span>
|
||||
<span class="cline-any cline-no"> </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-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </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-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </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-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-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-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </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-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </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-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-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </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-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </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-no"> </span>
|
||||
<span class="cline-any cline-no"> </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">var parserMgr = <span class="cstat-no" title="statement not covered" >require("./parserMgr.js");</span>
|
||||
var CSVError = <span class="cstat-no" title="statement not covered" >require("./CSVError");</span>
|
||||
var numReg = <span class="cstat-no" title="statement not covered" >/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/;</span>
|
||||
/**
|
||||
* Convert lines of csv array into json
|
||||
* @param {[type]} lines [[col1,col2,col3]]
|
||||
* @param {[type]} params Converter params with _headers field populated
|
||||
* @param {[type]} idx start pos of the lines
|
||||
* @return {[type]} [{err:null,json:obj,index:line,row:[csv row]}]
|
||||
*/
|
||||
<span class="cstat-no" title="statement not covered" >module.exports = <span class="fstat-no" title="function not covered" >fu</span>nction (lines, params, idx) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (params._needParseJson) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (!params._headers || !Array.isArray(params._headers)) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > params._headers = [];</span>
|
||||
}
|
||||
<span class="cstat-no" title="statement not covered" > if (!params.parseRules) {</span>
|
||||
var row = <span class="cstat-no" title="statement not covered" >params._headers;</span>
|
||||
<span class="cstat-no" title="statement not covered" > params.parseRules = parserMgr.initParsers(row, params);</span>
|
||||
}
|
||||
<span class="cstat-no" title="statement not covered" > return processRows(lines, params, idx);</span>
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > return justReturnRows(lines, params, idx);</span>
|
||||
}
|
||||
};
|
||||
|
||||
function <span class="fstat-no" title="function not covered" >justReturnRows(</span>lines, params, idx) {
|
||||
var rtn = <span class="cstat-no" title="statement not covered" >[];</span>
|
||||
<span class="cstat-no" title="statement not covered" > for (var i = 0, len = lines.length; i < len; i++) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > rtn.push({</span>
|
||||
err: null,
|
||||
json: {},
|
||||
index: idx++,
|
||||
row: lines[i]
|
||||
});
|
||||
}
|
||||
<span class="cstat-no" title="statement not covered" > return rtn;</span>
|
||||
}
|
||||
|
||||
function <span class="fstat-no" title="function not covered" >processRows(</span>csvRows, params, startIndex) {
|
||||
var res = <span class="cstat-no" title="statement not covered" >[];</span>
|
||||
<span class="cstat-no" title="statement not covered" > for (var i = 0, len = csvRows.length; i < len; i++) {</span>
|
||||
var r = <span class="cstat-no" title="statement not covered" >processRow(csvRows[i], params, startIndex++);</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (r) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > res.push(r);</span>
|
||||
}
|
||||
}
|
||||
<span class="cstat-no" title="statement not covered" > return res;</span>
|
||||
}
|
||||
|
||||
function <span class="fstat-no" title="function not covered" >processRow(</span>row, param, index) {
|
||||
var parseRules = <span class="cstat-no" title="statement not covered" >param.parseRules;</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (param.checkColumn && row.length !== parseRules.length) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return {</span>
|
||||
err: CSVError.column_mismatched(index)
|
||||
};
|
||||
}
|
||||
|
||||
var headRow = <span class="cstat-no" title="statement not covered" >param._headers;</span>
|
||||
var resultRow = <span class="cstat-no" title="statement not covered" >convertRowToJson(row, headRow, param);</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (resultRow) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return {</span>
|
||||
json: resultRow,
|
||||
index: index,
|
||||
row: row
|
||||
};
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > return null;</span>
|
||||
}
|
||||
}
|
||||
|
||||
function <span class="fstat-no" title="function not covered" >convertRowToJson(</span>row, headRow, param) {
|
||||
var hasValue = <span class="cstat-no" title="statement not covered" >false;</span>
|
||||
var resultRow = <span class="cstat-no" title="statement not covered" >{};</span>
|
||||
|
||||
<span class="cstat-no" title="statement not covered" > for (var i = 0, len = row.length; i < len; i++) {</span>
|
||||
var convertFunc, head, item;
|
||||
<span class="cstat-no" title="statement not covered" > item = row[i];</span>
|
||||
|
||||
<span class="cstat-no" title="statement not covered" > if (param.ignoreEmpty && item === '') {</span>
|
||||
<span class="cstat-no" title="statement not covered" > continue;</span>
|
||||
}
|
||||
<span class="cstat-no" title="statement not covered" > hasValue = true;</span>
|
||||
|
||||
<span class="cstat-no" title="statement not covered" > head = headRow[i];</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (!head || head === "") {</span>
|
||||
<span class="cstat-no" title="statement not covered" > head = headRow[i] = "field" + (i + 1);</span>
|
||||
}
|
||||
var convFunc = <span class="cstat-no" title="statement not covered" >getConvFunc(head, i, param);</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (convFunc) {</span>
|
||||
var convRes = <span class="cstat-no" title="statement not covered" >convFunc(item, head, resultRow,row,i);</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (convRes !== undefined) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > setPath(resultRow, head, convRes);</span>
|
||||
}
|
||||
} else {
|
||||
var flag = <span class="cstat-no" title="statement not covered" >getFlag(head, i, param);</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (flag === 'omit') {</span>
|
||||
<span class="cstat-no" title="statement not covered" > continue;</span>
|
||||
}
|
||||
<span class="cstat-no" title="statement not covered" > if (param.checkType) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > convertFunc = checkType(item, head, i, param);</span>
|
||||
<span class="cstat-no" title="statement not covered" > item = convertFunc(item);</span>
|
||||
}
|
||||
var title = <span class="cstat-no" title="statement not covered" >getTitle(head, i, param);</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (flag === 'flat' || param.flatKeys) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > resultRow[title] = item;</span>
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > setPath(resultRow, title, item);</span>
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="cstat-no" title="statement not covered" > if (hasValue) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return resultRow;</span>
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > return false;</span>
|
||||
}
|
||||
}
|
||||
|
||||
var builtInConv=<span class="cstat-no" title="statement not covered" >{</span>
|
||||
"string":stringType,
|
||||
"number":numberType,
|
||||
"omit":<span class="fstat-no" title="function not covered" >fu</span>nction(){}
|
||||
}
|
||||
function <span class="fstat-no" title="function not covered" >getConvFunc(</span>head,i,param){
|
||||
<span class="cstat-no" title="statement not covered" > if (param._columnConv[i] !== undefined){</span>
|
||||
<span class="cstat-no" title="statement not covered" > return param._columnConv[i];</span>
|
||||
}else{
|
||||
var flag=<span class="cstat-no" title="statement not covered" >param.colParser[head];</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (flag === undefined){</span>
|
||||
<span class="cstat-no" title="statement not covered" > return param._columnConv[i]=false;</span>
|
||||
}
|
||||
<span class="cstat-no" title="statement not covered" > if (typeof flag ==="string"){</span>
|
||||
<span class="cstat-no" title="statement not covered" > flag=flag.trim().toLowerCase();</span>
|
||||
var builtInFunc=<span class="cstat-no" title="statement not covered" >builtInConv[flag];</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (builtInFunc){</span>
|
||||
<span class="cstat-no" title="statement not covered" > return param._columnConv[i]=builtInFunc;</span>
|
||||
}else{
|
||||
<span class="cstat-no" title="statement not covered" > return param._columnConv[i]=false; </span>
|
||||
}
|
||||
}else <span class="cstat-no" title="statement not covered" >if (typeof flag ==="function"){</span>
|
||||
<span class="cstat-no" title="statement not covered" > return param._columnConv[i]=flag;</span>
|
||||
}else{
|
||||
<span class="cstat-no" title="statement not covered" > return param._columnConv[i]=false;</span>
|
||||
}
|
||||
}
|
||||
}
|
||||
function <span class="fstat-no" title="function not covered" >setPath(</span>json, path, value) {
|
||||
var _set = <span class="cstat-no" title="statement not covered" >require('lodash/set');</span>
|
||||
var pathArr = <span class="cstat-no" title="statement not covered" >path.split('.');</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (pathArr.length === 1) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > json[path] = value;</span>
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > _set(json, path, value);</span>
|
||||
}
|
||||
}
|
||||
|
||||
function <span class="fstat-no" title="function not covered" >getFlag(</span>head, i, param) {
|
||||
<span class="cstat-no" title="statement not covered" > if (typeof param._headerFlag[i] === "string") {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return param._headerFlag[i];</span>
|
||||
} else <span class="cstat-no" title="statement not covered" >if (head.indexOf('*omit*') > -1) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return param._headerFlag[i] = 'omit';</span>
|
||||
} else <span class="cstat-no" title="statement not covered" >if (head.indexOf('*flat*') > -1) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return param._headerFlag[i] = 'flat';</span>
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > return param._headerFlag[i] = '';</span>
|
||||
}
|
||||
}
|
||||
|
||||
function <span class="fstat-no" title="function not covered" >getTitle(</span>head, i, param) {
|
||||
<span class="cstat-no" title="statement not covered" > if (param._headerTitle[i]) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return param._headerTitle[i];</span>
|
||||
}
|
||||
|
||||
var flag = <span class="cstat-no" title="statement not covered" >getFlag(head, i, param);</span>
|
||||
var str = <span class="cstat-no" title="statement not covered" >head.replace('*flat*', '').replace('string#!', '').replace('number#!', '');</span>
|
||||
<span class="cstat-no" title="statement not covered" > return param._headerTitle[i] = str;</span>
|
||||
}
|
||||
|
||||
function <span class="fstat-no" title="function not covered" >checkType(</span>item, head, headIdx, param) {
|
||||
<span class="cstat-no" title="statement not covered" > if (param._headerType[headIdx]) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return param._headerType[headIdx];</span>
|
||||
} else <span class="cstat-no" title="statement not covered" >if (head.indexOf('number#!') > -1) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return param._headerType[headIdx] = numberType;</span>
|
||||
} else <span class="cstat-no" title="statement not covered" >if (head.indexOf('string#!') > -1) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return param._headerType[headIdx] = stringType;</span>
|
||||
} else <span class="cstat-no" title="statement not covered" >if (param.checkType) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return param._headerType[headIdx] = dynamicType;</span>
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > return param._headerType[headIdx] = stringType;</span>
|
||||
}
|
||||
}
|
||||
|
||||
function <span class="fstat-no" title="function not covered" >numberType(</span>item) {
|
||||
var rtn = <span class="cstat-no" title="statement not covered" >parseFloat(item);</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (isNaN(rtn)) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return item;</span>
|
||||
}
|
||||
<span class="cstat-no" title="statement not covered" > return rtn;</span>
|
||||
}
|
||||
|
||||
function <span class="fstat-no" title="function not covered" >stringType(</span>item) {
|
||||
<span class="cstat-no" title="statement not covered" > return item.toString();</span>
|
||||
}
|
||||
|
||||
function <span class="fstat-no" title="function not covered" >dynamicType(</span>item) {
|
||||
var trimed = <span class="cstat-no" title="statement not covered" >item.trim();</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (trimed === "") {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return stringType(item);</span>
|
||||
}
|
||||
<span class="cstat-no" title="statement not covered" > if (numReg.test(trimed)) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return numberType(item);</span>
|
||||
} else <span class="cstat-no" title="statement not covered" >if (trimed.length === 5 && trimed.toLowerCase() === "false" || trimed.length === 4 && trimed.toLowerCase() === "true") {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return booleanType(item);</span>
|
||||
} else <span class="cstat-no" title="statement not covered" >if (trimed[0] === "{" && trimed[trimed.length - 1] === "}" || trimed[0] === "[" && trimed[trimed.length - 1] === "]") {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return jsonType(item);</span>
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > return stringType(item);</span>
|
||||
}
|
||||
}
|
||||
|
||||
function <span class="fstat-no" title="function not covered" >booleanType(</span>item) {
|
||||
var trimed = <span class="cstat-no" title="statement not covered" >item.trim();</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (trimed.length === 5 && trimed.toLowerCase() === "false") {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return false;</span>
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > return true;</span>
|
||||
}
|
||||
}
|
||||
|
||||
function <span class="fstat-no" title="function not covered" >jsonType(</span>item) {
|
||||
<span class="cstat-no" title="statement not covered" > try {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return JSON.parse(item);</span>
|
||||
} 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 Fri May 11 2018 21:20:20 GMT+0100 (IST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../../sorter.js"></script>
|
||||
<script src="../../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
import { concat } from './concat';
|
||||
export function concatWith(...otherSources) {
|
||||
return concat(...otherSources);
|
||||
}
|
||||
//# sourceMappingURL=concatWith.js.map
|
||||
@@ -0,0 +1,3 @@
|
||||
export default function isPromise(obj) {
|
||||
return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sample.js","sourceRoot":"","sources":["../../../../src/internal/operators/sample.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AA0ChE,MAAM,UAAU,MAAM,CAAI,QAA8B;IACtD,OAAO,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACpC,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,IAAI,SAAS,GAAa,IAAI,CAAC;QAC/B,MAAM,CAAC,SAAS,CACd,wBAAwB,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;YAC7C,QAAQ,GAAG,IAAI,CAAC;YAChB,SAAS,GAAG,KAAK,CAAC;QACpB,CAAC,CAAC,CACH,CAAC;QACF,SAAS,CAAC,QAAQ,CAAC,CAAC,SAAS,CAC3B,wBAAwB,CACtB,UAAU,EACV,GAAG,EAAE;YACH,IAAI,QAAQ,EAAE;gBACZ,QAAQ,GAAG,KAAK,CAAC;gBACjB,MAAM,KAAK,GAAG,SAAU,CAAC;gBACzB,SAAS,GAAG,IAAI,CAAC;gBACjB,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACxB;QACH,CAAC,EACD,IAAI,CACL,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
||||
@@ -0,0 +1,2 @@
|
||||
if(typeof cptable === 'undefined') cptable = {};
|
||||
cptable[1142] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a âäàáã}çñ#.<(+!&éêëèíîïì߀Å*);^-/ÂÄÀÁÃ$ÇÑø,%_>?¦ÉÊËÈÍÎÏÌ`:ÆØ'=\"@abcdefghi«»ðýþ±°jklmnopqrªº{¸[]µüstuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×æABCDEFGHIôöòóõåJKLMNOPQR¹û~ùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../../src/internal/scheduler/Action.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAiB/C,MAAM,OAAO,MAAU,SAAQ,YAAY;IACzC,YAAY,SAAoB,EAAE,IAAmD;QACnF,KAAK,EAAE,CAAC;IACV,CAAC;IAWM,QAAQ,CAAC,KAAS,EAAE,QAAgB,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
||||
@@ -0,0 +1,39 @@
|
||||
# lodash v4.17.21
|
||||
|
||||
The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules.
|
||||
|
||||
## Installation
|
||||
|
||||
Using npm:
|
||||
```shell
|
||||
$ npm i -g npm
|
||||
$ npm i --save lodash
|
||||
```
|
||||
|
||||
In Node.js:
|
||||
```js
|
||||
// Load the full build.
|
||||
var _ = require('lodash');
|
||||
// Load the core build.
|
||||
var _ = require('lodash/core');
|
||||
// Load the FP build for immutable auto-curried iteratee-first data-last methods.
|
||||
var fp = require('lodash/fp');
|
||||
|
||||
// Load method categories.
|
||||
var array = require('lodash/array');
|
||||
var object = require('lodash/fp/object');
|
||||
|
||||
// Cherry-pick methods for smaller browserify/rollup/webpack bundles.
|
||||
var at = require('lodash/at');
|
||||
var curryN = require('lodash/fp/curryN');
|
||||
```
|
||||
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.17.21-npm) for more details.
|
||||
|
||||
**Note:**<br>
|
||||
Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL.
|
||||
|
||||
## Support
|
||||
|
||||
Tested in Chrome 74-75, Firefox 66-67, IE 11, Edge 18, Safari 11-12, & Node.js 8-12.<br>
|
||||
Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available.
|
||||
@@ -0,0 +1,3 @@
|
||||
import type { Config } from './types/config'
|
||||
declare const config: Config
|
||||
export = config
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = require('./takeRightWhile');
|
||||
@@ -0,0 +1,156 @@
|
||||
'use strict';
|
||||
|
||||
var common = require('../common');
|
||||
var Type = require('../type');
|
||||
|
||||
function isHexCode(c) {
|
||||
return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
|
||||
((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
|
||||
((0x61/* a */ <= c) && (c <= 0x66/* f */));
|
||||
}
|
||||
|
||||
function isOctCode(c) {
|
||||
return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
|
||||
}
|
||||
|
||||
function isDecCode(c) {
|
||||
return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
|
||||
}
|
||||
|
||||
function resolveYamlInteger(data) {
|
||||
if (data === null) return false;
|
||||
|
||||
var max = data.length,
|
||||
index = 0,
|
||||
hasDigits = false,
|
||||
ch;
|
||||
|
||||
if (!max) return false;
|
||||
|
||||
ch = data[index];
|
||||
|
||||
// sign
|
||||
if (ch === '-' || ch === '+') {
|
||||
ch = data[++index];
|
||||
}
|
||||
|
||||
if (ch === '0') {
|
||||
// 0
|
||||
if (index + 1 === max) return true;
|
||||
ch = data[++index];
|
||||
|
||||
// base 2, base 8, base 16
|
||||
|
||||
if (ch === 'b') {
|
||||
// base 2
|
||||
index++;
|
||||
|
||||
for (; index < max; index++) {
|
||||
ch = data[index];
|
||||
if (ch === '_') continue;
|
||||
if (ch !== '0' && ch !== '1') return false;
|
||||
hasDigits = true;
|
||||
}
|
||||
return hasDigits && ch !== '_';
|
||||
}
|
||||
|
||||
|
||||
if (ch === 'x') {
|
||||
// base 16
|
||||
index++;
|
||||
|
||||
for (; index < max; index++) {
|
||||
ch = data[index];
|
||||
if (ch === '_') continue;
|
||||
if (!isHexCode(data.charCodeAt(index))) return false;
|
||||
hasDigits = true;
|
||||
}
|
||||
return hasDigits && ch !== '_';
|
||||
}
|
||||
|
||||
|
||||
if (ch === 'o') {
|
||||
// base 8
|
||||
index++;
|
||||
|
||||
for (; index < max; index++) {
|
||||
ch = data[index];
|
||||
if (ch === '_') continue;
|
||||
if (!isOctCode(data.charCodeAt(index))) return false;
|
||||
hasDigits = true;
|
||||
}
|
||||
return hasDigits && ch !== '_';
|
||||
}
|
||||
}
|
||||
|
||||
// base 10 (except 0)
|
||||
|
||||
// value should not start with `_`;
|
||||
if (ch === '_') return false;
|
||||
|
||||
for (; index < max; index++) {
|
||||
ch = data[index];
|
||||
if (ch === '_') continue;
|
||||
if (!isDecCode(data.charCodeAt(index))) {
|
||||
return false;
|
||||
}
|
||||
hasDigits = true;
|
||||
}
|
||||
|
||||
// Should have digits and should not end with `_`
|
||||
if (!hasDigits || ch === '_') return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function constructYamlInteger(data) {
|
||||
var value = data, sign = 1, ch;
|
||||
|
||||
if (value.indexOf('_') !== -1) {
|
||||
value = value.replace(/_/g, '');
|
||||
}
|
||||
|
||||
ch = value[0];
|
||||
|
||||
if (ch === '-' || ch === '+') {
|
||||
if (ch === '-') sign = -1;
|
||||
value = value.slice(1);
|
||||
ch = value[0];
|
||||
}
|
||||
|
||||
if (value === '0') return 0;
|
||||
|
||||
if (ch === '0') {
|
||||
if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);
|
||||
if (value[1] === 'x') return sign * parseInt(value.slice(2), 16);
|
||||
if (value[1] === 'o') return sign * parseInt(value.slice(2), 8);
|
||||
}
|
||||
|
||||
return sign * parseInt(value, 10);
|
||||
}
|
||||
|
||||
function isInteger(object) {
|
||||
return (Object.prototype.toString.call(object)) === '[object Number]' &&
|
||||
(object % 1 === 0 && !common.isNegativeZero(object));
|
||||
}
|
||||
|
||||
module.exports = new Type('tag:yaml.org,2002:int', {
|
||||
kind: 'scalar',
|
||||
resolve: resolveYamlInteger,
|
||||
construct: constructYamlInteger,
|
||||
predicate: isInteger,
|
||||
represent: {
|
||||
binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
|
||||
octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); },
|
||||
decimal: function (obj) { return obj.toString(10); },
|
||||
/* eslint-disable max-len */
|
||||
hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
|
||||
},
|
||||
defaultStyle: 'decimal',
|
||||
styleAliases: {
|
||||
binary: [ 2, 'bin' ],
|
||||
octal: [ 8, 'oct' ],
|
||||
decimal: [ 10, 'dec' ],
|
||||
hexadecimal: [ 16, 'hex' ]
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "8"
|
||||
script:
|
||||
- echo "skipping tests"
|
||||
deploy:
|
||||
skip_cleanup: true
|
||||
provider: npm
|
||||
email: $NPM_USERNAME
|
||||
api_key: $NPM_TOKEN
|
||||
on:
|
||||
branch: master
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAGA,oDAAuC;AAEvC,SAAS,qBAAqB,CAC7B,IAA2D;IAE3D,OAAO,IAAI,eAAgB,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,WAAU,qBAAqB;IAajB,qCAAe,GAAG,eAAgB,CAAC;IAEhD,qBAAqB,CAAC,SAAS,GAAG,eAAgB,CAAC,SAAS,CAAC;AAC9D,CAAC,EAhBS,qBAAqB,KAArB,qBAAqB,QAgB9B;AAED,iBAAS,qBAAqB,CAAC"}
|
||||
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "npm-run-path",
|
||||
"version": "5.1.0",
|
||||
"description": "Get your PATH prepended with locally installed binaries",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/npm-run-path",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": "./index.js",
|
||||
"engines": {
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"npm",
|
||||
"run",
|
||||
"path",
|
||||
"package",
|
||||
"bin",
|
||||
"binary",
|
||||
"binaries",
|
||||
"script",
|
||||
"cli",
|
||||
"command-line",
|
||||
"execute",
|
||||
"executable"
|
||||
],
|
||||
"dependencies": {
|
||||
"path-key": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^3.15.0",
|
||||
"tsd": "^0.17.0",
|
||||
"xo": "^0.45.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"wordwrap","version":"1.0.0","files":{"package.json":{"checkedAt":1678883669892,"integrity":"sha512-I2Z3+nJX6Ld9EHTDcprVBzHHN5S3JgJAW1Ss/BOJ6BXjvjZ5oVUSnvkLtTvqPTl44HQscaw9pcnFPdg8vjY5Xw==","mode":420,"size":650},"index.js":{"checkedAt":1678883669892,"integrity":"sha512-Yf5G9XO9U91dHkR8bMVtghOEtTJVph/iyvwYnJR03nlh1pYCq22lT3ny12qgiAzmB+Aa2lxIbWHXPbNe7z6ZRw==","mode":420,"size":2231},"LICENSE":{"checkedAt":1678883669892,"integrity":"sha512-UYETA37gNUDKrmMFiphSX5pKZ0Jb2MNZb2l77Vrh0gU/5292uFpO77gMxRn3sD02jPS0RSiMTKfKy151I/M5Yg==","mode":420,"size":1073},"README.markdown":{"checkedAt":1678883669892,"integrity":"sha512-JmC5ihLCXz7hmxvYKrTzDAbflMW3ehlHc1MyCASmL0spoMiwsPZedx+BCf4moHZ37AjOfDjTvvM0zrKJqeaHhQ==","mode":420,"size":1827},"example/center.js":{"checkedAt":1678883669892,"integrity":"sha512-KWryQXtdzMVLxO5f9zy8vXZkZJHocywTX6LDqIiHFWeaCOdzDnjJcsMXgkraKcL6fK7WzJQiaEFAz8hzHmcFqQ==","mode":420,"size":374},"example/meat.js":{"checkedAt":1678883669892,"integrity":"sha512-4hBGSHDnB12drCNniuiDRQhWh1udc17PVIigBy2yPEksI3+M8nu/fgIwPMk9ZAse2eUPVIJj8YqHn2NwnURCsw==","mode":420,"size":107},"test/break.js":{"checkedAt":1678883669892,"integrity":"sha512-U5wjDGaSMq5W90e6fuUL3wz3Q2Y5DP5vaz3MEctR94tuD2aXukZCEe9suB4QDowlbNH/EIe1nIjIU9EKut6x7Q==","mode":420,"size":830},"test/wrap.js":{"checkedAt":1678883669892,"integrity":"sha512-+9DXaG4DLCe1HKnud0Ja3QChDNZ29dUh35JQxHzfhagbBKnkyj546sGPQDVoK0GSKrsEDB8FOy3BqTLNtVgQXw==","mode":420,"size":1027},"test/idleness.txt":{"checkedAt":1678883669893,"integrity":"sha512-aGZTZPG0xvJNwXZ3Se/i2fJHeCCDVUzXCLWQ8uqGTW/hYkVEG2GILtHs6WbEBfxSs3mPacr2DF3ZR7LrfXZBIQ==","mode":420,"size":28635}}}
|
||||
@@ -0,0 +1,164 @@
|
||||
'use strict'
|
||||
|
||||
const fs = require('graceful-fs')
|
||||
const path = require('path')
|
||||
const mkdirpSync = require('../mkdirs').mkdirsSync
|
||||
const utimesSync = require('../util/utimes.js').utimesMillisSync
|
||||
const stat = require('../util/stat')
|
||||
|
||||
function copySync (src, dest, opts) {
|
||||
if (typeof opts === 'function') {
|
||||
opts = { filter: opts }
|
||||
}
|
||||
|
||||
opts = opts || {}
|
||||
opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
|
||||
opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber
|
||||
|
||||
// Warn about using preserveTimestamps on 32-bit node
|
||||
if (opts.preserveTimestamps && process.arch === 'ia32') {
|
||||
console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n
|
||||
see https://github.com/jprichardson/node-fs-extra/issues/269`)
|
||||
}
|
||||
|
||||
const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy')
|
||||
stat.checkParentPathsSync(src, srcStat, dest, 'copy')
|
||||
return handleFilterAndCopy(destStat, src, dest, opts)
|
||||
}
|
||||
|
||||
function handleFilterAndCopy (destStat, src, dest, opts) {
|
||||
if (opts.filter && !opts.filter(src, dest)) return
|
||||
const destParent = path.dirname(dest)
|
||||
if (!fs.existsSync(destParent)) mkdirpSync(destParent)
|
||||
return startCopy(destStat, src, dest, opts)
|
||||
}
|
||||
|
||||
function startCopy (destStat, src, dest, opts) {
|
||||
if (opts.filter && !opts.filter(src, dest)) return
|
||||
return getStats(destStat, src, dest, opts)
|
||||
}
|
||||
|
||||
function getStats (destStat, src, dest, opts) {
|
||||
const statSync = opts.dereference ? fs.statSync : fs.lstatSync
|
||||
const srcStat = statSync(src)
|
||||
|
||||
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)
|
||||
else if (srcStat.isFile() ||
|
||||
srcStat.isCharacterDevice() ||
|
||||
srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)
|
||||
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
|
||||
}
|
||||
|
||||
function onFile (srcStat, destStat, src, dest, opts) {
|
||||
if (!destStat) return copyFile(srcStat, src, dest, opts)
|
||||
return mayCopyFile(srcStat, src, dest, opts)
|
||||
}
|
||||
|
||||
function mayCopyFile (srcStat, src, dest, opts) {
|
||||
if (opts.overwrite) {
|
||||
fs.unlinkSync(dest)
|
||||
return copyFile(srcStat, src, dest, opts)
|
||||
} else if (opts.errorOnExist) {
|
||||
throw new Error(`'${dest}' already exists`)
|
||||
}
|
||||
}
|
||||
|
||||
function copyFile (srcStat, src, dest, opts) {
|
||||
if (typeof fs.copyFileSync === 'function') {
|
||||
fs.copyFileSync(src, dest)
|
||||
fs.chmodSync(dest, srcStat.mode)
|
||||
if (opts.preserveTimestamps) {
|
||||
return utimesSync(dest, srcStat.atime, srcStat.mtime)
|
||||
}
|
||||
return
|
||||
}
|
||||
return copyFileFallback(srcStat, src, dest, opts)
|
||||
}
|
||||
|
||||
function copyFileFallback (srcStat, src, dest, opts) {
|
||||
const BUF_LENGTH = 64 * 1024
|
||||
const _buff = require('../util/buffer')(BUF_LENGTH)
|
||||
|
||||
const fdr = fs.openSync(src, 'r')
|
||||
const fdw = fs.openSync(dest, 'w', srcStat.mode)
|
||||
let pos = 0
|
||||
|
||||
while (pos < srcStat.size) {
|
||||
const bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos)
|
||||
fs.writeSync(fdw, _buff, 0, bytesRead)
|
||||
pos += bytesRead
|
||||
}
|
||||
|
||||
if (opts.preserveTimestamps) fs.futimesSync(fdw, srcStat.atime, srcStat.mtime)
|
||||
|
||||
fs.closeSync(fdr)
|
||||
fs.closeSync(fdw)
|
||||
}
|
||||
|
||||
function onDir (srcStat, destStat, src, dest, opts) {
|
||||
if (!destStat) return mkDirAndCopy(srcStat, src, dest, opts)
|
||||
if (destStat && !destStat.isDirectory()) {
|
||||
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)
|
||||
}
|
||||
return copyDir(src, dest, opts)
|
||||
}
|
||||
|
||||
function mkDirAndCopy (srcStat, src, dest, opts) {
|
||||
fs.mkdirSync(dest)
|
||||
copyDir(src, dest, opts)
|
||||
return fs.chmodSync(dest, srcStat.mode)
|
||||
}
|
||||
|
||||
function copyDir (src, dest, opts) {
|
||||
fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts))
|
||||
}
|
||||
|
||||
function copyDirItem (item, src, dest, opts) {
|
||||
const srcItem = path.join(src, item)
|
||||
const destItem = path.join(dest, item)
|
||||
const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy')
|
||||
return startCopy(destStat, srcItem, destItem, opts)
|
||||
}
|
||||
|
||||
function onLink (destStat, src, dest, opts) {
|
||||
let resolvedSrc = fs.readlinkSync(src)
|
||||
if (opts.dereference) {
|
||||
resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
|
||||
}
|
||||
|
||||
if (!destStat) {
|
||||
return fs.symlinkSync(resolvedSrc, dest)
|
||||
} else {
|
||||
let resolvedDest
|
||||
try {
|
||||
resolvedDest = fs.readlinkSync(dest)
|
||||
} catch (err) {
|
||||
// dest exists and is a regular file or directory,
|
||||
// Windows may throw UNKNOWN error. If dest already exists,
|
||||
// fs throws error anyway, so no need to guard against it here.
|
||||
if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)
|
||||
throw err
|
||||
}
|
||||
if (opts.dereference) {
|
||||
resolvedDest = path.resolve(process.cwd(), resolvedDest)
|
||||
}
|
||||
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
||||
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
|
||||
}
|
||||
|
||||
// prevent copy if src is a subdir of dest since unlinking
|
||||
// dest in this case would result in removing src contents
|
||||
// and therefore a broken symlink would be created.
|
||||
if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
||||
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
|
||||
}
|
||||
return copyLink(resolvedSrc, dest)
|
||||
}
|
||||
}
|
||||
|
||||
function copyLink (resolvedSrc, dest) {
|
||||
fs.unlinkSync(dest)
|
||||
return fs.symlinkSync(resolvedSrc, dest)
|
||||
}
|
||||
|
||||
module.exports = copySync
|
||||
Reference in New Issue
Block a user