new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
let flexSpec = require('./flex-spec')
|
||||
let Declaration = require('../declaration')
|
||||
|
||||
class FlexWrap extends Declaration {
|
||||
/**
|
||||
* Don't add prefix for 2009 spec
|
||||
*/
|
||||
set(decl, prefix) {
|
||||
let spec = flexSpec(prefix)[0]
|
||||
if (spec !== 2009) {
|
||||
return super.set(decl, prefix)
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
FlexWrap.names = ['flex-wrap']
|
||||
|
||||
module.exports = FlexWrap
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016 Jordan Harband
|
||||
|
||||
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 @@
|
||||
module.exports = require('./pick');
|
||||
@@ -0,0 +1,134 @@
|
||||
import { Observable } from './Observable';
|
||||
import { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';
|
||||
import { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';
|
||||
import { arrRemove } from './util/arrRemove';
|
||||
import { errorContext } from './util/errorContext';
|
||||
export class Subject extends Observable {
|
||||
constructor() {
|
||||
super();
|
||||
this.closed = false;
|
||||
this.currentObservers = null;
|
||||
this.observers = [];
|
||||
this.isStopped = false;
|
||||
this.hasError = false;
|
||||
this.thrownError = null;
|
||||
}
|
||||
lift(operator) {
|
||||
const subject = new AnonymousSubject(this, this);
|
||||
subject.operator = operator;
|
||||
return subject;
|
||||
}
|
||||
_throwIfClosed() {
|
||||
if (this.closed) {
|
||||
throw new ObjectUnsubscribedError();
|
||||
}
|
||||
}
|
||||
next(value) {
|
||||
errorContext(() => {
|
||||
this._throwIfClosed();
|
||||
if (!this.isStopped) {
|
||||
if (!this.currentObservers) {
|
||||
this.currentObservers = Array.from(this.observers);
|
||||
}
|
||||
for (const observer of this.currentObservers) {
|
||||
observer.next(value);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
error(err) {
|
||||
errorContext(() => {
|
||||
this._throwIfClosed();
|
||||
if (!this.isStopped) {
|
||||
this.hasError = this.isStopped = true;
|
||||
this.thrownError = err;
|
||||
const { observers } = this;
|
||||
while (observers.length) {
|
||||
observers.shift().error(err);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
complete() {
|
||||
errorContext(() => {
|
||||
this._throwIfClosed();
|
||||
if (!this.isStopped) {
|
||||
this.isStopped = true;
|
||||
const { observers } = this;
|
||||
while (observers.length) {
|
||||
observers.shift().complete();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
unsubscribe() {
|
||||
this.isStopped = this.closed = true;
|
||||
this.observers = this.currentObservers = null;
|
||||
}
|
||||
get observed() {
|
||||
var _a;
|
||||
return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
||||
}
|
||||
_trySubscribe(subscriber) {
|
||||
this._throwIfClosed();
|
||||
return super._trySubscribe(subscriber);
|
||||
}
|
||||
_subscribe(subscriber) {
|
||||
this._throwIfClosed();
|
||||
this._checkFinalizedStatuses(subscriber);
|
||||
return this._innerSubscribe(subscriber);
|
||||
}
|
||||
_innerSubscribe(subscriber) {
|
||||
const { hasError, isStopped, observers } = this;
|
||||
if (hasError || isStopped) {
|
||||
return EMPTY_SUBSCRIPTION;
|
||||
}
|
||||
this.currentObservers = null;
|
||||
observers.push(subscriber);
|
||||
return new Subscription(() => {
|
||||
this.currentObservers = null;
|
||||
arrRemove(observers, subscriber);
|
||||
});
|
||||
}
|
||||
_checkFinalizedStatuses(subscriber) {
|
||||
const { hasError, thrownError, isStopped } = this;
|
||||
if (hasError) {
|
||||
subscriber.error(thrownError);
|
||||
}
|
||||
else if (isStopped) {
|
||||
subscriber.complete();
|
||||
}
|
||||
}
|
||||
asObservable() {
|
||||
const observable = new Observable();
|
||||
observable.source = this;
|
||||
return observable;
|
||||
}
|
||||
}
|
||||
Subject.create = (destination, source) => {
|
||||
return new AnonymousSubject(destination, source);
|
||||
};
|
||||
export class AnonymousSubject extends Subject {
|
||||
constructor(destination, source) {
|
||||
super();
|
||||
this.destination = destination;
|
||||
this.source = source;
|
||||
}
|
||||
next(value) {
|
||||
var _a, _b;
|
||||
(_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);
|
||||
}
|
||||
error(err) {
|
||||
var _a, _b;
|
||||
(_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);
|
||||
}
|
||||
complete() {
|
||||
var _a, _b;
|
||||
(_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);
|
||||
}
|
||||
_subscribe(subscriber) {
|
||||
var _a, _b;
|
||||
return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=Subject.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../../../src/internal/observable/merge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAmF9B,MAAM,UAAU,KAAK,CAAC,GAAG,IAA2D;IAClF,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,UAAU,GAAG,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,IAAkC,CAAC;IACnD,OAAO,CAAC,OAAO,CAAC,MAAM;QACpB,CAAC;YACC,KAAK;QACP,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;YACtB,CAAC;gBACC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACvB,CAAC;gBACC,QAAQ,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AACrD,CAAC"}
|
||||
@@ -0,0 +1,4 @@
|
||||
/// <reference types="node" />
|
||||
import type * as fs from 'fs';
|
||||
export declare type Stats = fs.Stats;
|
||||
export declare type ErrnoException = NodeJS.ErrnoException;
|
||||
@@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isHash;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var lengths = {
|
||||
md5: 32,
|
||||
md4: 32,
|
||||
sha1: 40,
|
||||
sha256: 64,
|
||||
sha384: 96,
|
||||
sha512: 128,
|
||||
ripemd128: 32,
|
||||
ripemd160: 40,
|
||||
tiger128: 32,
|
||||
tiger160: 40,
|
||||
tiger192: 48,
|
||||
crc32: 8,
|
||||
crc32b: 8
|
||||
};
|
||||
|
||||
function isHash(str, algorithm) {
|
||||
(0, _assertString.default)(str);
|
||||
var hash = new RegExp("^[a-fA-F0-9]{".concat(lengths[algorithm], "}$"));
|
||||
return hash.test(str);
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
||||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
||||
to[j] = from[i];
|
||||
return to;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.intervalProvider = void 0;
|
||||
exports.intervalProvider = {
|
||||
setInterval: function (handler, timeout) {
|
||||
var args = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
args[_i - 2] = arguments[_i];
|
||||
}
|
||||
var delegate = exports.intervalProvider.delegate;
|
||||
if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {
|
||||
return delegate.setInterval.apply(delegate, __spreadArray([handler, timeout], __read(args)));
|
||||
}
|
||||
return setInterval.apply(void 0, __spreadArray([handler, timeout], __read(args)));
|
||||
},
|
||||
clearInterval: function (handle) {
|
||||
var delegate = exports.intervalProvider.delegate;
|
||||
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);
|
||||
},
|
||||
delegate: undefined,
|
||||
};
|
||||
//# sourceMappingURL=intervalProvider.js.map
|
||||
@@ -0,0 +1,11 @@
|
||||
import assertString from './util/assertString';
|
||||
var localeReg = /^[A-Za-z]{2,4}([_-]([A-Za-z]{4}|[\d]{3}))?([_-]([A-Za-z]{2}|[\d]{3}))?$/;
|
||||
export default function isLocale(str) {
|
||||
assertString(str);
|
||||
|
||||
if (str === 'en_US_POSIX' || str === 'ca_ES_VALENCIA') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return localeReg.test(str);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
let flexSpec = require('./flex-spec')
|
||||
let Declaration = require('../declaration')
|
||||
|
||||
class AlignSelf extends Declaration {
|
||||
check(decl) {
|
||||
return (
|
||||
decl.parent &&
|
||||
!decl.parent.some(i => {
|
||||
return i.prop && i.prop.startsWith('grid-')
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Change property name for 2012 specs
|
||||
*/
|
||||
prefixed(prop, prefix) {
|
||||
let spec
|
||||
;[spec, prefix] = flexSpec(prefix)
|
||||
if (spec === 2012) {
|
||||
return prefix + 'flex-item-align'
|
||||
}
|
||||
return super.prefixed(prop, prefix)
|
||||
}
|
||||
|
||||
/**
|
||||
* Return property name by final spec
|
||||
*/
|
||||
normalize() {
|
||||
return 'align-self'
|
||||
}
|
||||
|
||||
/**
|
||||
* Change value for 2012 spec and ignore prefix for 2009
|
||||
*/
|
||||
set(decl, prefix) {
|
||||
let spec = flexSpec(prefix)[0]
|
||||
if (spec === 2012) {
|
||||
decl.value = AlignSelf.oldValues[decl.value] || decl.value
|
||||
return super.set(decl, prefix)
|
||||
}
|
||||
if (spec === 'final') {
|
||||
return super.set(decl, prefix)
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
AlignSelf.names = ['align-self', 'flex-item-align']
|
||||
|
||||
AlignSelf.oldValues = {
|
||||
'flex-end': 'end',
|
||||
'flex-start': 'start'
|
||||
}
|
||||
|
||||
module.exports = AlignSelf
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Jordan Harband
|
||||
|
||||
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,42 @@
|
||||
{
|
||||
"name": "mimic-fn",
|
||||
"version": "2.1.0",
|
||||
"description": "Make a function mimic another one",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/mimic-fn",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"function",
|
||||
"mimic",
|
||||
"imitate",
|
||||
"rename",
|
||||
"copy",
|
||||
"inherit",
|
||||
"properties",
|
||||
"name",
|
||||
"func",
|
||||
"fn",
|
||||
"set",
|
||||
"infer",
|
||||
"change"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.1",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"elementAt.js","sourceRoot":"","sources":["../../../../src/internal/operators/elementAt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAG1E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAkD9B,MAAM,UAAU,SAAS,CAAW,KAAa,EAAE,YAAgB;IACjE,IAAI,KAAK,GAAG,CAAC,EAAE;QACb,MAAM,IAAI,uBAAuB,EAAE,CAAC;KACrC;IACD,IAAM,eAAe,GAAG,SAAS,CAAC,MAAM,IAAI,CAAC,CAAC;IAC9C,OAAO,UAAC,MAAqB;QAC3B,OAAA,MAAM,CAAC,IAAI,CACT,MAAM,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,KAAK,KAAK,EAAX,CAAW,CAAC,EAC7B,IAAI,CAAC,CAAC,CAAC,EACP,eAAe,CAAC,CAAC,CAAC,cAAc,CAAC,YAAa,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,cAAM,OAAA,IAAI,uBAAuB,EAAE,EAA7B,CAA6B,CAAC,CACpG;IAJD,CAIC,CAAC;AACN,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"QueueAction.d.ts","sourceRoot":"","sources":["../../../../src/internal/scheduler/QueueAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,qBAAa,WAAW,CAAC,CAAC,CAAE,SAAQ,WAAW,CAAC,CAAC,CAAC;IACpC,SAAS,CAAC,SAAS,EAAE,cAAc;IAAE,SAAS,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,IAAI;gBAAxF,SAAS,EAAE,cAAc,EAAY,IAAI,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,IAAI;IAIvG,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,KAAK,GAAE,MAAU,GAAG,YAAY;IAUpD,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG;IAI5C,SAAS,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,EAAE,EAAE,CAAC,EAAE,WAAW,EAAE,KAAK,GAAE,MAAU,GAAG,WAAW;CAkBtG"}
|
||||
@@ -0,0 +1,3 @@
|
||||
.DS_Store
|
||||
/.lintcache
|
||||
/node_modules
|
||||
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
|
||||
var setPrototypeOf = require("es5-ext/object/set-prototype-of")
|
||||
, d = require("d")
|
||||
, Iterator = require("../")
|
||||
, validIterable = require("../valid-iterable")
|
||||
|
||||
, push = Array.prototype.push
|
||||
, defineProperties = Object.defineProperties
|
||||
, IteratorChain;
|
||||
|
||||
IteratorChain = function (iterators) {
|
||||
defineProperties(this, {
|
||||
__iterators__: d("", iterators),
|
||||
__current__: d("w", iterators.shift())
|
||||
});
|
||||
};
|
||||
if (setPrototypeOf) setPrototypeOf(IteratorChain, Iterator);
|
||||
|
||||
IteratorChain.prototype = Object.create(Iterator.prototype, {
|
||||
constructor: d(IteratorChain),
|
||||
next: d(function () {
|
||||
var result;
|
||||
if (!this.__current__) return { done: true, value: undefined };
|
||||
result = this.__current__.next();
|
||||
while (result.done) {
|
||||
this.__current__ = this.__iterators__.shift();
|
||||
if (!this.__current__) return { done: true, value: undefined };
|
||||
result = this.__current__.next();
|
||||
}
|
||||
return result;
|
||||
})
|
||||
});
|
||||
|
||||
module.exports = function () {
|
||||
var iterators = [this];
|
||||
push.apply(iterators, arguments);
|
||||
iterators.forEach(validIterable);
|
||||
return new IteratorChain(iterators);
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('capitalize', require('../capitalize'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "optionator",
|
||||
"version": "0.8.3",
|
||||
"author": "George Zahariev <z@georgezahariev.com>",
|
||||
"description": "option parsing and help generation",
|
||||
"homepage": "https://github.com/gkz/optionator",
|
||||
"keywords": [
|
||||
"options",
|
||||
"flags",
|
||||
"option parsing",
|
||||
"cli"
|
||||
],
|
||||
"files": [
|
||||
"lib",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"main": "./lib/",
|
||||
"bugs": "https://github.com/gkz/optionator/issues",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/gkz/optionator.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
},
|
||||
"dependencies": {
|
||||
"prelude-ls": "~1.1.2",
|
||||
"deep-is": "~0.1.3",
|
||||
"word-wrap": "~1.2.3",
|
||||
"type-check": "~0.3.2",
|
||||
"levn": "~0.3.0",
|
||||
"fast-levenshtein": "~2.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"livescript": "~1.6.0",
|
||||
"mocha": "~6.2.2",
|
||||
"istanbul": "~0.4.5"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
# node-domexception
|
||||
An implementation of the DOMException class from NodeJS
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"publishBehavior.js","sourceRoot":"","sources":["../../../../src/internal/operators/publishBehavior.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAiB5E,MAAM,UAAU,eAAe,CAAI,YAAe;IAEhD,OAAO,UAAC,MAAM;QACZ,IAAM,OAAO,GAAG,IAAI,eAAe,CAAI,YAAY,CAAC,CAAC;QACrD,OAAO,IAAI,qBAAqB,CAAC,MAAM,EAAE,cAAM,OAAA,OAAO,EAAP,CAAO,CAAC,CAAC;IAC1D,CAAC,CAAC;AACJ,CAAC"}
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').transformLimit;
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"gopd","version":"1.0.1","files":{"LICENSE":{"checkedAt":1678883671602,"integrity":"sha512-zSWZlPMHqdrYcu0iKn0DZJ7EU8PHWsyOsYC+m2L4TRgwzvU+9Xsi8DCgqVoMt3xcoyvGCZp05dGObt+3xshLBw==","mode":420,"size":1071},".eslintrc":{"checkedAt":1678883671602,"integrity":"sha512-rCwUGz2SF8ZHDbpQR0buZcONJl4ioFUNgvlnfKrRmimktzqAHxHEz6XJgejIK5NvhSUXYiayLmQh11FaeqhQcQ==","mode":420,"size":224},"test/index.js":{"checkedAt":1678883671602,"integrity":"sha512-LeYoZ0HBUbTQuYCl2EB2133RRxh822RAIjp2IyuXiXENLhO1CDhvwFkMg1YybO5Af6UkFzsL+q1jTxmfy+S19Q==","mode":420,"size":590},"index.js":{"checkedAt":1678883671602,"integrity":"sha512-uYo/MqDyGX8n0rPvZfQOXLHtVOBvYXxUQZtLSfymkdqoRLKSBJKKpUTZT3ilxpzJDtY6BKtKEMSCndesBnzx5w==","mode":420,"size":263},"CHANGELOG.md":{"checkedAt":1678883671602,"integrity":"sha512-bmQ3E6niJZtsZsE90DLXKhwjFLKOYmlrVD/qf2AHHFBM2cF6yrISTuUR1Za65Z5qglMOX9cmK1a+NWQiLhL4nw==","mode":420,"size":1541},"README.md":{"checkedAt":1678883671602,"integrity":"sha512-ve9AVfdNSvYzfu1NI8F2T5dUStIWFuQNJ1CvZKc+4A/reBvJyCsTLD1Ri/hwxAIcF2n08WNHyNtm0SSFmENQsg==","mode":420,"size":1562},"package.json":{"checkedAt":1678883671602,"integrity":"sha512-oy8KFP+jLCBZcDM2RaJP01PkKpZVcqcIJqRdHOFFoNQd3cHJEA2o3XmKxfeFOF5tD0xenoL4fBDfTmOtjDQqRA==","mode":420,"size":1877},".github/FUNDING.yml":{"checkedAt":1678883671602,"integrity":"sha512-CKADxNHrg4lcKXGnn+4J7l0qN80KpI+rI9psJU608N8CEiuTaT73I83gYIzlATQvn/jBFYvOma+6olIJZlyQAQ==","mode":420,"size":575}}}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"8":"J D E F A B CC"},B:{"1":"L G M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","2":"C K"},C:{"1":"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","8":"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 EC FC"},D:{"1":"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","8":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB"},E:{"1":"B C K L G 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","8":"I v J D E F A HC zB IC JC KC LC"},F:{"1":"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","8":"0 1 2 3 4 5 6 7 8 9 F B C G M N O w g x y z AB BB CB DB EB FB GB PC QC RC SC qB AC TC rB"},G:{"1":"cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","8":"E zB UC BC VC WC XC YC ZC aC bC"},H:{"8":"oC"},I:{"1":"f","8":"tB I pC qC rC sC BC tC uC"},J:{"8":"D A"},K:{"1":"h","8":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"8":"A B"},O:{"1":"vC"},P:{"1":"g xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C","8":"I wC"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:6,C:"Object.values method"};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AsyncSubject.js","sourceRoot":"","sources":["../../../src/internal/AsyncSubject.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,qCAAoC;AASpC;IAAqC,gCAAU;IAA/C;QAAA,qEA+BC;QA9BS,YAAM,GAAa,IAAI,CAAC;QACxB,eAAS,GAAG,KAAK,CAAC;QAClB,iBAAW,GAAG,KAAK,CAAC;;IA4B9B,CAAC;IAzBW,8CAAuB,GAAjC,UAAkC,UAAyB;QACnD,IAAA,KAAuE,IAAI,EAAzE,QAAQ,cAAA,EAAE,SAAS,eAAA,EAAE,MAAM,YAAA,EAAE,WAAW,iBAAA,EAAE,SAAS,eAAA,EAAE,WAAW,iBAAS,CAAC;QAClF,IAAI,QAAQ,EAAE;YACZ,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;SAC/B;aAAM,IAAI,SAAS,IAAI,WAAW,EAAE;YACnC,SAAS,IAAI,UAAU,CAAC,IAAI,CAAC,MAAO,CAAC,CAAC;YACtC,UAAU,CAAC,QAAQ,EAAE,CAAC;SACvB;IACH,CAAC;IAED,2BAAI,GAAJ,UAAK,KAAQ;QACX,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;YACpB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;SACvB;IACH,CAAC;IAED,+BAAQ,GAAR;QACQ,IAAA,KAAqC,IAAI,EAAvC,SAAS,eAAA,EAAE,MAAM,YAAA,EAAE,WAAW,iBAAS,CAAC;QAChD,IAAI,CAAC,WAAW,EAAE;YAChB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,SAAS,IAAI,iBAAM,IAAI,YAAC,MAAO,CAAC,CAAC;YACjC,iBAAM,QAAQ,WAAE,CAAC;SAClB;IACH,CAAC;IACH,mBAAC;AAAD,CAAC,AA/BD,CAAqC,iBAAO,GA+B3C;AA/BY,oCAAY"}
|
||||
@@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
|
||||
var isGlob = require('is-glob');
|
||||
var pathPosixDirname = require('path').posix.dirname;
|
||||
var isWin32 = require('os').platform() === 'win32';
|
||||
|
||||
var slash = '/';
|
||||
var backslash = /\\/g;
|
||||
var enclosure = /[\{\[].*[\}\]]$/;
|
||||
var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
|
||||
var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
|
||||
|
||||
/**
|
||||
* @param {string} str
|
||||
* @param {Object} opts
|
||||
* @param {boolean} [opts.flipBackslashes=true]
|
||||
* @returns {string}
|
||||
*/
|
||||
module.exports = function globParent(str, opts) {
|
||||
var options = Object.assign({ flipBackslashes: true }, opts);
|
||||
|
||||
// flip windows path separators
|
||||
if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
|
||||
str = str.replace(backslash, slash);
|
||||
}
|
||||
|
||||
// special case for strings ending in enclosure containing path separator
|
||||
if (enclosure.test(str)) {
|
||||
str += slash;
|
||||
}
|
||||
|
||||
// preserves full path in case of trailing path separator
|
||||
str += 'a';
|
||||
|
||||
// remove path parts that are globby
|
||||
do {
|
||||
str = pathPosixDirname(str);
|
||||
} while (isGlob(str) || globby.test(str));
|
||||
|
||||
// remove escape chars and return result
|
||||
return str.replace(escaped, '$1');
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AjaxResponse = void 0;
|
||||
var getXHRResponse_1 = require("./getXHRResponse");
|
||||
var AjaxResponse = (function () {
|
||||
function AjaxResponse(originalEvent, xhr, request, type) {
|
||||
if (type === void 0) { type = 'download_load'; }
|
||||
this.originalEvent = originalEvent;
|
||||
this.xhr = xhr;
|
||||
this.request = request;
|
||||
this.type = type;
|
||||
var status = xhr.status, responseType = xhr.responseType;
|
||||
this.status = status !== null && status !== void 0 ? status : 0;
|
||||
this.responseType = responseType !== null && responseType !== void 0 ? responseType : '';
|
||||
var allHeaders = xhr.getAllResponseHeaders();
|
||||
this.responseHeaders = allHeaders
|
||||
?
|
||||
allHeaders.split('\n').reduce(function (headers, line) {
|
||||
var index = line.indexOf(': ');
|
||||
headers[line.slice(0, index)] = line.slice(index + 2);
|
||||
return headers;
|
||||
}, {})
|
||||
: {};
|
||||
this.response = getXHRResponse_1.getXHRResponse(xhr);
|
||||
var loaded = originalEvent.loaded, total = originalEvent.total;
|
||||
this.loaded = loaded;
|
||||
this.total = total;
|
||||
}
|
||||
return AjaxResponse;
|
||||
}());
|
||||
exports.AjaxResponse = AjaxResponse;
|
||||
//# sourceMappingURL=AjaxResponse.js.map
|
||||
@@ -0,0 +1,3 @@
|
||||
# esbuild
|
||||
|
||||
This is a JavaScript bundler and minifier. See https://github.com/evanw/esbuild and the [JavaScript API documentation](https://esbuild.github.io/api/) for details.
|
||||
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LookupSupportedLocales = void 0;
|
||||
var utils_1 = require("./utils");
|
||||
var BestAvailableLocale_1 = require("./BestAvailableLocale");
|
||||
/**
|
||||
* https://tc39.es/ecma402/#sec-lookupsupportedlocales
|
||||
* @param availableLocales
|
||||
* @param requestedLocales
|
||||
*/
|
||||
function LookupSupportedLocales(availableLocales, requestedLocales) {
|
||||
var subset = [];
|
||||
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
||||
var locale = requestedLocales_1[_i];
|
||||
var noExtensionLocale = locale.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, '');
|
||||
var availableLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(availableLocales, noExtensionLocale);
|
||||
if (availableLocale) {
|
||||
subset.push(availableLocale);
|
||||
}
|
||||
}
|
||||
return subset;
|
||||
}
|
||||
exports.LookupSupportedLocales = LookupSupportedLocales;
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('result', require('../result'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"zip.js","sourceRoot":"","sources":["../../../../src/internal/operators/zip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAmBvC,MAAM,UAAU,GAAG,CAAO,GAAG,OAAqE;IAChG,OAAO,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACpC,SAAS,CAAC,MAA8B,EAAE,GAAI,OAAuC,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC/G,CAAC,CAAC,CAAC;AACL,CAAC"}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { mergeMap } from './mergeMap';
|
||||
import { isFunction } from '../util/isFunction';
|
||||
export function mergeMapTo(innerObservable, resultSelector, concurrent = Infinity) {
|
||||
if (isFunction(resultSelector)) {
|
||||
return mergeMap(() => innerObservable, resultSelector, concurrent);
|
||||
}
|
||||
if (typeof resultSelector === 'number') {
|
||||
concurrent = resultSelector;
|
||||
}
|
||||
return mergeMap(() => innerObservable, concurrent);
|
||||
}
|
||||
//# sourceMappingURL=mergeMapTo.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"hmac.js","sourceRoot":"","sources":["src/hmac.ts"],"names":[],"mappings":"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"}
|
||||
@@ -0,0 +1,92 @@
|
||||
# js-wmf
|
||||
|
||||
Processor for Windows MetaFile (WMF) files in JS (for the browser and nodejs).
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
With [npm](https://www.npmjs.org/package/wmf):
|
||||
|
||||
```bash
|
||||
$ npm install wmf
|
||||
```
|
||||
|
||||
In the browser:
|
||||
|
||||
```html
|
||||
<script src="wmf.js"></script>
|
||||
```
|
||||
|
||||
The browser exposes a variable `WMF`.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
The `data` argument is expected to be an `ArrayBuffer`, `Uint8Array` or `Buffer`
|
||||
|
||||
- `WMF.image_size(data)` extracts the image offset and extents, returns an Array
|
||||
`[width, height]` where both metrics are measured in pixels.
|
||||
|
||||
- `WMF.draw_canvas(data, canvas)` parses the WMF and draws to a `Canvas`.
|
||||
|
||||
### Notes
|
||||
|
||||
- The library assumes the global `ImageData` is available. For nodejs-powered
|
||||
canvas implementations, a shim must be exposed as a global. Using the `canvas`
|
||||
npm package:
|
||||
|
||||
```js
|
||||
const { createImageData } = require("canvas");
|
||||
global.ImageData = createImageData;
|
||||
```
|
||||
|
||||
- `OffscreenCanvas` in Chrome and some other Canvas implementations require
|
||||
the dimensions in the constructor:
|
||||
|
||||
```js
|
||||
const size = WMF.image_size(data);
|
||||
const canvas = new OffscreenCanvas(size[0], size[1]);
|
||||
```
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
<details>
|
||||
<summary><b>Browser Fetch into canvas</b> (click to show)</summary>
|
||||
|
||||
```js
|
||||
// assume `canvas` is a DOM element
|
||||
(async() => {
|
||||
const res = await fetch("url/for/image.wmf");
|
||||
const ab = await res.arrayBuffer();
|
||||
WMF.draw_canvas(ab, document.getElementById("canvas"));
|
||||
})();
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>NodeJS (using `canvas` npm module)</b> (click to show)</summary>
|
||||
|
||||
```js
|
||||
const { createCanvas, createImageData } = require("canvas");
|
||||
global.ImageData = createImageData;
|
||||
|
||||
const size = WMF.image_size(data);
|
||||
const canvas = createCanvas(size[0], size[1]);
|
||||
WMF.draw_canvas(data, canvas);
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Please consult the attached LICENSE file for details. All rights not explicitly
|
||||
granted by the Apache 2.0 License are reserved by the Original Author.
|
||||
|
||||
|
||||
## References
|
||||
|
||||
- `MS-WMF`: Windows Metafile Format
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
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,231 @@
|
||||
import { SHA2 } from './_sha2.js';
|
||||
import u64 from './_u64.js';
|
||||
import { wrapConstructor } from './utils.js';
|
||||
// Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409):
|
||||
// prettier-ignore
|
||||
const [SHA512_Kh, SHA512_Kl] = u64.split([
|
||||
'0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',
|
||||
'0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',
|
||||
'0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',
|
||||
'0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',
|
||||
'0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',
|
||||
'0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',
|
||||
'0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',
|
||||
'0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',
|
||||
'0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',
|
||||
'0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',
|
||||
'0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',
|
||||
'0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',
|
||||
'0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',
|
||||
'0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',
|
||||
'0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',
|
||||
'0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',
|
||||
'0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',
|
||||
'0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',
|
||||
'0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',
|
||||
'0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'
|
||||
].map(n => BigInt(n)));
|
||||
// Temporary buffer, not used to store anything between runs
|
||||
const SHA512_W_H = new Uint32Array(80);
|
||||
const SHA512_W_L = new Uint32Array(80);
|
||||
export class SHA512 extends SHA2 {
|
||||
constructor() {
|
||||
super(128, 64, 16, false);
|
||||
// We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers.
|
||||
// Also looks cleaner and easier to verify with spec.
|
||||
// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):
|
||||
// h -- high 32 bits, l -- low 32 bits
|
||||
this.Ah = 0x6a09e667 | 0;
|
||||
this.Al = 0xf3bcc908 | 0;
|
||||
this.Bh = 0xbb67ae85 | 0;
|
||||
this.Bl = 0x84caa73b | 0;
|
||||
this.Ch = 0x3c6ef372 | 0;
|
||||
this.Cl = 0xfe94f82b | 0;
|
||||
this.Dh = 0xa54ff53a | 0;
|
||||
this.Dl = 0x5f1d36f1 | 0;
|
||||
this.Eh = 0x510e527f | 0;
|
||||
this.El = 0xade682d1 | 0;
|
||||
this.Fh = 0x9b05688c | 0;
|
||||
this.Fl = 0x2b3e6c1f | 0;
|
||||
this.Gh = 0x1f83d9ab | 0;
|
||||
this.Gl = 0xfb41bd6b | 0;
|
||||
this.Hh = 0x5be0cd19 | 0;
|
||||
this.Hl = 0x137e2179 | 0;
|
||||
}
|
||||
// prettier-ignore
|
||||
get() {
|
||||
const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
|
||||
return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];
|
||||
}
|
||||
// prettier-ignore
|
||||
set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {
|
||||
this.Ah = Ah | 0;
|
||||
this.Al = Al | 0;
|
||||
this.Bh = Bh | 0;
|
||||
this.Bl = Bl | 0;
|
||||
this.Ch = Ch | 0;
|
||||
this.Cl = Cl | 0;
|
||||
this.Dh = Dh | 0;
|
||||
this.Dl = Dl | 0;
|
||||
this.Eh = Eh | 0;
|
||||
this.El = El | 0;
|
||||
this.Fh = Fh | 0;
|
||||
this.Fl = Fl | 0;
|
||||
this.Gh = Gh | 0;
|
||||
this.Gl = Gl | 0;
|
||||
this.Hh = Hh | 0;
|
||||
this.Hl = Hl | 0;
|
||||
}
|
||||
process(view, offset) {
|
||||
// Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array
|
||||
for (let i = 0; i < 16; i++, offset += 4) {
|
||||
SHA512_W_H[i] = view.getUint32(offset);
|
||||
SHA512_W_L[i] = view.getUint32((offset += 4));
|
||||
}
|
||||
for (let i = 16; i < 80; i++) {
|
||||
// s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)
|
||||
const W15h = SHA512_W_H[i - 15] | 0;
|
||||
const W15l = SHA512_W_L[i - 15] | 0;
|
||||
const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);
|
||||
const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);
|
||||
// s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)
|
||||
const W2h = SHA512_W_H[i - 2] | 0;
|
||||
const W2l = SHA512_W_L[i - 2] | 0;
|
||||
const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);
|
||||
const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);
|
||||
// SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];
|
||||
const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
|
||||
const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
|
||||
SHA512_W_H[i] = SUMh | 0;
|
||||
SHA512_W_L[i] = SUMl | 0;
|
||||
}
|
||||
let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
|
||||
// Compression function main loop, 80 rounds
|
||||
for (let i = 0; i < 80; i++) {
|
||||
// S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)
|
||||
const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);
|
||||
const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);
|
||||
//const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;
|
||||
const CHIh = (Eh & Fh) ^ (~Eh & Gh);
|
||||
const CHIl = (El & Fl) ^ (~El & Gl);
|
||||
// T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]
|
||||
// prettier-ignore
|
||||
const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
|
||||
const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
|
||||
const T1l = T1ll | 0;
|
||||
// S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)
|
||||
const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);
|
||||
const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);
|
||||
const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);
|
||||
const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);
|
||||
Hh = Gh | 0;
|
||||
Hl = Gl | 0;
|
||||
Gh = Fh | 0;
|
||||
Gl = Fl | 0;
|
||||
Fh = Eh | 0;
|
||||
Fl = El | 0;
|
||||
({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
|
||||
Dh = Ch | 0;
|
||||
Dl = Cl | 0;
|
||||
Ch = Bh | 0;
|
||||
Cl = Bl | 0;
|
||||
Bh = Ah | 0;
|
||||
Bl = Al | 0;
|
||||
const All = u64.add3L(T1l, sigma0l, MAJl);
|
||||
Ah = u64.add3H(All, T1h, sigma0h, MAJh);
|
||||
Al = All | 0;
|
||||
}
|
||||
// Add the compressed chunk to the current hash value
|
||||
({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
|
||||
({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
|
||||
({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
|
||||
({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
|
||||
({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
|
||||
({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
|
||||
({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
|
||||
({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
|
||||
this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);
|
||||
}
|
||||
roundClean() {
|
||||
SHA512_W_H.fill(0);
|
||||
SHA512_W_L.fill(0);
|
||||
}
|
||||
destroy() {
|
||||
this.buffer.fill(0);
|
||||
this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
class SHA512_224 extends SHA512 {
|
||||
constructor() {
|
||||
super();
|
||||
// h -- high 32 bits, l -- low 32 bits
|
||||
this.Ah = 0x8c3d37c8 | 0;
|
||||
this.Al = 0x19544da2 | 0;
|
||||
this.Bh = 0x73e19966 | 0;
|
||||
this.Bl = 0x89dcd4d6 | 0;
|
||||
this.Ch = 0x1dfab7ae | 0;
|
||||
this.Cl = 0x32ff9c82 | 0;
|
||||
this.Dh = 0x679dd514 | 0;
|
||||
this.Dl = 0x582f9fcf | 0;
|
||||
this.Eh = 0x0f6d2b69 | 0;
|
||||
this.El = 0x7bd44da8 | 0;
|
||||
this.Fh = 0x77e36f73 | 0;
|
||||
this.Fl = 0x04c48942 | 0;
|
||||
this.Gh = 0x3f9d85a8 | 0;
|
||||
this.Gl = 0x6a1d36c8 | 0;
|
||||
this.Hh = 0x1112e6ad | 0;
|
||||
this.Hl = 0x91d692a1 | 0;
|
||||
this.outputLen = 28;
|
||||
}
|
||||
}
|
||||
class SHA512_256 extends SHA512 {
|
||||
constructor() {
|
||||
super();
|
||||
// h -- high 32 bits, l -- low 32 bits
|
||||
this.Ah = 0x22312194 | 0;
|
||||
this.Al = 0xfc2bf72c | 0;
|
||||
this.Bh = 0x9f555fa3 | 0;
|
||||
this.Bl = 0xc84c64c2 | 0;
|
||||
this.Ch = 0x2393b86b | 0;
|
||||
this.Cl = 0x6f53b151 | 0;
|
||||
this.Dh = 0x96387719 | 0;
|
||||
this.Dl = 0x5940eabd | 0;
|
||||
this.Eh = 0x96283ee2 | 0;
|
||||
this.El = 0xa88effe3 | 0;
|
||||
this.Fh = 0xbe5e1e25 | 0;
|
||||
this.Fl = 0x53863992 | 0;
|
||||
this.Gh = 0x2b0199fc | 0;
|
||||
this.Gl = 0x2c85b8aa | 0;
|
||||
this.Hh = 0x0eb72ddc | 0;
|
||||
this.Hl = 0x81c52ca2 | 0;
|
||||
this.outputLen = 32;
|
||||
}
|
||||
}
|
||||
class SHA384 extends SHA512 {
|
||||
constructor() {
|
||||
super();
|
||||
// h -- high 32 bits, l -- low 32 bits
|
||||
this.Ah = 0xcbbb9d5d | 0;
|
||||
this.Al = 0xc1059ed8 | 0;
|
||||
this.Bh = 0x629a292a | 0;
|
||||
this.Bl = 0x367cd507 | 0;
|
||||
this.Ch = 0x9159015a | 0;
|
||||
this.Cl = 0x3070dd17 | 0;
|
||||
this.Dh = 0x152fecd8 | 0;
|
||||
this.Dl = 0xf70e5939 | 0;
|
||||
this.Eh = 0x67332667 | 0;
|
||||
this.El = 0xffc00b31 | 0;
|
||||
this.Fh = 0x8eb44a87 | 0;
|
||||
this.Fl = 0x68581511 | 0;
|
||||
this.Gh = 0xdb0c2e0d | 0;
|
||||
this.Gl = 0x64f98fa7 | 0;
|
||||
this.Hh = 0x47b5481d | 0;
|
||||
this.Hl = 0xbefa4fa4 | 0;
|
||||
this.outputLen = 48;
|
||||
}
|
||||
}
|
||||
export const sha512 = wrapConstructor(() => new SHA512());
|
||||
export const sha512_224 = wrapConstructor(() => new SHA512_224());
|
||||
export const sha512_256 = wrapConstructor(() => new SHA512_256());
|
||||
export const sha384 = wrapConstructor(() => new SHA384());
|
||||
//# sourceMappingURL=sha512.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"endWith.js","sourceRoot":"","sources":["../../../../src/internal/operators/endWith.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEA,+CAA8C;AAC9C,uCAAsC;AA8DtC,SAAgB,OAAO;IAAI,gBAAmC;SAAnC,UAAmC,EAAnC,qBAAmC,EAAnC,IAAmC;QAAnC,2BAAmC;;IAC5D,OAAO,UAAC,MAAqB,IAAK,OAAA,eAAM,CAAC,MAAM,EAAE,OAAE,wCAAI,MAAM,IAAmB,EAA9C,CAA8C,CAAC;AACnF,CAAC;AAFD,0BAEC"}
|
||||
@@ -0,0 +1,12 @@
|
||||
var test = require('tap').test;
|
||||
var detective = require('../');
|
||||
var fs = require('fs');
|
||||
var src = fs.readFileSync(__dirname + '/files/word.js');
|
||||
|
||||
test('word', function (t) {
|
||||
t.deepEqual(
|
||||
detective(src, { word : 'load' }),
|
||||
[ 'a', 'b', 'c', 'events', 'doom', 'y', 'events2' ]
|
||||
);
|
||||
t.end();
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "baz",
|
||||
"main": "quux.js"
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var CodePointAt = require('./CodePointAt');
|
||||
var IsIntegralNumber = require('./IsIntegralNumber');
|
||||
var Type = require('./Type');
|
||||
|
||||
var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
// https://262.ecma-international.org/12.0/#sec-advancestringindex
|
||||
|
||||
module.exports = function AdvanceStringIndex(S, index, unicode) {
|
||||
if (Type(S) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `S` must be a String');
|
||||
}
|
||||
if (!IsIntegralNumber(index) || index < 0 || index > MAX_SAFE_INTEGER) {
|
||||
throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53');
|
||||
}
|
||||
if (Type(unicode) !== 'Boolean') {
|
||||
throw new $TypeError('Assertion failed: `unicode` must be a Boolean');
|
||||
}
|
||||
if (!unicode) {
|
||||
return index + 1;
|
||||
}
|
||||
var length = S.length;
|
||||
if ((index + 1) >= length) {
|
||||
return index + 1;
|
||||
}
|
||||
var cp = CodePointAt(S, index);
|
||||
return index + cp['[[CodeUnitCount]]'];
|
||||
};
|
||||
@@ -0,0 +1,266 @@
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isVAT;
|
||||
exports.vatMatchers = void 0;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
var algorithms = _interopRequireWildcard(require("./util/algorithms"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var PT = function PT(str) {
|
||||
var match = str.match(/^(PT)?(\d{9})$/);
|
||||
|
||||
if (!match) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var tin = match[2];
|
||||
var checksum = 11 - algorithms.reverseMultiplyAndSum(tin.split('').slice(0, 8).map(function (a) {
|
||||
return parseInt(a, 10);
|
||||
}), 9) % 11;
|
||||
|
||||
if (checksum > 9) {
|
||||
return parseInt(tin[8], 10) === 0;
|
||||
}
|
||||
|
||||
return checksum === parseInt(tin[8], 10);
|
||||
};
|
||||
|
||||
var vatMatchers = {
|
||||
/**
|
||||
* European Union VAT identification numbers
|
||||
*/
|
||||
AT: function AT(str) {
|
||||
return /^(AT)?U\d{8}$/.test(str);
|
||||
},
|
||||
BE: function BE(str) {
|
||||
return /^(BE)?\d{10}$/.test(str);
|
||||
},
|
||||
BG: function BG(str) {
|
||||
return /^(BG)?\d{9,10}$/.test(str);
|
||||
},
|
||||
HR: function HR(str) {
|
||||
return /^(HR)?\d{11}$/.test(str);
|
||||
},
|
||||
CY: function CY(str) {
|
||||
return /^(CY)?\w{9}$/.test(str);
|
||||
},
|
||||
CZ: function CZ(str) {
|
||||
return /^(CZ)?\d{8,10}$/.test(str);
|
||||
},
|
||||
DK: function DK(str) {
|
||||
return /^(DK)?\d{8}$/.test(str);
|
||||
},
|
||||
EE: function EE(str) {
|
||||
return /^(EE)?\d{9}$/.test(str);
|
||||
},
|
||||
FI: function FI(str) {
|
||||
return /^(FI)?\d{8}$/.test(str);
|
||||
},
|
||||
FR: function FR(str) {
|
||||
return /^(FR)?\w{2}\d{9}$/.test(str);
|
||||
},
|
||||
DE: function DE(str) {
|
||||
return /^(DE)?\d{9}$/.test(str);
|
||||
},
|
||||
EL: function EL(str) {
|
||||
return /^(EL)?\d{9}$/.test(str);
|
||||
},
|
||||
HU: function HU(str) {
|
||||
return /^(HU)?\d{8}$/.test(str);
|
||||
},
|
||||
IE: function IE(str) {
|
||||
return /^(IE)?\d{7}\w{1}(W)?$/.test(str);
|
||||
},
|
||||
IT: function IT(str) {
|
||||
return /^(IT)?\d{11}$/.test(str);
|
||||
},
|
||||
LV: function LV(str) {
|
||||
return /^(LV)?\d{11}$/.test(str);
|
||||
},
|
||||
LT: function LT(str) {
|
||||
return /^(LT)?\d{9,12}$/.test(str);
|
||||
},
|
||||
LU: function LU(str) {
|
||||
return /^(LU)?\d{8}$/.test(str);
|
||||
},
|
||||
MT: function MT(str) {
|
||||
return /^(MT)?\d{8}$/.test(str);
|
||||
},
|
||||
NL: function NL(str) {
|
||||
return /^(NL)?\d{9}B\d{2}$/.test(str);
|
||||
},
|
||||
PL: function PL(str) {
|
||||
return /^(PL)?(\d{10}|(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3}))$/.test(str);
|
||||
},
|
||||
PT: PT,
|
||||
RO: function RO(str) {
|
||||
return /^(RO)?\d{2,10}$/.test(str);
|
||||
},
|
||||
SK: function SK(str) {
|
||||
return /^(SK)?\d{10}$/.test(str);
|
||||
},
|
||||
SI: function SI(str) {
|
||||
return /^(SI)?\d{8}$/.test(str);
|
||||
},
|
||||
ES: function ES(str) {
|
||||
return /^(ES)?\w\d{7}[A-Z]$/.test(str);
|
||||
},
|
||||
SE: function SE(str) {
|
||||
return /^(SE)?\d{12}$/.test(str);
|
||||
},
|
||||
|
||||
/**
|
||||
* VAT numbers of non-EU countries
|
||||
*/
|
||||
AL: function AL(str) {
|
||||
return /^(AL)?\w{9}[A-Z]$/.test(str);
|
||||
},
|
||||
MK: function MK(str) {
|
||||
return /^(MK)?\d{13}$/.test(str);
|
||||
},
|
||||
AU: function AU(str) {
|
||||
return /^(AU)?\d{11}$/.test(str);
|
||||
},
|
||||
BY: function BY(str) {
|
||||
return /^(УНП )?\d{9}$/.test(str);
|
||||
},
|
||||
CA: function CA(str) {
|
||||
return /^(CA)?\d{9}$/.test(str);
|
||||
},
|
||||
IS: function IS(str) {
|
||||
return /^(IS)?\d{5,6}$/.test(str);
|
||||
},
|
||||
IN: function IN(str) {
|
||||
return /^(IN)?\d{15}$/.test(str);
|
||||
},
|
||||
ID: function ID(str) {
|
||||
return /^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(str);
|
||||
},
|
||||
IL: function IL(str) {
|
||||
return /^(IL)?\d{9}$/.test(str);
|
||||
},
|
||||
KZ: function KZ(str) {
|
||||
return /^(KZ)?\d{9}$/.test(str);
|
||||
},
|
||||
NZ: function NZ(str) {
|
||||
return /^(NZ)?\d{9}$/.test(str);
|
||||
},
|
||||
NG: function NG(str) {
|
||||
return /^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(str);
|
||||
},
|
||||
NO: function NO(str) {
|
||||
return /^(NO)?\d{9}MVA$/.test(str);
|
||||
},
|
||||
PH: function PH(str) {
|
||||
return /^(PH)?(\d{12}|\d{3} \d{3} \d{3} \d{3})$/.test(str);
|
||||
},
|
||||
RU: function RU(str) {
|
||||
return /^(RU)?(\d{10}|\d{12})$/.test(str);
|
||||
},
|
||||
SM: function SM(str) {
|
||||
return /^(SM)?\d{5}$/.test(str);
|
||||
},
|
||||
SA: function SA(str) {
|
||||
return /^(SA)?\d{15}$/.test(str);
|
||||
},
|
||||
RS: function RS(str) {
|
||||
return /^(RS)?\d{9}$/.test(str);
|
||||
},
|
||||
CH: function CH(str) {
|
||||
return /^(CH)?(\d{6}|\d{9}|(\d{3}.\d{3})|(\d{3}.\d{3}.\d{3}))(TVA|MWST|IVA)$/.test(str);
|
||||
},
|
||||
TR: function TR(str) {
|
||||
return /^(TR)?\d{10}$/.test(str);
|
||||
},
|
||||
UA: function UA(str) {
|
||||
return /^(UA)?\d{12}$/.test(str);
|
||||
},
|
||||
GB: function GB(str) {
|
||||
return /^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/.test(str);
|
||||
},
|
||||
UZ: function UZ(str) {
|
||||
return /^(UZ)?\d{9}$/.test(str);
|
||||
},
|
||||
|
||||
/**
|
||||
* VAT numbers of Latin American countries
|
||||
*/
|
||||
AR: function AR(str) {
|
||||
return /^(AR)?\d{11}$/.test(str);
|
||||
},
|
||||
BO: function BO(str) {
|
||||
return /^(BO)?\d{7}$/.test(str);
|
||||
},
|
||||
BR: function BR(str) {
|
||||
return /^(BR)?((\d{2}.\d{3}.\d{3}\/\d{4}-\d{2})|(\d{3}.\d{3}.\d{3}-\d{2}))$/.test(str);
|
||||
},
|
||||
CL: function CL(str) {
|
||||
return /^(CL)?\d{8}-\d{1}$/.test(str);
|
||||
},
|
||||
CO: function CO(str) {
|
||||
return /^(CO)?\d{10}$/.test(str);
|
||||
},
|
||||
CR: function CR(str) {
|
||||
return /^(CR)?\d{9,12}$/.test(str);
|
||||
},
|
||||
EC: function EC(str) {
|
||||
return /^(EC)?\d{13}$/.test(str);
|
||||
},
|
||||
SV: function SV(str) {
|
||||
return /^(SV)?\d{4}-\d{6}-\d{3}-\d{1}$/.test(str);
|
||||
},
|
||||
GT: function GT(str) {
|
||||
return /^(GT)?\d{7}-\d{1}$/.test(str);
|
||||
},
|
||||
HN: function HN(str) {
|
||||
return /^(HN)?$/.test(str);
|
||||
},
|
||||
MX: function MX(str) {
|
||||
return /^(MX)?\w{3,4}\d{6}\w{3}$/.test(str);
|
||||
},
|
||||
NI: function NI(str) {
|
||||
return /^(NI)?\d{3}-\d{6}-\d{4}\w{1}$/.test(str);
|
||||
},
|
||||
PA: function PA(str) {
|
||||
return /^(PA)?$/.test(str);
|
||||
},
|
||||
PY: function PY(str) {
|
||||
return /^(PY)?\d{6,8}-\d{1}$/.test(str);
|
||||
},
|
||||
PE: function PE(str) {
|
||||
return /^(PE)?\d{11}$/.test(str);
|
||||
},
|
||||
DO: function DO(str) {
|
||||
return /^(DO)?(\d{11}|(\d{3}-\d{7}-\d{1})|[1,4,5]{1}\d{8}|([1,4,5]{1})-\d{2}-\d{5}-\d{1})$/.test(str);
|
||||
},
|
||||
UY: function UY(str) {
|
||||
return /^(UY)?\d{12}$/.test(str);
|
||||
},
|
||||
VE: function VE(str) {
|
||||
return /^(VE)?[J,G,V,E]{1}-(\d{9}|(\d{8}-\d{1}))$/.test(str);
|
||||
}
|
||||
};
|
||||
exports.vatMatchers = vatMatchers;
|
||||
|
||||
function isVAT(str, countryCode) {
|
||||
(0, _assertString.default)(str);
|
||||
(0, _assertString.default)(countryCode);
|
||||
|
||||
if (countryCode in vatMatchers) {
|
||||
return vatMatchers[countryCode](str);
|
||||
}
|
||||
|
||||
throw new Error("Invalid country code: '".concat(countryCode, "'"));
|
||||
}
|
||||
Reference in New Issue
Block a user