new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function () {
|
||||
var sinh = Math.sinh;
|
||||
if (typeof sinh !== "function") return false;
|
||||
return sinh(1) === 1.1752011936438014 && sinh(Number.MIN_VALUE) === 5e-324;
|
||||
};
|
||||
@@ -0,0 +1,116 @@
|
||||
var explicitTypes = ["number", "string"];
|
||||
|
||||
function Parser(name, regExp, parser, processSafe) {
|
||||
this.name = typeof name === "undefined" ? "Default" : name;
|
||||
this.regExp = null;
|
||||
this.type = "";
|
||||
this.processSafe = processSafe;
|
||||
if (typeof regExp !== "undefined") {
|
||||
if (typeof regExp === "string") {
|
||||
this.regExp = new RegExp(regExp);
|
||||
} else {
|
||||
this.regExp = regExp;
|
||||
}
|
||||
}
|
||||
if (typeof parser !== "undefined") {
|
||||
this.parse = parser;
|
||||
}
|
||||
}
|
||||
// var numReg = /^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/;
|
||||
Parser.prototype.convertType = function(item) {
|
||||
var type=this.type;
|
||||
if (type === 'number') {
|
||||
var rtn = parseFloat(item);
|
||||
if (isNaN(rtn)) {
|
||||
return 0;
|
||||
} else {
|
||||
return rtn;
|
||||
}
|
||||
} else if (this.param && this.param.checkType && type === '') {
|
||||
var trimed = item.trim();
|
||||
if (trimed === ""){
|
||||
return trimed;
|
||||
}
|
||||
if (!isNaN(trimed)) {
|
||||
return parseFloat(trimed);
|
||||
} else if (trimed.length === 5 && trimed.toLowerCase() === "false") {
|
||||
return false;
|
||||
} else if (trimed.length === 4 && trimed.toLowerCase() === "true") {
|
||||
return true;
|
||||
} else if (trimed[0] === "{" && trimed[trimed.length - 1] === "}" || trimed[0] === "[" && trimed[trimed.length - 1]==="]") {
|
||||
try {
|
||||
return JSON.parse(trimed);
|
||||
} catch (e) {
|
||||
return item;
|
||||
}
|
||||
} else {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return item;
|
||||
};
|
||||
|
||||
Parser.prototype.setParam = function(param) {
|
||||
this.param = param;
|
||||
};
|
||||
|
||||
Parser.prototype.test = function(str) {
|
||||
return this.regExp && this.regExp.test(str);
|
||||
};
|
||||
|
||||
Parser.prototype.parse = function(params) {
|
||||
params.resultRow[params.head] = params.item;
|
||||
};
|
||||
|
||||
Parser.prototype.getHeadStr = function() {
|
||||
if (this.headStr) {
|
||||
return this.headStr;
|
||||
} else {
|
||||
var head = this.head;
|
||||
this.headStr = head.replace(this.regExp, '');
|
||||
if (!this.headStr) {
|
||||
this.headStr = "Unknown Header";
|
||||
}
|
||||
return this.getHeadStr();
|
||||
}
|
||||
};
|
||||
|
||||
Parser.prototype.getHead = function() {
|
||||
return this.head;
|
||||
};
|
||||
|
||||
Parser.prototype.initHead = function(columnTitle) {
|
||||
this.head = columnTitle;
|
||||
var wholeHead = columnTitle.replace(this.regExp, '');
|
||||
//init type && headStr
|
||||
var splitArr = wholeHead.split("#!");
|
||||
if (splitArr.length === 1) { //no explicit type
|
||||
this.headStr = splitArr[0];
|
||||
} else {
|
||||
var type = splitArr.shift();
|
||||
if (explicitTypes.indexOf(type.toLowerCase()) > -1) {
|
||||
this.type = type;
|
||||
this.headStr = splitArr.join("#!");
|
||||
} else { //no explicit type
|
||||
this.headStr = wholeHead;
|
||||
}
|
||||
}
|
||||
if (!this.headStr) {
|
||||
this.headStr = wholeHead ? wholeHead : "Unknown Head";
|
||||
}
|
||||
};
|
||||
|
||||
Parser.prototype.clone = function() {
|
||||
var obj = Object.create(this);
|
||||
var newParser = new Parser();
|
||||
for (var key in obj) {
|
||||
newParser[key] = obj[key];
|
||||
}
|
||||
return newParser;
|
||||
};
|
||||
|
||||
Parser.prototype.getName = function() {
|
||||
return this.name;
|
||||
};
|
||||
|
||||
module.exports = Parser;
|
||||
@@ -0,0 +1,97 @@
|
||||
import { Hash, Input, HashXOF } from './utils.js';
|
||||
export declare function keccakP(s: Uint32Array, rounds?: number): void;
|
||||
export declare class Keccak extends Hash<Keccak> implements HashXOF<Keccak> {
|
||||
blockLen: number;
|
||||
suffix: number;
|
||||
outputLen: number;
|
||||
protected enableXOF: boolean;
|
||||
protected rounds: number;
|
||||
protected state: Uint8Array;
|
||||
protected pos: number;
|
||||
protected posOut: number;
|
||||
protected finished: boolean;
|
||||
protected state32: Uint32Array;
|
||||
protected destroyed: boolean;
|
||||
constructor(blockLen: number, suffix: number, outputLen: number, enableXOF?: boolean, rounds?: number);
|
||||
protected keccak(): void;
|
||||
update(data: Input): this;
|
||||
protected finish(): void;
|
||||
protected writeInto(out: Uint8Array): Uint8Array;
|
||||
xofInto(out: Uint8Array): Uint8Array;
|
||||
xof(bytes: number): Uint8Array;
|
||||
digestInto(out: Uint8Array): Uint8Array;
|
||||
digest(): Uint8Array;
|
||||
destroy(): void;
|
||||
_cloneInto(to?: Keccak): Keccak;
|
||||
}
|
||||
export declare const sha3_224: {
|
||||
(message: Input): Uint8Array;
|
||||
outputLen: number;
|
||||
blockLen: number;
|
||||
create(): Hash<Keccak>;
|
||||
};
|
||||
/**
|
||||
* SHA3-256 hash function
|
||||
* @param message - that would be hashed
|
||||
*/
|
||||
export declare const sha3_256: {
|
||||
(message: Input): Uint8Array;
|
||||
outputLen: number;
|
||||
blockLen: number;
|
||||
create(): Hash<Keccak>;
|
||||
};
|
||||
export declare const sha3_384: {
|
||||
(message: Input): Uint8Array;
|
||||
outputLen: number;
|
||||
blockLen: number;
|
||||
create(): Hash<Keccak>;
|
||||
};
|
||||
export declare const sha3_512: {
|
||||
(message: Input): Uint8Array;
|
||||
outputLen: number;
|
||||
blockLen: number;
|
||||
create(): Hash<Keccak>;
|
||||
};
|
||||
export declare const keccak_224: {
|
||||
(message: Input): Uint8Array;
|
||||
outputLen: number;
|
||||
blockLen: number;
|
||||
create(): Hash<Keccak>;
|
||||
};
|
||||
/**
|
||||
* keccak-256 hash function. Different from SHA3-256.
|
||||
* @param message - that would be hashed
|
||||
*/
|
||||
export declare const keccak_256: {
|
||||
(message: Input): Uint8Array;
|
||||
outputLen: number;
|
||||
blockLen: number;
|
||||
create(): Hash<Keccak>;
|
||||
};
|
||||
export declare const keccak_384: {
|
||||
(message: Input): Uint8Array;
|
||||
outputLen: number;
|
||||
blockLen: number;
|
||||
create(): Hash<Keccak>;
|
||||
};
|
||||
export declare const keccak_512: {
|
||||
(message: Input): Uint8Array;
|
||||
outputLen: number;
|
||||
blockLen: number;
|
||||
create(): Hash<Keccak>;
|
||||
};
|
||||
export declare type ShakeOpts = {
|
||||
dkLen?: number;
|
||||
};
|
||||
export declare const shake128: {
|
||||
(msg: Input, opts?: ShakeOpts | undefined): Uint8Array;
|
||||
outputLen: number;
|
||||
blockLen: number;
|
||||
create(opts: ShakeOpts): Hash<Keccak>;
|
||||
};
|
||||
export declare const shake256: {
|
||||
(msg: Input, opts?: ShakeOpts | undefined): Uint8Array;
|
||||
outputLen: number;
|
||||
blockLen: number;
|
||||
create(opts: ShakeOpts): Hash<Keccak>;
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
# [ISC License](https://spdx.org/licenses/ISC)
|
||||
|
||||
Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m)
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")() ? Math.imul : require("./shim");
|
||||
@@ -0,0 +1 @@
|
||||
export declare function extractUrlVariableNames(url: string): string[];
|
||||
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const utils = require("../../utils");
|
||||
const partial_1 = require("../matchers/partial");
|
||||
class DeepFilter {
|
||||
constructor(_settings, _micromatchOptions) {
|
||||
this._settings = _settings;
|
||||
this._micromatchOptions = _micromatchOptions;
|
||||
}
|
||||
getFilter(basePath, positive, negative) {
|
||||
const matcher = this._getMatcher(positive);
|
||||
const negativeRe = this._getNegativePatternsRe(negative);
|
||||
return (entry) => this._filter(basePath, entry, matcher, negativeRe);
|
||||
}
|
||||
_getMatcher(patterns) {
|
||||
return new partial_1.default(patterns, this._settings, this._micromatchOptions);
|
||||
}
|
||||
_getNegativePatternsRe(patterns) {
|
||||
const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
|
||||
return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
|
||||
}
|
||||
_filter(basePath, entry, matcher, negativeRe) {
|
||||
if (this._isSkippedByDeep(basePath, entry.path)) {
|
||||
return false;
|
||||
}
|
||||
if (this._isSkippedSymbolicLink(entry)) {
|
||||
return false;
|
||||
}
|
||||
const filepath = utils.path.removeLeadingDotSegment(entry.path);
|
||||
if (this._isSkippedByPositivePatterns(filepath, matcher)) {
|
||||
return false;
|
||||
}
|
||||
return this._isSkippedByNegativePatterns(filepath, negativeRe);
|
||||
}
|
||||
_isSkippedByDeep(basePath, entryPath) {
|
||||
/**
|
||||
* Avoid unnecessary depth calculations when it doesn't matter.
|
||||
*/
|
||||
if (this._settings.deep === Infinity) {
|
||||
return false;
|
||||
}
|
||||
return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
|
||||
}
|
||||
_getEntryLevel(basePath, entryPath) {
|
||||
const entryPathDepth = entryPath.split('/').length;
|
||||
if (basePath === '') {
|
||||
return entryPathDepth;
|
||||
}
|
||||
const basePathDepth = basePath.split('/').length;
|
||||
return entryPathDepth - basePathDepth;
|
||||
}
|
||||
_isSkippedSymbolicLink(entry) {
|
||||
return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
|
||||
}
|
||||
_isSkippedByPositivePatterns(entryPath, matcher) {
|
||||
return !this._settings.baseNameMatch && !matcher.match(entryPath);
|
||||
}
|
||||
_isSkippedByNegativePatterns(entryPath, patternsRe) {
|
||||
return !utils.pattern.matchAny(entryPath, patternsRe);
|
||||
}
|
||||
}
|
||||
exports.default = DeepFilter;
|
||||
File diff suppressed because one or more lines are too long
@@ -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.00216,"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.00432,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0.00216,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0.00216,"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.00216,"88":0.00216,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0.00216,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0.00216,"101":0,"102":0.00432,"103":0.00216,"104":0.00216,"105":0.00216,"106":0.00216,"107":0.00432,"108":0.00864,"109":0.1404,"110":0.08424,"111":0.00216,"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.00216,"50":0.00216,"51":0,"52":0.00216,"53":0,"54":0,"55":0.00216,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0.00216,"67":0.00216,"68":0,"69":0.00216,"70":0.00216,"71":0,"72":0,"73":0,"74":0.00216,"75":0,"76":0.00216,"77":0,"78":0.00216,"79":0.00432,"80":0.00216,"81":0.0108,"83":0.00216,"84":0.00216,"85":0,"86":0.00216,"87":0.00216,"88":0.00432,"89":0,"90":0.00216,"91":0.00216,"92":0.0108,"93":0.00216,"94":0.00216,"95":0.00216,"96":0.00216,"97":0.00216,"98":0.00216,"99":0.00216,"100":0.00432,"101":0.00432,"102":0.00216,"103":0.01296,"104":0.00432,"105":0.00432,"106":0.00648,"107":0.01296,"108":0.05832,"109":1.52496,"110":0.81216,"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.00216,"27":0,"28":0.00432,"29":0,"30":0,"31":0,"32":0.00216,"33":0,"34":0,"35":0.00216,"36":0,"37":0,"38":0.00216,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0.00216,"47":0,"48":0,"49":0,"50":0,"51":0.00216,"52":0,"53":0,"54":0.00216,"55":0,"56":0.00216,"57":0.00216,"58":0.00432,"60":0.0108,"62":0.00216,"63":0.02592,"64":0.01296,"65":0.00864,"66":0.07992,"67":0.21168,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0.00216,"74":0.00432,"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.00216,"94":0.03672,"95":0.03024,"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.00216},B:{"12":0.00216,"13":0,"14":0,"15":0.00216,"16":0,"17":0.00216,"18":0.00432,"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.00216,"93":0,"94":0,"95":0.00216,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0.00216,"106":0.00216,"107":0.00648,"108":0.0108,"109":0.22248,"110":0.27432},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.00216,"14":0.00648,"15":0.00216,_:"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.00216,"12.1":0.00216,"13.1":0.0108,"14.1":0.01728,"15.1":0.00216,"15.2-15.3":0.00216,"15.4":0.00432,"15.5":0.01296,"15.6":0.06048,"16.0":0.00864,"16.1":0.0216,"16.2":0.06264,"16.3":0.04104,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00158,"6.0-6.1":0.00792,"7.0-7.1":0.00792,"8.1-8.4":0.00792,"9.0-9.2":0.00158,"9.3":0.07917,"10.0-10.2":0,"10.3":0.04117,"11.0-11.2":0.00317,"11.3-11.4":0.01583,"12.0-12.1":0.00792,"12.2-12.5":0.46076,"13.0-13.1":0.019,"13.2":0.00317,"13.3":0.02692,"13.4-13.7":0.07442,"14.0-14.4":0.21375,"14.5-14.8":0.47659,"15.0-15.1":0.13142,"15.2-15.3":0.17259,"15.4":0.23275,"15.5":0.50668,"15.6":1.24452,"16.0":1.35852,"16.1":3.54356,"16.2":3.8254,"16.3":2.18187,"16.4":0.0095},P:{"4":0.20314,"20":2.40721,"5.0-5.4":0.01016,"6.2-6.4":0,"7.2-7.4":0.38597,"8.2":0.01016,"9.2":0.01016,"10.1":0.01016,"11.1-11.2":0.10157,"12.0":0.04063,"13.0":0.08126,"14.0":0.10157,"15.0":0.06094,"16.0":0.20314,"17.0":0.15236,"18.0":0.2133,"19.0":4.42846},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00737,"4.4":0,"4.4.3-4.4.4":0.04127},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.01728,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0.00784,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.51744},H:{"0":3.30297},L:{"0":65.76616},R:{_:"0"},M:{"0":0.5096},Q:{"13.1":0.00784}};
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "defaults",
|
||||
"version": "1.0.4",
|
||||
"description": "merge single level defaults over a config object",
|
||||
"main": "index.js",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/sindresorhus/node-defaults.git"
|
||||
},
|
||||
"keywords": [
|
||||
"config",
|
||||
"defaults",
|
||||
"options",
|
||||
"object",
|
||||
"merge",
|
||||
"assign",
|
||||
"properties",
|
||||
"deep"
|
||||
],
|
||||
"author": "Elijah Insua <tmpvar@gmail.com>",
|
||||
"license": "MIT",
|
||||
"readmeFilename": "README.md",
|
||||
"dependencies": {
|
||||
"clone": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tap": "^2.0.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"prelude-ls","version":"1.1.2","files":{"LICENSE":{"checkedAt":1678883672135,"integrity":"sha512-FkymZYtx329CmIaO3HdzaHZ6WrL5BZj/NGLWVaM6TuNvsbYcBnTjOd6Yzvi6lJfLVAW0oJGhl8mK9EKILopYDg==","mode":436,"size":1054},"package.json":{"checkedAt":1678883672188,"integrity":"sha512-AB9KpWMgr16dhozuUdgeKs2gsXm2ZuILps3tK1HZWBkFljqh/2UI0abrNe8RC4fFwOP1NjeRzp9o5+STzz7F/g==","mode":436,"size":1178},"README.md":{"checkedAt":1678883672188,"integrity":"sha512-L3Aznq431aUYGYkTwUhq9ryR8gZVnNfeqoDif4U8j4h/p/svccmxftmlMj+TM3TM+lTFnXI7ANAPSokqrZtRew==","mode":436,"size":613},"CHANGELOG.md":{"checkedAt":1678883672188,"integrity":"sha512-Se2tzpjBa4q8ZNcK44jKlOAnTY+lIkicQn4QX22v/yJolVVBsBhfgwgoTlXC8uhVCNavPqC2qUBwXWnw3CqIww==","mode":436,"size":3989},"lib/Func.js":{"checkedAt":1678883672188,"integrity":"sha512-DwS8ae5gcKmM4RW9kM1AkyWhJ1Y2xHjuQy+r0wS48LDlxhtb0gJo473x7T7PgwI6vTIjCmokbZxluO+W+I1gjA==","mode":436,"size":1564},"lib/List.js":{"checkedAt":1678883672190,"integrity":"sha512-/h17e0Jf5mV0vp5jI24qUDdhI4F6BMPEKPec5eby/TH+b19GOR65oakaTHLfdkjJ1GmEwetYhReE8NNvJDHfQQ==","mode":436,"size":14909},"lib/Num.js":{"checkedAt":1678883672190,"integrity":"sha512-VCqqI3vca8steUj8UkcCyS+oYatA259XaKzMZeUr50B5XN8TGO1vQ40lj+kNWM90Li6OB9UFLlJ8pnB7CK2nWw==","mode":436,"size":2471},"lib/Obj.js":{"checkedAt":1678883672197,"integrity":"sha512-4iyWV0EMpi/P1pgN+EcpsMXstjMpFKkHWq5cIdFi2snHHj+AxFsXS44WTN1GddygeZQEXmzjOVmgg4RzG6v5Jg==","mode":436,"size":3201},"lib/Str.js":{"checkedAt":1678883672197,"integrity":"sha512-XPojev57KVBxdRXgsMiQnp8Gdi8HnjAeWKzfdH7J+c38YbTzQdeZiEpvvg1boikULjxIefsOr4hWQMOrRmGcjw==","mode":436,"size":2104},"lib/index.js":{"checkedAt":1678883672197,"integrity":"sha512-AixyQQ+sWHM+0twdN5lKGJ27I2sUTEQF55FH+p3Yhn7qlbMkvbBAirpWLikz4+TghB9n1yTWxyPq4OvgEmwzGw==","mode":436,"size":4932}}}
|
||||
@@ -0,0 +1,40 @@
|
||||
# array-buffer-byte-length <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
||||
|
||||
[![github actions][actions-image]][actions-url]
|
||||
[![coverage][codecov-image]][codecov-url]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][npm-badge-png]][package-url]
|
||||
|
||||
Get the byte length of an ArrayBuffer, even in engines without a `.byteLength` method.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
const assert = require('assert');
|
||||
const byteLength = require('array-buffer-byte-length');
|
||||
|
||||
assert.equal(byteLength([]), NaN, 'an array is not an ArrayBuffer, yields NaN');
|
||||
|
||||
assert.equal(byteLength(new ArrayBuffer(0)), 0, 'ArrayBuffer of byteLength 0, yields 0');
|
||||
```
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[package-url]: https://npmjs.org/package/array-buffer-byte-length
|
||||
[npm-version-svg]: https://versionbadg.es/inspect-js/array-buffer-byte-length.svg
|
||||
[deps-svg]: https://david-dm.org/inspect-js/array-buffer-byte-length.svg
|
||||
[deps-url]: https://david-dm.org/inspect-js/array-buffer-byte-length
|
||||
[dev-deps-svg]: https://david-dm.org/inspect-js/array-buffer-byte-length/dev-status.svg
|
||||
[dev-deps-url]: https://david-dm.org/inspect-js/array-buffer-byte-length#info=devDependencies
|
||||
[npm-badge-png]: https://nodei.co/npm/array-buffer-byte-length.png?downloads=true&stars=true
|
||||
[license-image]: https://img.shields.io/npm/l/array-buffer-byte-length.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/array-buffer-byte-length.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=array-buffer-byte-length
|
||||
[codecov-image]: https://codecov.io/gh/inspect-js/array-buffer-byte-length/branch/main/graphs/badge.svg
|
||||
[codecov-url]: https://app.codecov.io/gh/inspect-js/array-buffer-byte-length/
|
||||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/array-buffer-byte-length
|
||||
[actions-url]: https://github.com/inspect-js/array-buffer-byte-length/actions
|
||||
@@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "init", {
|
||||
enumerable: true,
|
||||
get: ()=>init
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
|
||||
const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function init(args, configs) {
|
||||
let messages = [];
|
||||
var _args___;
|
||||
let tailwindConfigLocation = _path.default.resolve((_args___ = args["_"][1]) !== null && _args___ !== void 0 ? _args___ : `./${configs.tailwind}`);
|
||||
if (_fs.default.existsSync(tailwindConfigLocation)) {
|
||||
messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`);
|
||||
} else {
|
||||
let stubFile = _fs.default.readFileSync(args["--full"] ? _path.default.resolve(__dirname, "../../../../stubs/defaultConfig.stub.js") : _path.default.resolve(__dirname, "../../../../stubs/simpleConfig.stub.js"), "utf8");
|
||||
// Change colors import
|
||||
stubFile = stubFile.replace("../colors", "tailwindcss/colors");
|
||||
_fs.default.writeFileSync(tailwindConfigLocation, stubFile, "utf8");
|
||||
messages.push(`Created Tailwind CSS config file: ${_path.default.basename(tailwindConfigLocation)}`);
|
||||
}
|
||||
if (messages.length > 0) {
|
||||
console.log();
|
||||
for (let message of messages){
|
||||
console.log(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
Copyright (c) 2016, Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted, provided
|
||||
that the above copyright notice and this permission notice
|
||||
appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
|
||||
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
||||
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
@@ -0,0 +1,62 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { argsArgArrayOrObject } from '../util/argsArgArrayOrObject';
|
||||
import { from } from './from';
|
||||
import { identity } from '../util/identity';
|
||||
import { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';
|
||||
import { popResultSelector, popScheduler } from '../util/args';
|
||||
import { createObject } from '../util/createObject';
|
||||
import { createOperatorSubscriber } from '../operators/OperatorSubscriber';
|
||||
import { executeSchedule } from '../util/executeSchedule';
|
||||
export function combineLatest(...args) {
|
||||
const scheduler = popScheduler(args);
|
||||
const resultSelector = popResultSelector(args);
|
||||
const { args: observables, keys } = argsArgArrayOrObject(args);
|
||||
if (observables.length === 0) {
|
||||
return from([], scheduler);
|
||||
}
|
||||
const result = new Observable(combineLatestInit(observables, scheduler, keys
|
||||
?
|
||||
(values) => createObject(keys, values)
|
||||
:
|
||||
identity));
|
||||
return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;
|
||||
}
|
||||
export function combineLatestInit(observables, scheduler, valueTransform = identity) {
|
||||
return (subscriber) => {
|
||||
maybeSchedule(scheduler, () => {
|
||||
const { length } = observables;
|
||||
const values = new Array(length);
|
||||
let active = length;
|
||||
let remainingFirstValues = length;
|
||||
for (let i = 0; i < length; i++) {
|
||||
maybeSchedule(scheduler, () => {
|
||||
const source = from(observables[i], scheduler);
|
||||
let hasFirstValue = false;
|
||||
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
||||
values[i] = value;
|
||||
if (!hasFirstValue) {
|
||||
hasFirstValue = true;
|
||||
remainingFirstValues--;
|
||||
}
|
||||
if (!remainingFirstValues) {
|
||||
subscriber.next(valueTransform(values.slice()));
|
||||
}
|
||||
}, () => {
|
||||
if (!--active) {
|
||||
subscriber.complete();
|
||||
}
|
||||
}));
|
||||
}, subscriber);
|
||||
}
|
||||
}, subscriber);
|
||||
};
|
||||
}
|
||||
function maybeSchedule(scheduler, execute, subscription) {
|
||||
if (scheduler) {
|
||||
executeSchedule(subscription, scheduler, execute);
|
||||
}
|
||||
else {
|
||||
execute();
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=combineLatest.js.map
|
||||
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $Date = GetIntrinsic('%Date%');
|
||||
var $Number = GetIntrinsic('%Number%');
|
||||
|
||||
var $isFinite = require('../helpers/isFinite');
|
||||
|
||||
var abs = require('./abs');
|
||||
var ToNumber = require('./ToNumber');
|
||||
|
||||
// https://262.ecma-international.org/5.1/#sec-15.9.1.14
|
||||
|
||||
module.exports = function TimeClip(time) {
|
||||
if (!$isFinite(time) || abs(time) > 8.64e15) {
|
||||
return NaN;
|
||||
}
|
||||
return $Number(new $Date(ToNumber(time)));
|
||||
};
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
'use strict';
|
||||
const {Agent} = require('../agent.js');
|
||||
const JSStreamSocket = require('../utils/js-stream-socket.js');
|
||||
const UnexpectedStatusCodeError = require('./unexpected-status-code-error.js');
|
||||
const initialize = require('./initialize.js');
|
||||
|
||||
class Http2OverHttpX extends Agent {
|
||||
constructor(options) {
|
||||
super(options);
|
||||
|
||||
initialize(this, options.proxyOptions);
|
||||
}
|
||||
|
||||
async createConnection(origin, options) {
|
||||
const authority = `${origin.hostname}:${origin.port || 443}`;
|
||||
|
||||
const [stream, statusCode, statusMessage] = await this._getProxyStream(authority);
|
||||
if (statusCode !== 200) {
|
||||
throw new UnexpectedStatusCodeError(statusCode, statusMessage);
|
||||
}
|
||||
|
||||
if (this.proxyOptions.raw) {
|
||||
options.socket = stream;
|
||||
} else {
|
||||
const socket = new JSStreamSocket(stream);
|
||||
socket.encrypted = false;
|
||||
socket._handle.getpeername = out => {
|
||||
out.family = undefined;
|
||||
out.address = undefined;
|
||||
out.port = undefined;
|
||||
};
|
||||
|
||||
return socket;
|
||||
}
|
||||
|
||||
return super.createConnection(origin, options);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Http2OverHttpX;
|
||||
@@ -0,0 +1,5 @@
|
||||
export type CreateScan = {
|
||||
runner: number;
|
||||
valid?: boolean;
|
||||
distance: number;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/operators/index.ts"],"names":[],"mappings":"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"}
|
||||
@@ -0,0 +1,18 @@
|
||||
export { default as DataHandler } from '../DataHandler';
|
||||
export { default as Datatable } from '../Datatable.svelte';
|
||||
export { default as Pagination } from '../Pagination.svelte';
|
||||
export { default as RowCount } from '../RowCount.svelte';
|
||||
export { default as RowsPerPage } from '../RowsPerPage.svelte';
|
||||
export { default as Search } from '../Search.svelte';
|
||||
export { default as Th } from '../Th.svelte';
|
||||
export { default as ThFilter } from '../ThFilter.svelte';
|
||||
export type Internationalization = {
|
||||
search?: string;
|
||||
show?: string;
|
||||
entries?: string;
|
||||
filter?: string;
|
||||
rowCount?: string;
|
||||
noRows?: string;
|
||||
previous?: string;
|
||||
next?: string;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
var objToString = Object.prototype.toString, id = objToString.call(true);
|
||||
|
||||
module.exports = function (value) {
|
||||
return (
|
||||
typeof value === "boolean" ||
|
||||
(typeof value === "object" && (value instanceof Boolean || objToString.call(value) === id))
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const utils = require("../../utils");
|
||||
class Matcher {
|
||||
constructor(_patterns, _settings, _micromatchOptions) {
|
||||
this._patterns = _patterns;
|
||||
this._settings = _settings;
|
||||
this._micromatchOptions = _micromatchOptions;
|
||||
this._storage = [];
|
||||
this._fillStorage();
|
||||
}
|
||||
_fillStorage() {
|
||||
/**
|
||||
* The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level).
|
||||
* So, before expand patterns with brace expansion into separated patterns.
|
||||
*/
|
||||
const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns);
|
||||
for (const pattern of patterns) {
|
||||
const segments = this._getPatternSegments(pattern);
|
||||
const sections = this._splitSegmentsIntoSections(segments);
|
||||
this._storage.push({
|
||||
complete: sections.length <= 1,
|
||||
pattern,
|
||||
segments,
|
||||
sections
|
||||
});
|
||||
}
|
||||
}
|
||||
_getPatternSegments(pattern) {
|
||||
const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions);
|
||||
return parts.map((part) => {
|
||||
const dynamic = utils.pattern.isDynamicPattern(part, this._settings);
|
||||
if (!dynamic) {
|
||||
return {
|
||||
dynamic: false,
|
||||
pattern: part
|
||||
};
|
||||
}
|
||||
return {
|
||||
dynamic: true,
|
||||
pattern: part,
|
||||
patternRe: utils.pattern.makeRe(part, this._micromatchOptions)
|
||||
};
|
||||
});
|
||||
}
|
||||
_splitSegmentsIntoSections(segments) {
|
||||
return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern));
|
||||
}
|
||||
}
|
||||
exports.default = Matcher;
|
||||
@@ -0,0 +1,5 @@
|
||||
import { bindCallbackInternals } from './bindCallbackInternals';
|
||||
export function bindNodeCallback(callbackFunc, resultSelector, scheduler) {
|
||||
return bindCallbackInternals(true, callbackFunc, resultSelector, scheduler);
|
||||
}
|
||||
//# sourceMappingURL=bindNodeCallback.js.map
|
||||
@@ -0,0 +1,20 @@
|
||||
import { ObservableInput, ObservedValueOf, OperatorFunction } from '../types';
|
||||
/**
|
||||
* Applies an accumulator function over the source Observable where the
|
||||
* accumulator function itself returns an Observable, emitting values
|
||||
* only from the most recently returned Observable.
|
||||
*
|
||||
* <span class="informal">It's like {@link mergeScan}, but only the most recent
|
||||
* Observable returned by the accumulator is merged into the outer Observable.</span>
|
||||
*
|
||||
* @see {@link scan}
|
||||
* @see {@link mergeScan}
|
||||
* @see {@link switchMap}
|
||||
*
|
||||
* @param accumulator
|
||||
* The accumulator function called on each source value.
|
||||
* @param seed The initial accumulation value.
|
||||
* @return A function that returns an observable of the accumulated values.
|
||||
*/
|
||||
export declare function switchScan<T, R, O extends ObservableInput<any>>(accumulator: (acc: R, value: T, index: number) => O, seed: R): OperatorFunction<T, ObservedValueOf<O>>;
|
||||
//# sourceMappingURL=switchScan.d.ts.map
|
||||
@@ -0,0 +1,34 @@
|
||||
import type {Except} from './except';
|
||||
|
||||
/**
|
||||
Create a type that requires at least one of the given keys. The remaining keys are kept as is.
|
||||
|
||||
@example
|
||||
```
|
||||
import type {RequireAtLeastOne} from 'type-fest';
|
||||
|
||||
type Responder = {
|
||||
text?: () => string;
|
||||
json?: () => string;
|
||||
secure?: boolean;
|
||||
};
|
||||
|
||||
const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = {
|
||||
json: () => '{"message": "ok"}',
|
||||
secure: true
|
||||
};
|
||||
```
|
||||
|
||||
@category Object
|
||||
*/
|
||||
export type RequireAtLeastOne<
|
||||
ObjectType,
|
||||
KeysType extends keyof ObjectType = keyof ObjectType,
|
||||
> = {
|
||||
// For each `Key` in `KeysType` make a mapped type:
|
||||
[Key in KeysType]-?: Required<Pick<ObjectType, Key>> & // 1. Make `Key`'s type required
|
||||
// 2. Make all other keys in `KeysType` optional
|
||||
Partial<Pick<ObjectType, Exclude<KeysType, Key>>>;
|
||||
}[KeysType] &
|
||||
// 3. Add the remaining keys not in `KeysType`
|
||||
Except<ObjectType, KeysType>;
|
||||
@@ -0,0 +1,61 @@
|
||||
import { innerFrom } from '../observable/innerFrom';
|
||||
import { executeSchedule } from '../util/executeSchedule';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
export function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {
|
||||
var buffer = [];
|
||||
var active = 0;
|
||||
var index = 0;
|
||||
var isComplete = false;
|
||||
var checkComplete = function () {
|
||||
if (isComplete && !buffer.length && !active) {
|
||||
subscriber.complete();
|
||||
}
|
||||
};
|
||||
var outerNext = function (value) { return (active < concurrent ? doInnerSub(value) : buffer.push(value)); };
|
||||
var doInnerSub = function (value) {
|
||||
expand && subscriber.next(value);
|
||||
active++;
|
||||
var innerComplete = false;
|
||||
innerFrom(project(value, index++)).subscribe(createOperatorSubscriber(subscriber, function (innerValue) {
|
||||
onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);
|
||||
if (expand) {
|
||||
outerNext(innerValue);
|
||||
}
|
||||
else {
|
||||
subscriber.next(innerValue);
|
||||
}
|
||||
}, function () {
|
||||
innerComplete = true;
|
||||
}, undefined, function () {
|
||||
if (innerComplete) {
|
||||
try {
|
||||
active--;
|
||||
var _loop_1 = function () {
|
||||
var bufferedValue = buffer.shift();
|
||||
if (innerSubScheduler) {
|
||||
executeSchedule(subscriber, innerSubScheduler, function () { return doInnerSub(bufferedValue); });
|
||||
}
|
||||
else {
|
||||
doInnerSub(bufferedValue);
|
||||
}
|
||||
};
|
||||
while (buffer.length && active < concurrent) {
|
||||
_loop_1();
|
||||
}
|
||||
checkComplete();
|
||||
}
|
||||
catch (err) {
|
||||
subscriber.error(err);
|
||||
}
|
||||
}
|
||||
}));
|
||||
};
|
||||
source.subscribe(createOperatorSubscriber(subscriber, outerNext, function () {
|
||||
isComplete = true;
|
||||
checkComplete();
|
||||
}));
|
||||
return function () {
|
||||
additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=mergeInternals.js.map
|
||||
@@ -0,0 +1 @@
|
||||
file1
|
||||
@@ -0,0 +1,98 @@
|
||||
const { join } = require('path')
|
||||
const Handlebars = require('handlebars')
|
||||
const fetch = require('node-fetch')
|
||||
const { readFile, fileExists } = require('./utils')
|
||||
|
||||
const TEMPLATES_DIR = join(__dirname, '..', 'templates')
|
||||
const MATCH_URL = /^https?:\/\/.+/
|
||||
const COMPILE_OPTIONS = {
|
||||
noEscape: true
|
||||
}
|
||||
|
||||
Handlebars.registerHelper('json', (object) => {
|
||||
return new Handlebars.SafeString(JSON.stringify(object, null, 2))
|
||||
})
|
||||
|
||||
Handlebars.registerHelper('commit-list', (context, options) => {
|
||||
if (!context || context.length === 0) {
|
||||
return ''
|
||||
}
|
||||
|
||||
const list = context
|
||||
.filter(item => {
|
||||
const commit = item.commit || item
|
||||
if (options.hash.exclude) {
|
||||
const pattern = new RegExp(options.hash.exclude, 'm')
|
||||
if (pattern.test(commit.message)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (options.hash.message) {
|
||||
const pattern = new RegExp(options.hash.message, 'm')
|
||||
return pattern.test(commit.message)
|
||||
}
|
||||
if (options.hash.subject) {
|
||||
const pattern = new RegExp(options.hash.subject)
|
||||
return pattern.test(commit.subject)
|
||||
}
|
||||
return true
|
||||
})
|
||||
.map(item => options.fn(item))
|
||||
.join('')
|
||||
|
||||
if (!list) {
|
||||
return ''
|
||||
}
|
||||
|
||||
return `${options.hash.heading}\n\n${list}`
|
||||
})
|
||||
|
||||
Handlebars.registerHelper('matches', function (val, pattern, options) {
|
||||
const r = new RegExp(pattern, options.hash.flags || '')
|
||||
return r.test(val) ? options.fn(this) : options.inverse(this)
|
||||
})
|
||||
|
||||
const getTemplate = async template => {
|
||||
if (MATCH_URL.test(template)) {
|
||||
const response = await fetch(template)
|
||||
return response.text()
|
||||
}
|
||||
if (await fileExists(template)) {
|
||||
return readFile(template)
|
||||
}
|
||||
const path = join(TEMPLATES_DIR, template + '.hbs')
|
||||
if (await fileExists(path) === false) {
|
||||
throw new Error(`Template '${template}' was not found`)
|
||||
}
|
||||
return readFile(path)
|
||||
}
|
||||
|
||||
const cleanTemplate = template => {
|
||||
return template
|
||||
// Remove indentation
|
||||
.replace(/\n +/g, '\n')
|
||||
.replace(/^ +/, '')
|
||||
// Fix multiple blank lines
|
||||
.replace(/\n\n\n+/g, '\n\n')
|
||||
.replace(/\n\n$/, '\n')
|
||||
}
|
||||
|
||||
const compileTemplate = async (releases, options) => {
|
||||
const { template, handlebarsSetup } = options
|
||||
if (handlebarsSetup) {
|
||||
const path = /^\//.test(handlebarsSetup) ? handlebarsSetup : join(process.cwd(), handlebarsSetup)
|
||||
const setup = require(path)
|
||||
if (typeof setup === 'function') {
|
||||
setup(Handlebars)
|
||||
}
|
||||
}
|
||||
const compile = Handlebars.compile(await getTemplate(template), COMPILE_OPTIONS)
|
||||
if (template === 'json') {
|
||||
return compile({ releases, options })
|
||||
}
|
||||
return cleanTemplate(compile({ releases, options }))
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
compileTemplate
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"name": "iterate-iterator",
|
||||
"version": "1.0.2",
|
||||
"description": "Iterate any JS iterator. Works robustly in all environments, all versions.",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": [
|
||||
{
|
||||
"default": "./index.js"
|
||||
},
|
||||
"./index.js"
|
||||
],
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublishOnly": "safe-publish-latest",
|
||||
"prepublish": "not-in-publish || npm run prepublishOnly",
|
||||
"pretest": "npm run lint",
|
||||
"prelint": "evalmd README.md",
|
||||
"lint": "eslint .",
|
||||
"tests-only": "nyc tape 'test/**/*.js'",
|
||||
"test": "npm run tests-only",
|
||||
"posttest": "aud --production",
|
||||
"version": "auto-changelog && git add CHANGELOG.md",
|
||||
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ljharb/iterate-iterator.git"
|
||||
},
|
||||
"keywords": [
|
||||
"iterate",
|
||||
"iterator",
|
||||
"iterable",
|
||||
"es2015",
|
||||
"es6",
|
||||
"symbol.iterator",
|
||||
"symbol",
|
||||
"next"
|
||||
],
|
||||
"author": "Jordan Harband <ljharb@gmail.com>",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ljharb/iterate-iterator/issues"
|
||||
},
|
||||
"homepage": "https://github.com/ljharb/iterate-iterator#readme",
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^18.0.0",
|
||||
"aud": "^1.1.5",
|
||||
"auto-changelog": "^2.3.0",
|
||||
"es-get-iterator": "^1.1.2",
|
||||
"eslint": "^7.32.0",
|
||||
"evalmd": "^0.0.19",
|
||||
"for-each": "^0.3.3",
|
||||
"nyc": "^10.3.2",
|
||||
"object-inspect": "^1.11.0",
|
||||
"safe-publish-latest": "^1.1.4",
|
||||
"tape": "^5.3.1"
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "CHANGELOG.md",
|
||||
"template": "keepachangelog",
|
||||
"unreleased": false,
|
||||
"commitLimit": false,
|
||||
"backfillLimit": false
|
||||
},
|
||||
"testling": {
|
||||
"files": "test/index.js"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import Node from './shared/Node';
|
||||
import PendingBlock from './PendingBlock';
|
||||
import ThenBlock from './ThenBlock';
|
||||
import CatchBlock from './CatchBlock';
|
||||
import Expression from './shared/Expression';
|
||||
import Component from '../Component';
|
||||
import TemplateScope from './shared/TemplateScope';
|
||||
import { TemplateNode } from '../../interfaces';
|
||||
import { Context } from './shared/Context';
|
||||
import { Node as ESTreeNode } from 'estree';
|
||||
export default class AwaitBlock extends Node {
|
||||
type: 'AwaitBlock';
|
||||
expression: Expression;
|
||||
then_contexts: Context[];
|
||||
catch_contexts: Context[];
|
||||
then_node: ESTreeNode | null;
|
||||
catch_node: ESTreeNode | null;
|
||||
pending: PendingBlock;
|
||||
then: ThenBlock;
|
||||
catch: CatchBlock;
|
||||
context_rest_properties: Map<string, ESTreeNode>;
|
||||
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
var test = require('tape');
|
||||
var forEach = require('for-each');
|
||||
|
||||
var inspect = require('../');
|
||||
|
||||
test('bad indent options', function (t) {
|
||||
forEach([
|
||||
undefined,
|
||||
true,
|
||||
false,
|
||||
-1,
|
||||
1.2,
|
||||
Infinity,
|
||||
-Infinity,
|
||||
NaN
|
||||
], function (indent) {
|
||||
t['throws'](
|
||||
function () { inspect('', { indent: indent }); },
|
||||
TypeError,
|
||||
inspect(indent) + ' is invalid'
|
||||
);
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('simple object with indent', function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var obj = { a: 1, b: 2 };
|
||||
|
||||
var expectedSpaces = [
|
||||
'{',
|
||||
' a: 1,',
|
||||
' b: 2',
|
||||
'}'
|
||||
].join('\n');
|
||||
var expectedTabs = [
|
||||
'{',
|
||||
' a: 1,',
|
||||
' b: 2',
|
||||
'}'
|
||||
].join('\n');
|
||||
|
||||
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
|
||||
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
|
||||
});
|
||||
|
||||
test('two deep object with indent', function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var obj = { a: 1, b: { c: 3, d: 4 } };
|
||||
|
||||
var expectedSpaces = [
|
||||
'{',
|
||||
' a: 1,',
|
||||
' b: {',
|
||||
' c: 3,',
|
||||
' d: 4',
|
||||
' }',
|
||||
'}'
|
||||
].join('\n');
|
||||
var expectedTabs = [
|
||||
'{',
|
||||
' a: 1,',
|
||||
' b: {',
|
||||
' c: 3,',
|
||||
' d: 4',
|
||||
' }',
|
||||
'}'
|
||||
].join('\n');
|
||||
|
||||
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
|
||||
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
|
||||
});
|
||||
|
||||
test('simple array with all single line elements', function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var obj = [1, 2, 3, 'asdf\nsdf'];
|
||||
|
||||
var expected = '[ 1, 2, 3, \'asdf\\nsdf\' ]';
|
||||
|
||||
t.equal(inspect(obj, { indent: 2 }), expected, 'two');
|
||||
t.equal(inspect(obj, { indent: '\t' }), expected, 'tabs');
|
||||
});
|
||||
|
||||
test('array with complex elements', function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var obj = [1, { a: 1, b: { c: 1 } }, 'asdf\nsdf'];
|
||||
|
||||
var expectedSpaces = [
|
||||
'[',
|
||||
' 1,',
|
||||
' {',
|
||||
' a: 1,',
|
||||
' b: {',
|
||||
' c: 1',
|
||||
' }',
|
||||
' },',
|
||||
' \'asdf\\nsdf\'',
|
||||
']'
|
||||
].join('\n');
|
||||
var expectedTabs = [
|
||||
'[',
|
||||
' 1,',
|
||||
' {',
|
||||
' a: 1,',
|
||||
' b: {',
|
||||
' c: 1',
|
||||
' }',
|
||||
' },',
|
||||
' \'asdf\\nsdf\'',
|
||||
']'
|
||||
].join('\n');
|
||||
|
||||
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
|
||||
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
|
||||
});
|
||||
|
||||
test('values', function (t) {
|
||||
t.plan(2);
|
||||
var obj = [{}, [], { 'a-b': 5 }];
|
||||
|
||||
var expectedSpaces = [
|
||||
'[',
|
||||
' {},',
|
||||
' [],',
|
||||
' {',
|
||||
' \'a-b\': 5',
|
||||
' }',
|
||||
']'
|
||||
].join('\n');
|
||||
var expectedTabs = [
|
||||
'[',
|
||||
' {},',
|
||||
' [],',
|
||||
' {',
|
||||
' \'a-b\': 5',
|
||||
' }',
|
||||
']'
|
||||
].join('\n');
|
||||
|
||||
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
|
||||
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
|
||||
});
|
||||
|
||||
test('Map', { skip: typeof Map !== 'function' }, function (t) {
|
||||
var map = new Map();
|
||||
map.set({ a: 1 }, ['b']);
|
||||
map.set(3, NaN);
|
||||
|
||||
var expectedStringSpaces = [
|
||||
'Map (2) {',
|
||||
' { a: 1 } => [ \'b\' ],',
|
||||
' 3 => NaN',
|
||||
'}'
|
||||
].join('\n');
|
||||
var expectedStringTabs = [
|
||||
'Map (2) {',
|
||||
' { a: 1 } => [ \'b\' ],',
|
||||
' 3 => NaN',
|
||||
'}'
|
||||
].join('\n');
|
||||
var expectedStringTabsDoubleQuotes = [
|
||||
'Map (2) {',
|
||||
' { a: 1 } => [ "b" ],',
|
||||
' 3 => NaN',
|
||||
'}'
|
||||
].join('\n');
|
||||
|
||||
t.equal(
|
||||
inspect(map, { indent: 2 }),
|
||||
expectedStringSpaces,
|
||||
'Map keys are not indented (two)'
|
||||
);
|
||||
t.equal(
|
||||
inspect(map, { indent: '\t' }),
|
||||
expectedStringTabs,
|
||||
'Map keys are not indented (tabs)'
|
||||
);
|
||||
t.equal(
|
||||
inspect(map, { indent: '\t', quoteStyle: 'double' }),
|
||||
expectedStringTabsDoubleQuotes,
|
||||
'Map keys are not indented (tabs + double quotes)'
|
||||
);
|
||||
|
||||
t.equal(inspect(new Map(), { indent: 2 }), 'Map (0) {}', 'empty Map should show as empty (two)');
|
||||
t.equal(inspect(new Map(), { indent: '\t' }), 'Map (0) {}', 'empty Map should show as empty (tabs)');
|
||||
|
||||
var nestedMap = new Map();
|
||||
nestedMap.set(nestedMap, map);
|
||||
var expectedNestedSpaces = [
|
||||
'Map (1) {',
|
||||
' [Circular] => Map (2) {',
|
||||
' { a: 1 } => [ \'b\' ],',
|
||||
' 3 => NaN',
|
||||
' }',
|
||||
'}'
|
||||
].join('\n');
|
||||
var expectedNestedTabs = [
|
||||
'Map (1) {',
|
||||
' [Circular] => Map (2) {',
|
||||
' { a: 1 } => [ \'b\' ],',
|
||||
' 3 => NaN',
|
||||
' }',
|
||||
'}'
|
||||
].join('\n');
|
||||
t.equal(inspect(nestedMap, { indent: 2 }), expectedNestedSpaces, 'Map containing a Map should work (two)');
|
||||
t.equal(inspect(nestedMap, { indent: '\t' }), expectedNestedTabs, 'Map containing a Map should work (tabs)');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('Set', { skip: typeof Set !== 'function' }, function (t) {
|
||||
var set = new Set();
|
||||
set.add({ a: 1 });
|
||||
set.add(['b']);
|
||||
var expectedStringSpaces = [
|
||||
'Set (2) {',
|
||||
' {',
|
||||
' a: 1',
|
||||
' },',
|
||||
' [ \'b\' ]',
|
||||
'}'
|
||||
].join('\n');
|
||||
var expectedStringTabs = [
|
||||
'Set (2) {',
|
||||
' {',
|
||||
' a: 1',
|
||||
' },',
|
||||
' [ \'b\' ]',
|
||||
'}'
|
||||
].join('\n');
|
||||
t.equal(inspect(set, { indent: 2 }), expectedStringSpaces, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (two)');
|
||||
t.equal(inspect(set, { indent: '\t' }), expectedStringTabs, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (tabs)');
|
||||
|
||||
t.equal(inspect(new Set(), { indent: 2 }), 'Set (0) {}', 'empty Set should show as empty (two)');
|
||||
t.equal(inspect(new Set(), { indent: '\t' }), 'Set (0) {}', 'empty Set should show as empty (tabs)');
|
||||
|
||||
var nestedSet = new Set();
|
||||
nestedSet.add(set);
|
||||
nestedSet.add(nestedSet);
|
||||
var expectedNestedSpaces = [
|
||||
'Set (2) {',
|
||||
' Set (2) {',
|
||||
' {',
|
||||
' a: 1',
|
||||
' },',
|
||||
' [ \'b\' ]',
|
||||
' },',
|
||||
' [Circular]',
|
||||
'}'
|
||||
].join('\n');
|
||||
var expectedNestedTabs = [
|
||||
'Set (2) {',
|
||||
' Set (2) {',
|
||||
' {',
|
||||
' a: 1',
|
||||
' },',
|
||||
' [ \'b\' ]',
|
||||
' },',
|
||||
' [Circular]',
|
||||
'}'
|
||||
].join('\n');
|
||||
t.equal(inspect(nestedSet, { indent: 2 }), expectedNestedSpaces, 'Set containing a Set should work (two)');
|
||||
t.equal(inspect(nestedSet, { indent: '\t' }), expectedNestedTabs, 'Set containing a Set should work (tabs)');
|
||||
|
||||
t.end();
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
export type JwtUser = {
|
||||
id: number;
|
||||
uuid: string;
|
||||
email?: string;
|
||||
username?: string;
|
||||
firstname: string;
|
||||
middlename?: string;
|
||||
lastname: string;
|
||||
enabled: boolean;
|
||||
refreshTokenCount: number;
|
||||
profilePic?: string;
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
var pattern = /-(\w|$)/g;
|
||||
|
||||
var callback = function callback(dashChar, char) {
|
||||
return char.toUpperCase();
|
||||
};
|
||||
|
||||
var camelCaseCSS = function camelCaseCSS(property) {
|
||||
property = property.toLowerCase();
|
||||
|
||||
// NOTE :: IE8's "styleFloat" is intentionally not supported
|
||||
if (property === "float") {
|
||||
return "cssFloat";
|
||||
}
|
||||
// Microsoft vendor-prefixes are uniquely cased
|
||||
else if (property.charCodeAt(0) === 45&& property.charCodeAt(1) === 109&& property.charCodeAt(2) === 115&& property.charCodeAt(3) === 45) {
|
||||
return property.substr(1).replace(pattern, callback);
|
||||
} else {
|
||||
return property.replace(pattern, callback);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = camelCaseCSS;
|
||||
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
forEach: require("./for-each"),
|
||||
is: require("./is"),
|
||||
validate: require("./validate"),
|
||||
validateObject: require("./validate-object")
|
||||
};
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"name": "cfb",
|
||||
"version": "1.2.2",
|
||||
"author": "sheetjs",
|
||||
"description": "Compound File Binary File Format extractor",
|
||||
"keywords": [
|
||||
"cfb",
|
||||
"compression",
|
||||
"office"
|
||||
],
|
||||
"main": "./cfb",
|
||||
"types": "types",
|
||||
"browser": {
|
||||
"node": false,
|
||||
"process": false,
|
||||
"fs": false
|
||||
},
|
||||
"dependencies": {
|
||||
"adler-32": "~1.3.0",
|
||||
"crc-32": "~1.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sheetjs/uglify-js": "~2.7.3",
|
||||
"@types/node": "^8.10.25",
|
||||
"acorn": "7.4.1",
|
||||
"alex": "8.1.1",
|
||||
"blanket": "~1.2.3",
|
||||
"dtslint": "~0.1.2",
|
||||
"eslint": "7.23.0",
|
||||
"eslint-plugin-html": "^6.1.2",
|
||||
"eslint-plugin-json": "^2.1.2",
|
||||
"jscs": "3.0.7",
|
||||
"jshint": "2.13.4",
|
||||
"mocha": "~2.5.3",
|
||||
"typescript": "2.2.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/SheetJS/js-cfb.git"
|
||||
},
|
||||
"scripts": {
|
||||
"pretest": "make init",
|
||||
"test": "make test",
|
||||
"dtslint": "dtslint types"
|
||||
},
|
||||
"config": {
|
||||
"blanket": {
|
||||
"pattern": "cfb.js"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"dist/",
|
||||
"types/index.d.ts",
|
||||
"types/tsconfig.json",
|
||||
"cfb.js",
|
||||
"xlscfb.flow.js"
|
||||
],
|
||||
"homepage": "http://sheetjs.com/",
|
||||
"bugs": {
|
||||
"url": "https://github.com/SheetJS/js-cfb/issues"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
import {Node} from 'acorn';
|
||||
|
||||
declare module "acorn-walk" {
|
||||
type FullWalkerCallback<TState> = (
|
||||
node: Node,
|
||||
state: TState,
|
||||
type: string
|
||||
) => void;
|
||||
|
||||
type FullAncestorWalkerCallback<TState> = (
|
||||
node: Node,
|
||||
state: TState | Node[],
|
||||
ancestors: Node[],
|
||||
type: string
|
||||
) => void;
|
||||
type WalkerCallback<TState> = (node: Node, state: TState) => void;
|
||||
|
||||
type SimpleWalkerFn<TState> = (
|
||||
node: Node,
|
||||
state: TState
|
||||
) => void;
|
||||
|
||||
type AncestorWalkerFn<TState> = (
|
||||
node: Node,
|
||||
state: TState| Node[],
|
||||
ancestors: Node[]
|
||||
) => void;
|
||||
|
||||
type RecursiveWalkerFn<TState> = (
|
||||
node: Node,
|
||||
state: TState,
|
||||
callback: WalkerCallback<TState>
|
||||
) => void;
|
||||
|
||||
type SimpleVisitors<TState> = {
|
||||
[type: string]: SimpleWalkerFn<TState>
|
||||
};
|
||||
|
||||
type AncestorVisitors<TState> = {
|
||||
[type: string]: AncestorWalkerFn<TState>
|
||||
};
|
||||
|
||||
type RecursiveVisitors<TState> = {
|
||||
[type: string]: RecursiveWalkerFn<TState>
|
||||
};
|
||||
|
||||
type FindPredicate = (type: string, node: Node) => boolean;
|
||||
|
||||
interface Found<TState> {
|
||||
node: Node,
|
||||
state: TState
|
||||
}
|
||||
|
||||
export function simple<TState>(
|
||||
node: Node,
|
||||
visitors: SimpleVisitors<TState>,
|
||||
base?: RecursiveVisitors<TState>,
|
||||
state?: TState
|
||||
): void;
|
||||
|
||||
export function ancestor<TState>(
|
||||
node: Node,
|
||||
visitors: AncestorVisitors<TState>,
|
||||
base?: RecursiveVisitors<TState>,
|
||||
state?: TState
|
||||
): void;
|
||||
|
||||
export function recursive<TState>(
|
||||
node: Node,
|
||||
state: TState,
|
||||
functions: RecursiveVisitors<TState>,
|
||||
base?: RecursiveVisitors<TState>
|
||||
): void;
|
||||
|
||||
export function full<TState>(
|
||||
node: Node,
|
||||
callback: FullWalkerCallback<TState>,
|
||||
base?: RecursiveVisitors<TState>,
|
||||
state?: TState
|
||||
): void;
|
||||
|
||||
export function fullAncestor<TState>(
|
||||
node: Node,
|
||||
callback: FullAncestorWalkerCallback<TState>,
|
||||
base?: RecursiveVisitors<TState>,
|
||||
state?: TState
|
||||
): void;
|
||||
|
||||
export function make<TState>(
|
||||
functions: RecursiveVisitors<TState>,
|
||||
base?: RecursiveVisitors<TState>
|
||||
): RecursiveVisitors<TState>;
|
||||
|
||||
export function findNodeAt<TState>(
|
||||
node: Node,
|
||||
start: number | undefined,
|
||||
end?: number | undefined,
|
||||
type?: FindPredicate | string,
|
||||
base?: RecursiveVisitors<TState>,
|
||||
state?: TState
|
||||
): Found<TState> | undefined;
|
||||
|
||||
export function findNodeAround<TState>(
|
||||
node: Node,
|
||||
start: number | undefined,
|
||||
type?: FindPredicate | string,
|
||||
base?: RecursiveVisitors<TState>,
|
||||
state?: TState
|
||||
): Found<TState> | undefined;
|
||||
|
||||
export const findNodeAfter: typeof findNodeAround;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for csv2json/src/index.ts</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../index.html">All files</a> / <a href="index.html">csv2json/src</a> index.ts
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>5/5</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>0/0</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>1/1</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>5/5</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">15x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span></td><td class="text"><pre class="prettyprint lang-js">import { TransformOptions } from "stream";
|
||||
import { CSVParseParam } from "./Parameters";
|
||||
import { Converter } from "./Converter";
|
||||
const helper = function (param?: Partial<CSVParseParam>, options?: TransformOptions): Converter {
|
||||
return new Converter(param, options);
|
||||
}
|
||||
|
||||
helper["Converter"] = Converter;
|
||||
export =helper;</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,298 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v1.2.8](https://github.com/minimistjs/minimist/compare/v1.2.7...v1.2.8) - 2023-02-09
|
||||
|
||||
### Merged
|
||||
|
||||
- [Fix] Fix long option followed by single dash [`#17`](https://github.com/minimistjs/minimist/pull/17)
|
||||
- [Tests] Remove duplicate test [`#12`](https://github.com/minimistjs/minimist/pull/12)
|
||||
- [Fix] opt.string works with multiple aliases [`#10`](https://github.com/minimistjs/minimist/pull/10)
|
||||
|
||||
### Fixed
|
||||
|
||||
- [Fix] Fix long option followed by single dash (#17) [`#15`](https://github.com/minimistjs/minimist/issues/15)
|
||||
- [Tests] Remove duplicate test (#12) [`#8`](https://github.com/minimistjs/minimist/issues/8)
|
||||
- [Fix] Fix long option followed by single dash [`#15`](https://github.com/minimistjs/minimist/issues/15)
|
||||
- [Fix] opt.string works with multiple aliases (#10) [`#9`](https://github.com/minimistjs/minimist/issues/9)
|
||||
- [Fix] Fix handling of short option with non-trivial equals [`#5`](https://github.com/minimistjs/minimist/issues/5)
|
||||
- [Tests] Remove duplicate test [`#8`](https://github.com/minimistjs/minimist/issues/8)
|
||||
- [Fix] opt.string works with multiple aliases [`#9`](https://github.com/minimistjs/minimist/issues/9)
|
||||
|
||||
### Commits
|
||||
|
||||
- Merge tag 'v0.2.3' [`a026794`](https://github.com/minimistjs/minimist/commit/a0267947c7870fc5847cf2d437fbe33f392767da)
|
||||
- [eslint] fix indentation and whitespace [`5368ca4`](https://github.com/minimistjs/minimist/commit/5368ca4147e974138a54cc0dc4cea8f756546b70)
|
||||
- [eslint] fix indentation and whitespace [`e5f5067`](https://github.com/minimistjs/minimist/commit/e5f5067259ceeaf0b098d14bec910f87e58708c7)
|
||||
- [eslint] more cleanup [`62fde7d`](https://github.com/minimistjs/minimist/commit/62fde7d935f83417fb046741531a9e2346a36976)
|
||||
- [eslint] more cleanup [`36ac5d0`](https://github.com/minimistjs/minimist/commit/36ac5d0d95e4947d074e5737d94814034ca335d1)
|
||||
- [meta] add `auto-changelog` [`73923d2`](https://github.com/minimistjs/minimist/commit/73923d223553fca08b1ba77e3fbc2a492862ae4c)
|
||||
- [actions] add reusable workflows [`d80727d`](https://github.com/minimistjs/minimist/commit/d80727df77bfa9e631044d7f16368d8f09242c91)
|
||||
- [eslint] add eslint; rules to enable later are warnings [`48bc06a`](https://github.com/minimistjs/minimist/commit/48bc06a1b41f00e9cdf183db34f7a51ba70e98d4)
|
||||
- [eslint] fix indentation [`34b0f1c`](https://github.com/minimistjs/minimist/commit/34b0f1ccaa45183c3c4f06a91f9b405180a6f982)
|
||||
- [readme] rename and add badges [`5df0fe4`](https://github.com/minimistjs/minimist/commit/5df0fe49211bd09a3636f8686a7cb3012c3e98f0)
|
||||
- [Dev Deps] switch from `covert` to `nyc` [`a48b128`](https://github.com/minimistjs/minimist/commit/a48b128fdb8d427dfb20a15273f83e38d97bef07)
|
||||
- [Dev Deps] update `covert`, `tape`; remove unnecessary `tap` [`f0fb958`](https://github.com/minimistjs/minimist/commit/f0fb958e9a1fe980cdffc436a211b0bda58f621b)
|
||||
- [meta] create FUNDING.yml; add `funding` in package.json [`3639e0c`](https://github.com/minimistjs/minimist/commit/3639e0c819359a366387e425ab6eabf4c78d3caa)
|
||||
- [meta] use `npmignore` to autogenerate an npmignore file [`be2e038`](https://github.com/minimistjs/minimist/commit/be2e038c342d8333b32f0fde67a0026b79c8150e)
|
||||
- Only apps should have lockfiles [`282b570`](https://github.com/minimistjs/minimist/commit/282b570e7489d01b03f2d6d3dabf79cd3e5f84cf)
|
||||
- isConstructorOrProto adapted from PR [`ef9153f`](https://github.com/minimistjs/minimist/commit/ef9153fc52b6cea0744b2239921c5dcae4697f11)
|
||||
- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`098873c`](https://github.com/minimistjs/minimist/commit/098873c213cdb7c92e55ae1ef5aa1af3a8192a79)
|
||||
- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`3124ed3`](https://github.com/minimistjs/minimist/commit/3124ed3e46306301ebb3c834874ce0241555c2c4)
|
||||
- [meta] add `safe-publish-latest` [`4b927de`](https://github.com/minimistjs/minimist/commit/4b927de696d561c636b4f43bf49d4597cb36d6d6)
|
||||
- [Tests] add `aud` in `posttest` [`b32d9bd`](https://github.com/minimistjs/minimist/commit/b32d9bd0ab340f4e9f8c3a97ff2a4424f25fab8c)
|
||||
- [meta] update repo URLs [`f9fdfc0`](https://github.com/minimistjs/minimist/commit/f9fdfc032c54884d9a9996a390c63cd0719bbe1a)
|
||||
- [actions] Avoid 0.6 tests due to build failures [`ba92fe6`](https://github.com/minimistjs/minimist/commit/ba92fe6ebbdc0431cca9a2ea8f27beb492f5e4ec)
|
||||
- [Dev Deps] update `tape` [`950eaa7`](https://github.com/minimistjs/minimist/commit/950eaa74f112e04d23e9c606c67472c46739b473)
|
||||
- [Dev Deps] add missing `npmignore` dev dep [`3226afa`](https://github.com/minimistjs/minimist/commit/3226afaf09e9d127ca369742437fe6e88f752d6b)
|
||||
- Merge tag 'v0.2.2' [`980d7ac`](https://github.com/minimistjs/minimist/commit/980d7ac61a0b4bd552711251ac107d506b23e41f)
|
||||
|
||||
## [v1.2.7](https://github.com/minimistjs/minimist/compare/v1.2.6...v1.2.7) - 2022-10-10
|
||||
|
||||
### Commits
|
||||
|
||||
- [meta] add `auto-changelog` [`0ebf4eb`](https://github.com/minimistjs/minimist/commit/0ebf4ebcd5f7787a5524d31a849ef41316b83c3c)
|
||||
- [actions] add reusable workflows [`e115b63`](https://github.com/minimistjs/minimist/commit/e115b63fa9d3909f33b00a2db647ff79068388de)
|
||||
- [eslint] add eslint; rules to enable later are warnings [`f58745b`](https://github.com/minimistjs/minimist/commit/f58745b9bb84348e1be72af7dbba5840c7c13013)
|
||||
- [Dev Deps] switch from `covert` to `nyc` [`ab03356`](https://github.com/minimistjs/minimist/commit/ab033567b9c8b31117cb026dc7f1e592ce455c65)
|
||||
- [readme] rename and add badges [`236f4a0`](https://github.com/minimistjs/minimist/commit/236f4a07e4ebe5ee44f1496ec6974991ab293ffd)
|
||||
- [meta] create FUNDING.yml; add `funding` in package.json [`783a49b`](https://github.com/minimistjs/minimist/commit/783a49bfd47e8335d3098a8cac75662cf71eb32a)
|
||||
- [meta] use `npmignore` to autogenerate an npmignore file [`f81ece6`](https://github.com/minimistjs/minimist/commit/f81ece6aaec2fa14e69ff4f1e0407a8c4e2635a2)
|
||||
- Only apps should have lockfiles [`56cad44`](https://github.com/minimistjs/minimist/commit/56cad44c7f879b9bb5ec18fcc349308024a89bfc)
|
||||
- [Dev Deps] update `covert`, `tape`; remove unnecessary `tap` [`49c5f9f`](https://github.com/minimistjs/minimist/commit/49c5f9fb7e6a92db9eb340cc679de92fb3aacded)
|
||||
- [Tests] add `aud` in `posttest` [`228ae93`](https://github.com/minimistjs/minimist/commit/228ae938f3cd9db9dfd8bd7458b076a7b2aef280)
|
||||
- [meta] add `safe-publish-latest` [`01fc23f`](https://github.com/minimistjs/minimist/commit/01fc23f5104f85c75059972e01dd33796ab529ff)
|
||||
- [meta] update repo URLs [`6b164c7`](https://github.com/minimistjs/minimist/commit/6b164c7d68e0b6bf32f894699effdfb7c63041dd)
|
||||
|
||||
## [v1.2.6](https://github.com/minimistjs/minimist/compare/v1.2.5...v1.2.6) - 2022-03-21
|
||||
|
||||
### Commits
|
||||
|
||||
- test from prototype pollution PR [`bc8ecee`](https://github.com/minimistjs/minimist/commit/bc8ecee43875261f4f17eb20b1243d3ed15e70eb)
|
||||
- isConstructorOrProto adapted from PR [`c2b9819`](https://github.com/minimistjs/minimist/commit/c2b981977fa834b223b408cfb860f933c9811e4d)
|
||||
- security notice for additional prototype pollution issue [`ef88b93`](https://github.com/minimistjs/minimist/commit/ef88b9325f77b5ee643ccfc97e2ebda577e4c4e2)
|
||||
|
||||
## [v1.2.5](https://github.com/minimistjs/minimist/compare/v1.2.4...v1.2.5) - 2020-03-12
|
||||
|
||||
## [v1.2.4](https://github.com/minimistjs/minimist/compare/v1.2.3...v1.2.4) - 2020-03-11
|
||||
|
||||
### Commits
|
||||
|
||||
- security notice [`4cf1354`](https://github.com/minimistjs/minimist/commit/4cf1354839cb972e38496d35e12f806eea92c11f)
|
||||
- additional test for constructor prototype pollution [`1043d21`](https://github.com/minimistjs/minimist/commit/1043d212c3caaf871966e710f52cfdf02f9eea4b)
|
||||
|
||||
## [v1.2.3](https://github.com/minimistjs/minimist/compare/v1.2.2...v1.2.3) - 2020-03-10
|
||||
|
||||
### Commits
|
||||
|
||||
- more failing proto pollution tests [`13c01a5`](https://github.com/minimistjs/minimist/commit/13c01a5327736903704984b7f65616b8476850cc)
|
||||
- even more aggressive checks for protocol pollution [`38a4d1c`](https://github.com/minimistjs/minimist/commit/38a4d1caead72ef99e824bb420a2528eec03d9ab)
|
||||
|
||||
## [v1.2.2](https://github.com/minimistjs/minimist/compare/v1.2.1...v1.2.2) - 2020-03-10
|
||||
|
||||
### Commits
|
||||
|
||||
- failing test for protocol pollution [`0efed03`](https://github.com/minimistjs/minimist/commit/0efed0340ec8433638758f7ca0c77cb20a0bfbab)
|
||||
- cleanup [`67d3722`](https://github.com/minimistjs/minimist/commit/67d3722413448d00a62963d2d30c34656a92d7e2)
|
||||
- console.dir -> console.log [`47acf72`](https://github.com/minimistjs/minimist/commit/47acf72c715a630bf9ea013867f47f1dd69dfc54)
|
||||
- don't assign onto __proto__ [`63e7ed0`](https://github.com/minimistjs/minimist/commit/63e7ed05aa4b1889ec2f3b196426db4500cbda94)
|
||||
|
||||
## [v1.2.1](https://github.com/minimistjs/minimist/compare/v1.2.0...v1.2.1) - 2020-03-10
|
||||
|
||||
### Merged
|
||||
|
||||
- move the `opts['--']` example back where it belongs [`#63`](https://github.com/minimistjs/minimist/pull/63)
|
||||
|
||||
### Commits
|
||||
|
||||
- add test [`6be5dae`](https://github.com/minimistjs/minimist/commit/6be5dae35a32a987bcf4137fcd6c19c5200ee909)
|
||||
- fix bad boolean regexp [`ac3fc79`](https://github.com/minimistjs/minimist/commit/ac3fc796e63b95128fdbdf67ea7fad71bd59aa76)
|
||||
|
||||
## [v1.2.0](https://github.com/minimistjs/minimist/compare/v1.1.3...v1.2.0) - 2015-08-24
|
||||
|
||||
### Commits
|
||||
|
||||
- failing -k=v short test [`63416b8`](https://github.com/minimistjs/minimist/commit/63416b8cd1d0d70e4714564cce465a36e4dd26d7)
|
||||
- kv short fix [`6bbe145`](https://github.com/minimistjs/minimist/commit/6bbe14529166245e86424f220a2321442fe88dc3)
|
||||
- failing kv short test [`f72ab7f`](https://github.com/minimistjs/minimist/commit/f72ab7f4572adc52902c9b6873cc969192f01b10)
|
||||
- fixed kv test [`f5a48c3`](https://github.com/minimistjs/minimist/commit/f5a48c3e50e40ca54f00c8e84de4b4d6e9897fa8)
|
||||
- enforce space between arg key and value [`86b321a`](https://github.com/minimistjs/minimist/commit/86b321affe648a8e016c095a4f0efa9d9074f502)
|
||||
|
||||
## [v1.1.3](https://github.com/minimistjs/minimist/compare/v1.1.2...v1.1.3) - 2015-08-06
|
||||
|
||||
### Commits
|
||||
|
||||
- add failing test - boolean alias array [`0fa3c5b`](https://github.com/minimistjs/minimist/commit/0fa3c5b3dd98551ddecf5392831b4c21211743fc)
|
||||
- fix boolean values with multiple aliases [`9c0a6e7`](https://github.com/minimistjs/minimist/commit/9c0a6e7de25a273b11bbf9a7464f0bd833779795)
|
||||
|
||||
## [v1.1.2](https://github.com/minimistjs/minimist/compare/v1.1.1...v1.1.2) - 2015-07-22
|
||||
|
||||
### Commits
|
||||
|
||||
- Convert boolean arguments to boolean values [`8f3dc27`](https://github.com/minimistjs/minimist/commit/8f3dc27cf833f1d54671b6d0bcb55c2fe19672a9)
|
||||
- use non-ancient npm, node 0.12 and iojs [`61ed1d0`](https://github.com/minimistjs/minimist/commit/61ed1d034b9ec7282764ce76f3992b1a0b4906ae)
|
||||
- an older npm for 0.8 [`25cf778`](https://github.com/minimistjs/minimist/commit/25cf778b1220e7838a526832ad6972f75244054f)
|
||||
|
||||
## [v1.1.1](https://github.com/minimistjs/minimist/compare/v1.1.0...v1.1.1) - 2015-03-10
|
||||
|
||||
### Commits
|
||||
|
||||
- check that they type of a value is a boolean, not just that it is currently set to a boolean [`6863198`](https://github.com/minimistjs/minimist/commit/6863198e36139830ff1f20ffdceaddd93f2c1db9)
|
||||
- upgrade tape, fix type issues from old tape version [`806712d`](https://github.com/minimistjs/minimist/commit/806712df91604ed02b8e39aa372b84aea659ee34)
|
||||
- test for setting a boolean to a null default [`8c444fe`](https://github.com/minimistjs/minimist/commit/8c444fe89384ded7d441c120915ea60620b01dd3)
|
||||
- if the previous value was a boolean, without an default (or with an alias) don't make an array either [`e5f419a`](https://github.com/minimistjs/minimist/commit/e5f419a3b5b3bc3f9e5ac71b7040621af70ed2dd)
|
||||
|
||||
## [v1.1.0](https://github.com/minimistjs/minimist/compare/v1.0.0...v1.1.0) - 2014-08-10
|
||||
|
||||
### Commits
|
||||
|
||||
- add support for handling "unknown" options not registered with the parser. [`6f3cc5d`](https://github.com/minimistjs/minimist/commit/6f3cc5d4e84524932a6ef2ce3592acc67cdd4383)
|
||||
- reformat package.json [`02ed371`](https://github.com/minimistjs/minimist/commit/02ed37115194d3697ff358e8e25e5e66bab1d9f8)
|
||||
- coverage script [`e5531ba`](https://github.com/minimistjs/minimist/commit/e5531ba0479da3b8138d3d8cac545d84ccb1c8df)
|
||||
- extra fn to get 100% coverage again [`a6972da`](https://github.com/minimistjs/minimist/commit/a6972da89e56bf77642f8ec05a13b6558db93498)
|
||||
|
||||
## [v1.0.0](https://github.com/minimistjs/minimist/compare/v0.2.3...v1.0.0) - 2014-08-10
|
||||
|
||||
### Commits
|
||||
|
||||
- added stopEarly option [`471c7e4`](https://github.com/minimistjs/minimist/commit/471c7e4a7e910fc7ad8f9df850a186daf32c64e9)
|
||||
- fix list [`fef6ae7`](https://github.com/minimistjs/minimist/commit/fef6ae79c38b9dc1c49569abb7cd04eb965eac5e)
|
||||
|
||||
## [v0.2.3](https://github.com/minimistjs/minimist/compare/v0.2.2...v0.2.3) - 2023-02-09
|
||||
|
||||
### Merged
|
||||
|
||||
- [Fix] Fix long option followed by single dash [`#17`](https://github.com/minimistjs/minimist/pull/17)
|
||||
- [Tests] Remove duplicate test [`#12`](https://github.com/minimistjs/minimist/pull/12)
|
||||
- [Fix] opt.string works with multiple aliases [`#10`](https://github.com/minimistjs/minimist/pull/10)
|
||||
|
||||
### Fixed
|
||||
|
||||
- [Fix] Fix long option followed by single dash (#17) [`#15`](https://github.com/minimistjs/minimist/issues/15)
|
||||
- [Tests] Remove duplicate test (#12) [`#8`](https://github.com/minimistjs/minimist/issues/8)
|
||||
- [Fix] opt.string works with multiple aliases (#10) [`#9`](https://github.com/minimistjs/minimist/issues/9)
|
||||
|
||||
### Commits
|
||||
|
||||
- [eslint] fix indentation and whitespace [`e5f5067`](https://github.com/minimistjs/minimist/commit/e5f5067259ceeaf0b098d14bec910f87e58708c7)
|
||||
- [eslint] more cleanup [`36ac5d0`](https://github.com/minimistjs/minimist/commit/36ac5d0d95e4947d074e5737d94814034ca335d1)
|
||||
- [eslint] fix indentation [`34b0f1c`](https://github.com/minimistjs/minimist/commit/34b0f1ccaa45183c3c4f06a91f9b405180a6f982)
|
||||
- isConstructorOrProto adapted from PR [`ef9153f`](https://github.com/minimistjs/minimist/commit/ef9153fc52b6cea0744b2239921c5dcae4697f11)
|
||||
- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`098873c`](https://github.com/minimistjs/minimist/commit/098873c213cdb7c92e55ae1ef5aa1af3a8192a79)
|
||||
- [Dev Deps] add missing `npmignore` dev dep [`3226afa`](https://github.com/minimistjs/minimist/commit/3226afaf09e9d127ca369742437fe6e88f752d6b)
|
||||
|
||||
## [v0.2.2](https://github.com/minimistjs/minimist/compare/v0.2.1...v0.2.2) - 2022-10-10
|
||||
|
||||
### Commits
|
||||
|
||||
- [meta] add `auto-changelog` [`73923d2`](https://github.com/minimistjs/minimist/commit/73923d223553fca08b1ba77e3fbc2a492862ae4c)
|
||||
- [actions] add reusable workflows [`d80727d`](https://github.com/minimistjs/minimist/commit/d80727df77bfa9e631044d7f16368d8f09242c91)
|
||||
- [eslint] add eslint; rules to enable later are warnings [`48bc06a`](https://github.com/minimistjs/minimist/commit/48bc06a1b41f00e9cdf183db34f7a51ba70e98d4)
|
||||
- [readme] rename and add badges [`5df0fe4`](https://github.com/minimistjs/minimist/commit/5df0fe49211bd09a3636f8686a7cb3012c3e98f0)
|
||||
- [Dev Deps] switch from `covert` to `nyc` [`a48b128`](https://github.com/minimistjs/minimist/commit/a48b128fdb8d427dfb20a15273f83e38d97bef07)
|
||||
- [Dev Deps] update `covert`, `tape`; remove unnecessary `tap` [`f0fb958`](https://github.com/minimistjs/minimist/commit/f0fb958e9a1fe980cdffc436a211b0bda58f621b)
|
||||
- [meta] create FUNDING.yml; add `funding` in package.json [`3639e0c`](https://github.com/minimistjs/minimist/commit/3639e0c819359a366387e425ab6eabf4c78d3caa)
|
||||
- [meta] use `npmignore` to autogenerate an npmignore file [`be2e038`](https://github.com/minimistjs/minimist/commit/be2e038c342d8333b32f0fde67a0026b79c8150e)
|
||||
- Only apps should have lockfiles [`282b570`](https://github.com/minimistjs/minimist/commit/282b570e7489d01b03f2d6d3dabf79cd3e5f84cf)
|
||||
- [meta] add `safe-publish-latest` [`4b927de`](https://github.com/minimistjs/minimist/commit/4b927de696d561c636b4f43bf49d4597cb36d6d6)
|
||||
- [Tests] add `aud` in `posttest` [`b32d9bd`](https://github.com/minimistjs/minimist/commit/b32d9bd0ab340f4e9f8c3a97ff2a4424f25fab8c)
|
||||
- [meta] update repo URLs [`f9fdfc0`](https://github.com/minimistjs/minimist/commit/f9fdfc032c54884d9a9996a390c63cd0719bbe1a)
|
||||
|
||||
## [v0.2.1](https://github.com/minimistjs/minimist/compare/v0.2.0...v0.2.1) - 2020-03-12
|
||||
|
||||
## [v0.2.0](https://github.com/minimistjs/minimist/compare/v0.1.0...v0.2.0) - 2014-06-19
|
||||
|
||||
### Commits
|
||||
|
||||
- support all-boolean mode [`450a97f`](https://github.com/minimistjs/minimist/commit/450a97f6e2bc85c7a4a13185c19a818d9a5ebe69)
|
||||
|
||||
## [v0.1.0](https://github.com/minimistjs/minimist/compare/v0.0.10...v0.1.0) - 2014-05-12
|
||||
|
||||
### Commits
|
||||
|
||||
- Provide a mechanism to segregate -- arguments [`ce4a1e6`](https://github.com/minimistjs/minimist/commit/ce4a1e63a7e8d5ab88d2a3768adefa6af98a445a)
|
||||
- documented argv['--'] [`14db0e6`](https://github.com/minimistjs/minimist/commit/14db0e6dbc6d2b9e472adaa54dad7004b364634f)
|
||||
- Adding a test-case for notFlags segregation [`715c1e3`](https://github.com/minimistjs/minimist/commit/715c1e3714be223f998f6c537af6b505f0236c16)
|
||||
|
||||
## [v0.0.10](https://github.com/minimistjs/minimist/compare/v0.0.9...v0.0.10) - 2014-05-11
|
||||
|
||||
### Commits
|
||||
|
||||
- dedicated boolean test [`46e448f`](https://github.com/minimistjs/minimist/commit/46e448f9f513cfeb2bcc8b688b9b47ba1e515c2b)
|
||||
- dedicated num test [`9bf2d36`](https://github.com/minimistjs/minimist/commit/9bf2d36f1d3b8795be90b8f7de0a937f098aa394)
|
||||
- aliased values treated as strings [`1ab743b`](https://github.com/minimistjs/minimist/commit/1ab743bad4484d69f1259bed42f9531de01119de)
|
||||
- cover the case of already numbers, at 100% coverage [`b2bb044`](https://github.com/minimistjs/minimist/commit/b2bb04436599d77a2ce029e8e555e25b3aa55d13)
|
||||
- another test for higher coverage [`3662624`](https://github.com/minimistjs/minimist/commit/3662624be976d5489d486a856849c048d13be903)
|
||||
|
||||
## [v0.0.9](https://github.com/minimistjs/minimist/compare/v0.0.8...v0.0.9) - 2014-05-08
|
||||
|
||||
### Commits
|
||||
|
||||
- Eliminate `longest` fn. [`824f642`](https://github.com/minimistjs/minimist/commit/824f642038d1b02ede68b6261d1d65163390929a)
|
||||
|
||||
## [v0.0.8](https://github.com/minimistjs/minimist/compare/v0.0.7...v0.0.8) - 2014-02-20
|
||||
|
||||
### Commits
|
||||
|
||||
- return '' if flag is string and empty [`fa63ed4`](https://github.com/minimistjs/minimist/commit/fa63ed4651a4ef4eefddce34188e0d98d745a263)
|
||||
- handle joined single letters [`66c248f`](https://github.com/minimistjs/minimist/commit/66c248f0241d4d421d193b022e9e365f11178534)
|
||||
|
||||
## [v0.0.7](https://github.com/minimistjs/minimist/compare/v0.0.6...v0.0.7) - 2014-02-08
|
||||
|
||||
### Commits
|
||||
|
||||
- another swap of .test for .match [`d1da408`](https://github.com/minimistjs/minimist/commit/d1da40819acbe846d89a5c02721211e3c1260dde)
|
||||
|
||||
## [v0.0.6](https://github.com/minimistjs/minimist/compare/v0.0.5...v0.0.6) - 2014-02-08
|
||||
|
||||
### Commits
|
||||
|
||||
- use .test() instead of .match() to not crash on non-string values in the arguments array [`7e0d1ad`](https://github.com/minimistjs/minimist/commit/7e0d1add8c9e5b9b20a4d3d0f9a94d824c578da1)
|
||||
|
||||
## [v0.0.5](https://github.com/minimistjs/minimist/compare/v0.0.4...v0.0.5) - 2013-09-18
|
||||
|
||||
### Commits
|
||||
|
||||
- Improve '--' handling. [`b11822c`](https://github.com/minimistjs/minimist/commit/b11822c09cc9d2460f30384d12afc0b953c037a4)
|
||||
|
||||
## [v0.0.4](https://github.com/minimistjs/minimist/compare/v0.0.3...v0.0.4) - 2013-09-17
|
||||
|
||||
## [v0.0.3](https://github.com/minimistjs/minimist/compare/v0.0.2...v0.0.3) - 2013-09-12
|
||||
|
||||
### Commits
|
||||
|
||||
- failing test for single dash preceeding a double dash [`b465514`](https://github.com/minimistjs/minimist/commit/b465514b82c9ae28972d714facd951deb2ad762b)
|
||||
- fix for the dot test [`6a095f1`](https://github.com/minimistjs/minimist/commit/6a095f1d364c8fab2d6753d2291a0649315d297a)
|
||||
|
||||
## [v0.0.2](https://github.com/minimistjs/minimist/compare/v0.0.1...v0.0.2) - 2013-08-28
|
||||
|
||||
### Commits
|
||||
|
||||
- allow dotted aliases & defaults [`321c33e`](https://github.com/minimistjs/minimist/commit/321c33e755485faaeb44eeb1c05d33b2e0a5a7c4)
|
||||
- use a better version of ff [`e40f611`](https://github.com/minimistjs/minimist/commit/e40f61114cf7be6f7947f7b3eed345853a67dbbb)
|
||||
|
||||
## [v0.0.1](https://github.com/minimistjs/minimist/compare/v0.0.0...v0.0.1) - 2013-06-25
|
||||
|
||||
### Commits
|
||||
|
||||
- remove trailing commas [`6ff0fa0`](https://github.com/minimistjs/minimist/commit/6ff0fa055064f15dbe06d50b89d5173a6796e1db)
|
||||
|
||||
## v0.0.0 - 2013-06-25
|
||||
|
||||
### Commits
|
||||
|
||||
- half of the parse test ported [`3079326`](https://github.com/minimistjs/minimist/commit/307932601325087de6cf94188eb798ffc4f3088a)
|
||||
- stripped down code and a passing test from optimist [`7cced88`](https://github.com/minimistjs/minimist/commit/7cced88d82e399d1a03ed23eb667f04d3f320d10)
|
||||
- ported parse tests completely over [`9448754`](https://github.com/minimistjs/minimist/commit/944875452e0820df6830b1408c26a0f7d3e1db04)
|
||||
- docs, package.json [`a5bf46a`](https://github.com/minimistjs/minimist/commit/a5bf46ac9bb3bd114a9c340276c62c1091e538d5)
|
||||
- move more short tests into short.js [`503edb5`](https://github.com/minimistjs/minimist/commit/503edb5c41d89c0d40831ee517154fc13b0f18b9)
|
||||
- default bool test was wrong, not the code [`1b9f5db`](https://github.com/minimistjs/minimist/commit/1b9f5db4741b49962846081b68518de824992097)
|
||||
- passing long tests ripped out of parse.js [`7972c4a`](https://github.com/minimistjs/minimist/commit/7972c4aff1f4803079e1668006658e2a761a0428)
|
||||
- badges [`84c0370`](https://github.com/minimistjs/minimist/commit/84c037063664d42878aace715fe6572ce01b6f3b)
|
||||
- all the tests now ported, some failures [`64239ed`](https://github.com/minimistjs/minimist/commit/64239edfe92c711c4eb0da254fcdfad2a5fdb605)
|
||||
- failing short test [`f8a5341`](https://github.com/minimistjs/minimist/commit/f8a534112dd1138d2fad722def56a848480c446f)
|
||||
- fixed the numeric test [`6b034f3`](https://github.com/minimistjs/minimist/commit/6b034f37c79342c60083ed97fd222e16928aac51)
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isResolvable.js","sourceRoot":"","sources":["../src/isResolvable.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAAmC;AAEnC;;;;;GAKG;AAEH,SAA8B,YAAY,CAAC,IAAY;;QACtD,MAAM,MAAM,GAAG,CAAC,CAAC;QACjB,IAAI;YACH,IAAI,MAAM,IAAA,gBAAS,EAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;gBACtC,OAAO,IAAI,CAAC;aACZ;SACD;QAAC,OAAO,GAAG,EAAE;YACb,SAAS;SACT;QACD,OAAO,KAAK,CAAC;IACd,CAAC;CAAA;AAVD,+BAUC"}
|
||||
@@ -0,0 +1,33 @@
|
||||
// TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.
|
||||
export function stringReplaceAll(string, substring, replacer) {
|
||||
let index = string.indexOf(substring);
|
||||
if (index === -1) {
|
||||
return string;
|
||||
}
|
||||
|
||||
const substringLength = substring.length;
|
||||
let endIndex = 0;
|
||||
let returnValue = '';
|
||||
do {
|
||||
returnValue += string.slice(endIndex, index) + substring + replacer;
|
||||
endIndex = index + substringLength;
|
||||
index = string.indexOf(substring, endIndex);
|
||||
} while (index !== -1);
|
||||
|
||||
returnValue += string.slice(endIndex);
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
export function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
||||
let endIndex = 0;
|
||||
let returnValue = '';
|
||||
do {
|
||||
const gotCR = string[index - 1] === '\r';
|
||||
returnValue += string.slice(endIndex, (gotCR ? index - 1 : index)) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
|
||||
endIndex = index + 1;
|
||||
index = string.indexOf('\n', endIndex);
|
||||
} while (index !== -1);
|
||||
|
||||
returnValue += string.slice(endIndex);
|
||||
return returnValue;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"overrides": [
|
||||
{
|
||||
"files": "test/**",
|
||||
"rules": {
|
||||
"no-restricted-properties": 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
'use strict';
|
||||
var fs = require('fs')
|
||||
var ini = require('ini')
|
||||
var path = require('path')
|
||||
var stripJsonComments = require('strip-json-comments')
|
||||
|
||||
var parse = exports.parse = function (content) {
|
||||
|
||||
//if it ends in .json or starts with { then it must be json.
|
||||
//must be done this way, because ini accepts everything.
|
||||
//can't just try and parse it and let it throw if it's not ini.
|
||||
//everything is ini. even json with a syntax error.
|
||||
|
||||
if(/^\s*{/.test(content))
|
||||
return JSON.parse(stripJsonComments(content))
|
||||
return ini.parse(content)
|
||||
|
||||
}
|
||||
|
||||
var file = exports.file = function () {
|
||||
var args = [].slice.call(arguments).filter(function (arg) { return arg != null })
|
||||
|
||||
//path.join breaks if it's a not a string, so just skip this.
|
||||
for(var i in args)
|
||||
if('string' !== typeof args[i])
|
||||
return
|
||||
|
||||
var file = path.join.apply(null, args)
|
||||
var content
|
||||
try {
|
||||
return fs.readFileSync(file,'utf-8')
|
||||
} catch (err) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
var json = exports.json = function () {
|
||||
var content = file.apply(null, arguments)
|
||||
return content ? parse(content) : null
|
||||
}
|
||||
|
||||
var env = exports.env = function (prefix, env) {
|
||||
env = env || process.env
|
||||
var obj = {}
|
||||
var l = prefix.length
|
||||
for(var k in env) {
|
||||
if(k.toLowerCase().indexOf(prefix.toLowerCase()) === 0) {
|
||||
|
||||
var keypath = k.substring(l).split('__')
|
||||
|
||||
// Trim empty strings from keypath array
|
||||
var _emptyStringIndex
|
||||
while ((_emptyStringIndex=keypath.indexOf('')) > -1) {
|
||||
keypath.splice(_emptyStringIndex, 1)
|
||||
}
|
||||
|
||||
var cursor = obj
|
||||
keypath.forEach(function _buildSubObj(_subkey,i){
|
||||
|
||||
// (check for _subkey first so we ignore empty strings)
|
||||
// (check for cursor to avoid assignment to primitive objects)
|
||||
if (!_subkey || typeof cursor !== 'object')
|
||||
return
|
||||
|
||||
// If this is the last key, just stuff the value in there
|
||||
// Assigns actual value from env variable to final key
|
||||
// (unless it's just an empty string- in that case use the last valid key)
|
||||
if (i === keypath.length-1)
|
||||
cursor[_subkey] = env[k]
|
||||
|
||||
|
||||
// Build sub-object if nothing already exists at the keypath
|
||||
if (cursor[_subkey] === undefined)
|
||||
cursor[_subkey] = {}
|
||||
|
||||
// Increment cursor used to track the object at the current depth
|
||||
cursor = cursor[_subkey]
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return obj
|
||||
}
|
||||
|
||||
var find = exports.find = function () {
|
||||
var rel = path.join.apply(null, [].slice.call(arguments))
|
||||
|
||||
function find(start, rel) {
|
||||
var file = path.join(start, rel)
|
||||
try {
|
||||
fs.statSync(file)
|
||||
return file
|
||||
} catch (err) {
|
||||
if(path.dirname(start) !== start) // root
|
||||
return find(path.dirname(start), rel)
|
||||
}
|
||||
}
|
||||
return find(process.cwd(), rel)
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = tab
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[{package.json,*.yml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
@@ -0,0 +1,55 @@
|
||||
const REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
|
||||
const REGEX_IS_INSTALLATION = /^ghs_/;
|
||||
const REGEX_IS_USER_TO_SERVER = /^ghu_/;
|
||||
async function auth(token) {
|
||||
const isApp = token.split(/\./).length === 3;
|
||||
const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) ||
|
||||
REGEX_IS_INSTALLATION.test(token);
|
||||
const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
|
||||
const tokenType = isApp
|
||||
? "app"
|
||||
: isInstallation
|
||||
? "installation"
|
||||
: isUserToServer
|
||||
? "user-to-server"
|
||||
: "oauth";
|
||||
return {
|
||||
type: "token",
|
||||
token: token,
|
||||
tokenType,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Prefix token for usage in the Authorization header
|
||||
*
|
||||
* @param token OAuth token or JSON Web Token
|
||||
*/
|
||||
function withAuthorizationPrefix(token) {
|
||||
if (token.split(/\./).length === 3) {
|
||||
return `bearer ${token}`;
|
||||
}
|
||||
return `token ${token}`;
|
||||
}
|
||||
|
||||
async function hook(token, request, route, parameters) {
|
||||
const endpoint = request.endpoint.merge(route, parameters);
|
||||
endpoint.headers.authorization = withAuthorizationPrefix(token);
|
||||
return request(endpoint);
|
||||
}
|
||||
|
||||
const createTokenAuth = function createTokenAuth(token) {
|
||||
if (!token) {
|
||||
throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
|
||||
}
|
||||
if (typeof token !== "string") {
|
||||
throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
|
||||
}
|
||||
token = token.replace(/^(token|bearer) +/i, "");
|
||||
return Object.assign(auth.bind(null, token), {
|
||||
hook: hook.bind(null, token),
|
||||
});
|
||||
};
|
||||
|
||||
export { createTokenAuth };
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Processor = /** @class */ (function () {
|
||||
function Processor(converter) {
|
||||
this.converter = converter;
|
||||
this.params = converter.parseParam;
|
||||
this.runtime = converter.parseRuntime;
|
||||
}
|
||||
return Processor;
|
||||
}());
|
||||
exports.Processor = Processor;
|
||||
//# sourceMappingURL=Processor.js.map
|
||||
Reference in New Issue
Block a user