new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"combineLatestWith.d.ts","sourceRoot":"","sources":["../../../../src/internal/operators/combineLatestWith.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,SAAS,OAAO,EAAE,EAC/D,GAAG,YAAY,EAAE,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,GAC5C,gBAAgB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAEjC"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A CC","132":"B"},B:{"1":"P Q R S","132":"C K L G M N O","513":"T U V W X Y Z a b c d e i j k l m n o p q r s t u f H"},C:{"1":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V","2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB EC FC","513":"W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB"},D:{"1":"vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T","2":"I v J D E F A B C K L G M N O w g","260":"0 1 2 3 4 5 6 7 8 9 x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB","513":"U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC"},E:{"1":"C qB rB","2":"I v J D HC zB IC JC","132":"E F A B KC LC 0B","1025":"K L G 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB","2":"F B C PC QC RC SC qB AC TC rB","513":"h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e"},G:{"1":"fC gC hC iC","2":"zB UC BC VC WC XC","132":"E YC ZC aC bC cC dC eC","1025":"jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"2":"A B C qB AC rB","513":"h"},L:{"513":"H"},M:{"513":"H"},N:{"2":"A B"},O:{"1":"vC"},P:{"1":"g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C","2":"I"},Q:{"1":"1B"},R:{"513":"9C"},S:{"1":"AD BD"}},B:4,C:"Referrer Policy"};
|
||||
@@ -0,0 +1,11 @@
|
||||
import process from 'node:process';
|
||||
import onetime from 'onetime';
|
||||
import signalExit from 'signal-exit';
|
||||
|
||||
const restoreCursor = onetime(() => {
|
||||
signalExit(() => {
|
||||
process.stderr.write('\u001B[?25h');
|
||||
}, {alwaysLast: true});
|
||||
});
|
||||
|
||||
export default restoreCursor;
|
||||
@@ -0,0 +1,2 @@
|
||||
if(typeof cptable === 'undefined') cptable = {};
|
||||
cptable[737] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
@@ -0,0 +1,321 @@
|
||||
var openParentheses = "(".charCodeAt(0);
|
||||
var closeParentheses = ")".charCodeAt(0);
|
||||
var singleQuote = "'".charCodeAt(0);
|
||||
var doubleQuote = '"'.charCodeAt(0);
|
||||
var backslash = "\\".charCodeAt(0);
|
||||
var slash = "/".charCodeAt(0);
|
||||
var comma = ",".charCodeAt(0);
|
||||
var colon = ":".charCodeAt(0);
|
||||
var star = "*".charCodeAt(0);
|
||||
var uLower = "u".charCodeAt(0);
|
||||
var uUpper = "U".charCodeAt(0);
|
||||
var plus = "+".charCodeAt(0);
|
||||
var isUnicodeRange = /^[a-f0-9?-]+$/i;
|
||||
|
||||
module.exports = function(input) {
|
||||
var tokens = [];
|
||||
var value = input;
|
||||
|
||||
var next,
|
||||
quote,
|
||||
prev,
|
||||
token,
|
||||
escape,
|
||||
escapePos,
|
||||
whitespacePos,
|
||||
parenthesesOpenPos;
|
||||
var pos = 0;
|
||||
var code = value.charCodeAt(pos);
|
||||
var max = value.length;
|
||||
var stack = [{ nodes: tokens }];
|
||||
var balanced = 0;
|
||||
var parent;
|
||||
|
||||
var name = "";
|
||||
var before = "";
|
||||
var after = "";
|
||||
|
||||
while (pos < max) {
|
||||
// Whitespaces
|
||||
if (code <= 32) {
|
||||
next = pos;
|
||||
do {
|
||||
next += 1;
|
||||
code = value.charCodeAt(next);
|
||||
} while (code <= 32);
|
||||
token = value.slice(pos, next);
|
||||
|
||||
prev = tokens[tokens.length - 1];
|
||||
if (code === closeParentheses && balanced) {
|
||||
after = token;
|
||||
} else if (prev && prev.type === "div") {
|
||||
prev.after = token;
|
||||
prev.sourceEndIndex += token.length;
|
||||
} else if (
|
||||
code === comma ||
|
||||
code === colon ||
|
||||
(code === slash &&
|
||||
value.charCodeAt(next + 1) !== star &&
|
||||
(!parent ||
|
||||
(parent && parent.type === "function" && parent.value !== "calc")))
|
||||
) {
|
||||
before = token;
|
||||
} else {
|
||||
tokens.push({
|
||||
type: "space",
|
||||
sourceIndex: pos,
|
||||
sourceEndIndex: next,
|
||||
value: token
|
||||
});
|
||||
}
|
||||
|
||||
pos = next;
|
||||
|
||||
// Quotes
|
||||
} else if (code === singleQuote || code === doubleQuote) {
|
||||
next = pos;
|
||||
quote = code === singleQuote ? "'" : '"';
|
||||
token = {
|
||||
type: "string",
|
||||
sourceIndex: pos,
|
||||
quote: quote
|
||||
};
|
||||
do {
|
||||
escape = false;
|
||||
next = value.indexOf(quote, next + 1);
|
||||
if (~next) {
|
||||
escapePos = next;
|
||||
while (value.charCodeAt(escapePos - 1) === backslash) {
|
||||
escapePos -= 1;
|
||||
escape = !escape;
|
||||
}
|
||||
} else {
|
||||
value += quote;
|
||||
next = value.length - 1;
|
||||
token.unclosed = true;
|
||||
}
|
||||
} while (escape);
|
||||
token.value = value.slice(pos + 1, next);
|
||||
token.sourceEndIndex = token.unclosed ? next : next + 1;
|
||||
tokens.push(token);
|
||||
pos = next + 1;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
// Comments
|
||||
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
|
||||
next = value.indexOf("*/", pos);
|
||||
|
||||
token = {
|
||||
type: "comment",
|
||||
sourceIndex: pos,
|
||||
sourceEndIndex: next + 2
|
||||
};
|
||||
|
||||
if (next === -1) {
|
||||
token.unclosed = true;
|
||||
next = value.length;
|
||||
token.sourceEndIndex = next;
|
||||
}
|
||||
|
||||
token.value = value.slice(pos + 2, next);
|
||||
tokens.push(token);
|
||||
|
||||
pos = next + 2;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
// Operation within calc
|
||||
} else if (
|
||||
(code === slash || code === star) &&
|
||||
parent &&
|
||||
parent.type === "function" &&
|
||||
parent.value === "calc"
|
||||
) {
|
||||
token = value[pos];
|
||||
tokens.push({
|
||||
type: "word",
|
||||
sourceIndex: pos - before.length,
|
||||
sourceEndIndex: pos + token.length,
|
||||
value: token
|
||||
});
|
||||
pos += 1;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
// Dividers
|
||||
} else if (code === slash || code === comma || code === colon) {
|
||||
token = value[pos];
|
||||
|
||||
tokens.push({
|
||||
type: "div",
|
||||
sourceIndex: pos - before.length,
|
||||
sourceEndIndex: pos + token.length,
|
||||
value: token,
|
||||
before: before,
|
||||
after: ""
|
||||
});
|
||||
before = "";
|
||||
|
||||
pos += 1;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
// Open parentheses
|
||||
} else if (openParentheses === code) {
|
||||
// Whitespaces after open parentheses
|
||||
next = pos;
|
||||
do {
|
||||
next += 1;
|
||||
code = value.charCodeAt(next);
|
||||
} while (code <= 32);
|
||||
parenthesesOpenPos = pos;
|
||||
token = {
|
||||
type: "function",
|
||||
sourceIndex: pos - name.length,
|
||||
value: name,
|
||||
before: value.slice(parenthesesOpenPos + 1, next)
|
||||
};
|
||||
pos = next;
|
||||
|
||||
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
|
||||
next -= 1;
|
||||
do {
|
||||
escape = false;
|
||||
next = value.indexOf(")", next + 1);
|
||||
if (~next) {
|
||||
escapePos = next;
|
||||
while (value.charCodeAt(escapePos - 1) === backslash) {
|
||||
escapePos -= 1;
|
||||
escape = !escape;
|
||||
}
|
||||
} else {
|
||||
value += ")";
|
||||
next = value.length - 1;
|
||||
token.unclosed = true;
|
||||
}
|
||||
} while (escape);
|
||||
// Whitespaces before closed
|
||||
whitespacePos = next;
|
||||
do {
|
||||
whitespacePos -= 1;
|
||||
code = value.charCodeAt(whitespacePos);
|
||||
} while (code <= 32);
|
||||
if (parenthesesOpenPos < whitespacePos) {
|
||||
if (pos !== whitespacePos + 1) {
|
||||
token.nodes = [
|
||||
{
|
||||
type: "word",
|
||||
sourceIndex: pos,
|
||||
sourceEndIndex: whitespacePos + 1,
|
||||
value: value.slice(pos, whitespacePos + 1)
|
||||
}
|
||||
];
|
||||
} else {
|
||||
token.nodes = [];
|
||||
}
|
||||
if (token.unclosed && whitespacePos + 1 !== next) {
|
||||
token.after = "";
|
||||
token.nodes.push({
|
||||
type: "space",
|
||||
sourceIndex: whitespacePos + 1,
|
||||
sourceEndIndex: next,
|
||||
value: value.slice(whitespacePos + 1, next)
|
||||
});
|
||||
} else {
|
||||
token.after = value.slice(whitespacePos + 1, next);
|
||||
token.sourceEndIndex = next;
|
||||
}
|
||||
} else {
|
||||
token.after = "";
|
||||
token.nodes = [];
|
||||
}
|
||||
pos = next + 1;
|
||||
token.sourceEndIndex = token.unclosed ? next : pos;
|
||||
code = value.charCodeAt(pos);
|
||||
tokens.push(token);
|
||||
} else {
|
||||
balanced += 1;
|
||||
token.after = "";
|
||||
token.sourceEndIndex = pos + 1;
|
||||
tokens.push(token);
|
||||
stack.push(token);
|
||||
tokens = token.nodes = [];
|
||||
parent = token;
|
||||
}
|
||||
name = "";
|
||||
|
||||
// Close parentheses
|
||||
} else if (closeParentheses === code && balanced) {
|
||||
pos += 1;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
parent.after = after;
|
||||
parent.sourceEndIndex += after.length;
|
||||
after = "";
|
||||
balanced -= 1;
|
||||
stack[stack.length - 1].sourceEndIndex = pos;
|
||||
stack.pop();
|
||||
parent = stack[balanced];
|
||||
tokens = parent.nodes;
|
||||
|
||||
// Words
|
||||
} else {
|
||||
next = pos;
|
||||
do {
|
||||
if (code === backslash) {
|
||||
next += 1;
|
||||
}
|
||||
next += 1;
|
||||
code = value.charCodeAt(next);
|
||||
} while (
|
||||
next < max &&
|
||||
!(
|
||||
code <= 32 ||
|
||||
code === singleQuote ||
|
||||
code === doubleQuote ||
|
||||
code === comma ||
|
||||
code === colon ||
|
||||
code === slash ||
|
||||
code === openParentheses ||
|
||||
(code === star &&
|
||||
parent &&
|
||||
parent.type === "function" &&
|
||||
parent.value === "calc") ||
|
||||
(code === slash &&
|
||||
parent.type === "function" &&
|
||||
parent.value === "calc") ||
|
||||
(code === closeParentheses && balanced)
|
||||
)
|
||||
);
|
||||
token = value.slice(pos, next);
|
||||
|
||||
if (openParentheses === code) {
|
||||
name = token;
|
||||
} else if (
|
||||
(uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) &&
|
||||
plus === token.charCodeAt(1) &&
|
||||
isUnicodeRange.test(token.slice(2))
|
||||
) {
|
||||
tokens.push({
|
||||
type: "unicode-range",
|
||||
sourceIndex: pos,
|
||||
sourceEndIndex: next,
|
||||
value: token
|
||||
});
|
||||
} else {
|
||||
tokens.push({
|
||||
type: "word",
|
||||
sourceIndex: pos,
|
||||
sourceEndIndex: next,
|
||||
value: token
|
||||
});
|
||||
}
|
||||
|
||||
pos = next;
|
||||
}
|
||||
}
|
||||
|
||||
for (pos = stack.length - 1; pos; pos -= 1) {
|
||||
stack[pos].unclosed = true;
|
||||
stack[pos].sourceEndIndex = value.length;
|
||||
}
|
||||
|
||||
return stack[0].nodes;
|
||||
};
|
||||
@@ -0,0 +1,102 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.universal = exports.tag = exports.string = exports.selector = exports.root = exports.pseudo = exports.nesting = exports.id = exports.comment = exports.combinator = exports.className = exports.attribute = void 0;
|
||||
|
||||
var _attribute = _interopRequireDefault(require("./attribute"));
|
||||
|
||||
var _className = _interopRequireDefault(require("./className"));
|
||||
|
||||
var _combinator = _interopRequireDefault(require("./combinator"));
|
||||
|
||||
var _comment = _interopRequireDefault(require("./comment"));
|
||||
|
||||
var _id = _interopRequireDefault(require("./id"));
|
||||
|
||||
var _nesting = _interopRequireDefault(require("./nesting"));
|
||||
|
||||
var _pseudo = _interopRequireDefault(require("./pseudo"));
|
||||
|
||||
var _root = _interopRequireDefault(require("./root"));
|
||||
|
||||
var _selector = _interopRequireDefault(require("./selector"));
|
||||
|
||||
var _string = _interopRequireDefault(require("./string"));
|
||||
|
||||
var _tag = _interopRequireDefault(require("./tag"));
|
||||
|
||||
var _universal = _interopRequireDefault(require("./universal"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
||||
|
||||
var attribute = function attribute(opts) {
|
||||
return new _attribute["default"](opts);
|
||||
};
|
||||
|
||||
exports.attribute = attribute;
|
||||
|
||||
var className = function className(opts) {
|
||||
return new _className["default"](opts);
|
||||
};
|
||||
|
||||
exports.className = className;
|
||||
|
||||
var combinator = function combinator(opts) {
|
||||
return new _combinator["default"](opts);
|
||||
};
|
||||
|
||||
exports.combinator = combinator;
|
||||
|
||||
var comment = function comment(opts) {
|
||||
return new _comment["default"](opts);
|
||||
};
|
||||
|
||||
exports.comment = comment;
|
||||
|
||||
var id = function id(opts) {
|
||||
return new _id["default"](opts);
|
||||
};
|
||||
|
||||
exports.id = id;
|
||||
|
||||
var nesting = function nesting(opts) {
|
||||
return new _nesting["default"](opts);
|
||||
};
|
||||
|
||||
exports.nesting = nesting;
|
||||
|
||||
var pseudo = function pseudo(opts) {
|
||||
return new _pseudo["default"](opts);
|
||||
};
|
||||
|
||||
exports.pseudo = pseudo;
|
||||
|
||||
var root = function root(opts) {
|
||||
return new _root["default"](opts);
|
||||
};
|
||||
|
||||
exports.root = root;
|
||||
|
||||
var selector = function selector(opts) {
|
||||
return new _selector["default"](opts);
|
||||
};
|
||||
|
||||
exports.selector = selector;
|
||||
|
||||
var string = function string(opts) {
|
||||
return new _string["default"](opts);
|
||||
};
|
||||
|
||||
exports.string = string;
|
||||
|
||||
var tag = function tag(opts) {
|
||||
return new _tag["default"](opts);
|
||||
};
|
||||
|
||||
exports.tag = tag;
|
||||
|
||||
var universal = function universal(opts) {
|
||||
return new _universal["default"](opts);
|
||||
};
|
||||
|
||||
exports.universal = universal;
|
||||
@@ -0,0 +1,388 @@
|
||||
'use strict';
|
||||
|
||||
const {Script} = require('vm');
|
||||
const {
|
||||
lookupCompiler,
|
||||
removeShebang
|
||||
} = require('./compiler');
|
||||
const {
|
||||
transformer
|
||||
} = require('./transformer');
|
||||
|
||||
const objectDefineProperties = Object.defineProperties;
|
||||
|
||||
const MODULE_PREFIX = '(function (exports, require, module, __filename, __dirname) { ';
|
||||
const STRICT_MODULE_PREFIX = MODULE_PREFIX + '"use strict"; ';
|
||||
const MODULE_SUFFIX = '\n});';
|
||||
|
||||
/**
|
||||
* Class Script
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
class VMScript {
|
||||
|
||||
/**
|
||||
* The script code with wrapping. If set will invalidate the cache.<br>
|
||||
* Writable only for backwards compatibility.
|
||||
*
|
||||
* @public
|
||||
* @readonly
|
||||
* @member {string} code
|
||||
* @memberOf VMScript#
|
||||
*/
|
||||
|
||||
/**
|
||||
* The filename used for this script.
|
||||
*
|
||||
* @public
|
||||
* @readonly
|
||||
* @since v3.9.0
|
||||
* @member {string} filename
|
||||
* @memberOf VMScript#
|
||||
*/
|
||||
|
||||
/**
|
||||
* The line offset use for stack traces.
|
||||
*
|
||||
* @public
|
||||
* @readonly
|
||||
* @since v3.9.0
|
||||
* @member {number} lineOffset
|
||||
* @memberOf VMScript#
|
||||
*/
|
||||
|
||||
/**
|
||||
* The column offset use for stack traces.
|
||||
*
|
||||
* @public
|
||||
* @readonly
|
||||
* @since v3.9.0
|
||||
* @member {number} columnOffset
|
||||
* @memberOf VMScript#
|
||||
*/
|
||||
|
||||
/**
|
||||
* The compiler to use to get the JavaScript code.
|
||||
*
|
||||
* @public
|
||||
* @readonly
|
||||
* @since v3.9.0
|
||||
* @member {(string|compileCallback)} compiler
|
||||
* @memberOf VMScript#
|
||||
*/
|
||||
|
||||
/**
|
||||
* The prefix for the script.
|
||||
*
|
||||
* @private
|
||||
* @member {string} _prefix
|
||||
* @memberOf VMScript#
|
||||
*/
|
||||
|
||||
/**
|
||||
* The suffix for the script.
|
||||
*
|
||||
* @private
|
||||
* @member {string} _suffix
|
||||
* @memberOf VMScript#
|
||||
*/
|
||||
|
||||
/**
|
||||
* The compiled vm.Script for the VM or if not compiled <code>null</code>.
|
||||
*
|
||||
* @private
|
||||
* @member {?vm.Script} _compiledVM
|
||||
* @memberOf VMScript#
|
||||
*/
|
||||
|
||||
/**
|
||||
* The compiled vm.Script for the NodeVM or if not compiled <code>null</code>.
|
||||
*
|
||||
* @private
|
||||
* @member {?vm.Script} _compiledNodeVM
|
||||
* @memberOf VMScript#
|
||||
*/
|
||||
|
||||
/**
|
||||
* The compiled vm.Script for the NodeVM in strict mode or if not compiled <code>null</code>.
|
||||
*
|
||||
* @private
|
||||
* @member {?vm.Script} _compiledNodeVMStrict
|
||||
* @memberOf VMScript#
|
||||
*/
|
||||
|
||||
/**
|
||||
* The resolved compiler to use to get the JavaScript code.
|
||||
*
|
||||
* @private
|
||||
* @readonly
|
||||
* @member {compileCallback} _compiler
|
||||
* @memberOf VMScript#
|
||||
*/
|
||||
|
||||
/**
|
||||
* The script to run without wrapping.
|
||||
*
|
||||
* @private
|
||||
* @member {string} _code
|
||||
* @memberOf VMScript#
|
||||
*/
|
||||
|
||||
/**
|
||||
* Whether or not the script contains async functions.
|
||||
*
|
||||
* @private
|
||||
* @member {boolean} _hasAsync
|
||||
* @memberOf VMScript#
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create VMScript instance.
|
||||
*
|
||||
* @public
|
||||
* @param {string} code - Code to run.
|
||||
* @param {(string|Object)} [options] - Options map or filename.
|
||||
* @param {string} [options.filename="vm.js"] - Filename that shows up in any stack traces produced from this script.
|
||||
* @param {number} [options.lineOffset=0] - Passed to vm.Script options.
|
||||
* @param {number} [options.columnOffset=0] - Passed to vm.Script options.
|
||||
* @param {(string|compileCallback)} [options.compiler="javascript"] - The compiler to use.
|
||||
* @throws {VMError} If the compiler is unknown or if coffee-script was requested but the module not found.
|
||||
*/
|
||||
constructor(code, options) {
|
||||
const sCode = `${code}`;
|
||||
let useFileName;
|
||||
let useOptions;
|
||||
if (arguments.length === 2) {
|
||||
if (typeof options === 'object') {
|
||||
useOptions = options || {__proto__: null};
|
||||
useFileName = useOptions.filename;
|
||||
} else {
|
||||
useOptions = {__proto__: null};
|
||||
useFileName = options;
|
||||
}
|
||||
} else if (arguments.length > 2) {
|
||||
// We do it this way so that there are no more arguments in the function.
|
||||
// eslint-disable-next-line prefer-rest-params
|
||||
useOptions = arguments[2] || {__proto__: null};
|
||||
useFileName = options || useOptions.filename;
|
||||
} else {
|
||||
useOptions = {__proto__: null};
|
||||
}
|
||||
|
||||
const {
|
||||
compiler = 'javascript',
|
||||
lineOffset = 0,
|
||||
columnOffset = 0
|
||||
} = useOptions;
|
||||
|
||||
// Throw if the compiler is unknown.
|
||||
const resolvedCompiler = lookupCompiler(compiler);
|
||||
|
||||
objectDefineProperties(this, {
|
||||
__proto__: null,
|
||||
code: {
|
||||
__proto__: null,
|
||||
// Put this here so that it is enumerable, and looks like a property.
|
||||
get() {
|
||||
return this._prefix + this._code + this._suffix;
|
||||
},
|
||||
set(value) {
|
||||
const strNewCode = String(value);
|
||||
if (strNewCode === this._code && this._prefix === '' && this._suffix === '') return;
|
||||
this._code = strNewCode;
|
||||
this._prefix = '';
|
||||
this._suffix = '';
|
||||
this._compiledVM = null;
|
||||
this._compiledNodeVM = null;
|
||||
this._compiledCode = null;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
filename: {
|
||||
__proto__: null,
|
||||
value: useFileName || 'vm.js',
|
||||
enumerable: true
|
||||
},
|
||||
lineOffset: {
|
||||
__proto__: null,
|
||||
value: lineOffset,
|
||||
enumerable: true
|
||||
},
|
||||
columnOffset: {
|
||||
__proto__: null,
|
||||
value: columnOffset,
|
||||
enumerable: true
|
||||
},
|
||||
compiler: {
|
||||
__proto__: null,
|
||||
value: compiler,
|
||||
enumerable: true
|
||||
},
|
||||
_code: {
|
||||
__proto__: null,
|
||||
value: sCode,
|
||||
writable: true
|
||||
},
|
||||
_prefix: {
|
||||
__proto__: null,
|
||||
value: '',
|
||||
writable: true
|
||||
},
|
||||
_suffix: {
|
||||
__proto__: null,
|
||||
value: '',
|
||||
writable: true
|
||||
},
|
||||
_compiledVM: {
|
||||
__proto__: null,
|
||||
value: null,
|
||||
writable: true
|
||||
},
|
||||
_compiledNodeVM: {
|
||||
__proto__: null,
|
||||
value: null,
|
||||
writable: true
|
||||
},
|
||||
_compiledNodeVMStrict: {
|
||||
__proto__: null,
|
||||
value: null,
|
||||
writable: true
|
||||
},
|
||||
_compiledCode: {
|
||||
__proto__: null,
|
||||
value: null,
|
||||
writable: true
|
||||
},
|
||||
_hasAsync: {
|
||||
__proto__: null,
|
||||
value: false,
|
||||
writable: true
|
||||
},
|
||||
_compiler: {__proto__: null, value: resolvedCompiler}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Wraps the code.<br>
|
||||
* This will replace the old wrapping.<br>
|
||||
* Will invalidate the code cache.
|
||||
*
|
||||
* @public
|
||||
* @deprecated Since v3.9.0. Wrap your code before passing it into the VMScript object.
|
||||
* @param {string} prefix - String that will be appended before the script code.
|
||||
* @param {script} suffix - String that will be appended behind the script code.
|
||||
* @return {this} This for chaining.
|
||||
* @throws {TypeError} If prefix or suffix is a Symbol.
|
||||
*/
|
||||
wrap(prefix, suffix) {
|
||||
const strPrefix = `${prefix}`;
|
||||
const strSuffix = `${suffix}`;
|
||||
if (this._prefix === strPrefix && this._suffix === strSuffix) return this;
|
||||
this._prefix = strPrefix;
|
||||
this._suffix = strSuffix;
|
||||
this._compiledVM = null;
|
||||
this._compiledNodeVM = null;
|
||||
this._compiledNodeVMStrict = null;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile this script. <br>
|
||||
* This is useful to detect syntax errors in the script.
|
||||
*
|
||||
* @public
|
||||
* @return {this} This for chaining.
|
||||
* @throws {SyntaxError} If there is a syntax error in the script.
|
||||
*/
|
||||
compile() {
|
||||
this._compileVM();
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the compiled code.
|
||||
*
|
||||
* @private
|
||||
* @return {string} The code.
|
||||
*/
|
||||
getCompiledCode() {
|
||||
if (!this._compiledCode) {
|
||||
const comp = this._compiler(this._prefix + removeShebang(this._code) + this._suffix, this.filename);
|
||||
const res = transformer(null, comp, false, false, this.filename);
|
||||
this._compiledCode = res.code;
|
||||
this._hasAsync = res.hasAsync;
|
||||
}
|
||||
return this._compiledCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiles this script to a vm.Script.
|
||||
*
|
||||
* @private
|
||||
* @param {string} prefix - JavaScript code that will be used as prefix.
|
||||
* @param {string} suffix - JavaScript code that will be used as suffix.
|
||||
* @return {vm.Script} The compiled vm.Script.
|
||||
* @throws {SyntaxError} If there is a syntax error in the script.
|
||||
*/
|
||||
_compile(prefix, suffix) {
|
||||
return new Script(prefix + this.getCompiledCode() + suffix, {
|
||||
__proto__: null,
|
||||
filename: this.filename,
|
||||
displayErrors: false,
|
||||
lineOffset: this.lineOffset,
|
||||
columnOffset: this.columnOffset
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Will return the cached version of the script intended for VM or compile it.
|
||||
*
|
||||
* @private
|
||||
* @return {vm.Script} The compiled script
|
||||
* @throws {SyntaxError} If there is a syntax error in the script.
|
||||
*/
|
||||
_compileVM() {
|
||||
let script = this._compiledVM;
|
||||
if (!script) {
|
||||
this._compiledVM = script = this._compile('', '');
|
||||
}
|
||||
return script;
|
||||
}
|
||||
|
||||
/**
|
||||
* Will return the cached version of the script intended for NodeVM or compile it.
|
||||
*
|
||||
* @private
|
||||
* @return {vm.Script} The compiled script
|
||||
* @throws {SyntaxError} If there is a syntax error in the script.
|
||||
*/
|
||||
_compileNodeVM() {
|
||||
let script = this._compiledNodeVM;
|
||||
if (!script) {
|
||||
this._compiledNodeVM = script = this._compile(MODULE_PREFIX, MODULE_SUFFIX);
|
||||
}
|
||||
return script;
|
||||
}
|
||||
|
||||
/**
|
||||
* Will return the cached version of the script intended for NodeVM in strict mode or compile it.
|
||||
*
|
||||
* @private
|
||||
* @return {vm.Script} The compiled script
|
||||
* @throws {SyntaxError} If there is a syntax error in the script.
|
||||
*/
|
||||
_compileNodeVMStrict() {
|
||||
let script = this._compiledNodeVMStrict;
|
||||
if (!script) {
|
||||
this._compiledNodeVMStrict = script = this._compile(STRICT_MODULE_PREFIX, MODULE_SUFFIX);
|
||||
}
|
||||
return script;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.MODULE_PREFIX = MODULE_PREFIX;
|
||||
exports.STRICT_MODULE_PREFIX = STRICT_MODULE_PREFIX;
|
||||
exports.MODULE_SUFFIX = MODULE_SUFFIX;
|
||||
exports.VMScript = VMScript;
|
||||
@@ -0,0 +1,24 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const Range = require('../classes/range')
|
||||
const minSatisfying = (versions, range, options) => {
|
||||
let min = null
|
||||
let minSV = null
|
||||
let rangeObj = null
|
||||
try {
|
||||
rangeObj = new Range(range, options)
|
||||
} catch (er) {
|
||||
return null
|
||||
}
|
||||
versions.forEach((v) => {
|
||||
if (rangeObj.test(v)) {
|
||||
// satisfies(v, range, options)
|
||||
if (!min || minSV.compare(v) === 1) {
|
||||
// compare(min, v, true)
|
||||
min = v
|
||||
minSV = new SemVer(min, options)
|
||||
}
|
||||
}
|
||||
})
|
||||
return min
|
||||
}
|
||||
module.exports = minSatisfying
|
||||
@@ -0,0 +1,80 @@
|
||||
var isMergeable = require('./is-mergeable');
|
||||
|
||||
var sortSelectors = require('../level-1/sort-selectors');
|
||||
var tidyRules = require('../level-1/tidy-rules');
|
||||
|
||||
var OptimizationLevel = require('../../options/optimization-level').OptimizationLevel;
|
||||
|
||||
var serializeBody = require('../../writer/one-time').body;
|
||||
var serializeRules = require('../../writer/one-time').rules;
|
||||
|
||||
var Token = require('../../tokenizer/token');
|
||||
|
||||
function unsafeSelector(value) {
|
||||
return /\.|\*| :/.test(value);
|
||||
}
|
||||
|
||||
function isBemElement(token) {
|
||||
var asString = serializeRules(token[1]);
|
||||
return asString.indexOf('__') > -1 || asString.indexOf('--') > -1;
|
||||
}
|
||||
|
||||
function withoutModifier(selector) {
|
||||
return selector.replace(/--[^ ,>\+~:]+/g, '');
|
||||
}
|
||||
|
||||
function removeAnyUnsafeElements(left, candidates) {
|
||||
var leftSelector = withoutModifier(serializeRules(left[1]));
|
||||
|
||||
for (var body in candidates) {
|
||||
var right = candidates[body];
|
||||
var rightSelector = withoutModifier(serializeRules(right[1]));
|
||||
|
||||
if (rightSelector.indexOf(leftSelector) > -1 || leftSelector.indexOf(rightSelector) > -1)
|
||||
delete candidates[body];
|
||||
}
|
||||
}
|
||||
|
||||
function mergeNonAdjacentByBody(tokens, context) {
|
||||
var options = context.options;
|
||||
var mergeSemantically = options.level[OptimizationLevel.Two].mergeSemantically;
|
||||
var adjacentSpace = options.compatibility.selectors.adjacentSpace;
|
||||
var selectorsSortingMethod = options.level[OptimizationLevel.One].selectorsSortingMethod;
|
||||
var mergeablePseudoClasses = options.compatibility.selectors.mergeablePseudoClasses;
|
||||
var mergeablePseudoElements = options.compatibility.selectors.mergeablePseudoElements;
|
||||
var multiplePseudoMerging = options.compatibility.selectors.multiplePseudoMerging;
|
||||
var candidates = {};
|
||||
|
||||
for (var i = tokens.length - 1; i >= 0; i--) {
|
||||
var token = tokens[i];
|
||||
if (token[0] != Token.RULE)
|
||||
continue;
|
||||
|
||||
if (token[2].length > 0 && (!mergeSemantically && unsafeSelector(serializeRules(token[1]))))
|
||||
candidates = {};
|
||||
|
||||
if (token[2].length > 0 && mergeSemantically && isBemElement(token))
|
||||
removeAnyUnsafeElements(token, candidates);
|
||||
|
||||
var candidateBody = serializeBody(token[2]);
|
||||
var oldToken = candidates[candidateBody];
|
||||
if (oldToken &&
|
||||
isMergeable(serializeRules(token[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) &&
|
||||
isMergeable(serializeRules(oldToken[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging)) {
|
||||
|
||||
if (token[2].length > 0) {
|
||||
token[1] = tidyRules(oldToken[1].concat(token[1]), false, adjacentSpace, false, context.warnings);
|
||||
token[1] = token[1].length > 1 ? sortSelectors(token[1], selectorsSortingMethod) : token[1];
|
||||
} else {
|
||||
token[1] = oldToken[1].concat(token[1]);
|
||||
}
|
||||
|
||||
oldToken[2] = [];
|
||||
candidates[candidateBody] = null;
|
||||
}
|
||||
|
||||
candidates[serializeBody(token[2])] = token;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = mergeNonAdjacentByBody;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"skipLast.js","sourceRoot":"","sources":["../../../../src/internal/operators/skipLast.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAC5C,qCAAuC;AACvC,2DAAgE;AA4ChE,SAAgB,QAAQ,CAAI,SAAiB;IAC3C,OAAO,SAAS,IAAI,CAAC;QACnB,CAAC;YACC,mBAAQ;QACV,CAAC,CAAC,cAAO,CAAC,UAAC,MAAM,EAAE,UAAU;YAIzB,IAAI,IAAI,GAAQ,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;YAGrC,IAAI,IAAI,GAAG,CAAC,CAAC;YACb,MAAM,CAAC,SAAS,CACd,6CAAwB,CAAC,UAAU,EAAE,UAAC,KAAK;gBAKzC,IAAM,UAAU,GAAG,IAAI,EAAE,CAAC;gBAC1B,IAAI,UAAU,GAAG,SAAS,EAAE;oBAI1B,IAAI,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC;iBAC1B;qBAAM;oBAIL,IAAM,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;oBAGrC,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;oBAC7B,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;oBAKpB,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBAC3B;YACH,CAAC,CAAC,CACH,CAAC;YAEF,OAAO;gBAEL,IAAI,GAAG,IAAK,CAAC;YACf,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;AACT,CAAC;AA/CD,4BA+CC"}
|
||||
@@ -0,0 +1,9 @@
|
||||
export type ResponseParticipant = {
|
||||
id: number;
|
||||
firstname: string;
|
||||
middlename: string;
|
||||
lastname: string;
|
||||
phone: string;
|
||||
email: string;
|
||||
address?: any;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.crypto = void 0;
|
||||
exports.crypto = {
|
||||
node: undefined,
|
||||
web: typeof self === 'object' && 'crypto' in self ? self.crypto : undefined,
|
||||
};
|
||||
//# sourceMappingURL=cryptoBrowser.js.map
|
||||
@@ -0,0 +1,86 @@
|
||||
import { Document } from './index'
|
||||
import { CST } from './parse-cst'
|
||||
import { AST, Pair, Scalar, Schema } from './types'
|
||||
|
||||
export function findPair(items: any[], key: Scalar | any): Pair | undefined
|
||||
|
||||
export function parseMap(doc: Document, cst: CST.Map): AST.BlockMap
|
||||
export function parseMap(doc: Document, cst: CST.FlowMap): AST.FlowMap
|
||||
export function parseSeq(doc: Document, cst: CST.Seq): AST.BlockSeq
|
||||
export function parseSeq(doc: Document, cst: CST.FlowSeq): AST.FlowSeq
|
||||
|
||||
export function stringifyNumber(item: Scalar): string
|
||||
export function stringifyString(
|
||||
item: Scalar,
|
||||
ctx: Schema.StringifyContext,
|
||||
onComment?: () => void,
|
||||
onChompKeep?: () => void
|
||||
): string
|
||||
|
||||
export function toJSON(
|
||||
value: any,
|
||||
arg?: any,
|
||||
ctx?: Schema.CreateNodeContext
|
||||
): any
|
||||
|
||||
export enum Type {
|
||||
ALIAS = 'ALIAS',
|
||||
BLANK_LINE = 'BLANK_LINE',
|
||||
BLOCK_FOLDED = 'BLOCK_FOLDED',
|
||||
BLOCK_LITERAL = 'BLOCK_LITERAL',
|
||||
COMMENT = 'COMMENT',
|
||||
DIRECTIVE = 'DIRECTIVE',
|
||||
DOCUMENT = 'DOCUMENT',
|
||||
FLOW_MAP = 'FLOW_MAP',
|
||||
FLOW_SEQ = 'FLOW_SEQ',
|
||||
MAP = 'MAP',
|
||||
MAP_KEY = 'MAP_KEY',
|
||||
MAP_VALUE = 'MAP_VALUE',
|
||||
PLAIN = 'PLAIN',
|
||||
QUOTE_DOUBLE = 'QUOTE_DOUBLE',
|
||||
QUOTE_SINGLE = 'QUOTE_SINGLE',
|
||||
SEQ = 'SEQ',
|
||||
SEQ_ITEM = 'SEQ_ITEM'
|
||||
}
|
||||
|
||||
interface LinePos {
|
||||
line: number
|
||||
col: number
|
||||
}
|
||||
|
||||
export class YAMLError extends Error {
|
||||
name:
|
||||
| 'YAMLReferenceError'
|
||||
| 'YAMLSemanticError'
|
||||
| 'YAMLSyntaxError'
|
||||
| 'YAMLWarning'
|
||||
message: string
|
||||
source?: CST.Node
|
||||
|
||||
nodeType?: Type
|
||||
range?: CST.Range
|
||||
linePos?: { start: LinePos; end: LinePos }
|
||||
|
||||
/**
|
||||
* Drops `source` and adds `nodeType`, `range` and `linePos`, as well as
|
||||
* adding details to `message`. Run automatically for document errors if
|
||||
* the `prettyErrors` option is set.
|
||||
*/
|
||||
makePretty(): void
|
||||
}
|
||||
|
||||
export class YAMLReferenceError extends YAMLError {
|
||||
name: 'YAMLReferenceError'
|
||||
}
|
||||
|
||||
export class YAMLSemanticError extends YAMLError {
|
||||
name: 'YAMLSemanticError'
|
||||
}
|
||||
|
||||
export class YAMLSyntaxError extends YAMLError {
|
||||
name: 'YAMLSyntaxError'
|
||||
}
|
||||
|
||||
export class YAMLWarning extends YAMLError {
|
||||
name: 'YAMLWarning'
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').doUntil;
|
||||
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"name": "has-proto",
|
||||
"version": "1.0.1",
|
||||
"description": "Does this environment have the ability to get the [[Prototype]] of an object on creation with `__proto__`?",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": "./index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"scripts": {
|
||||
"prepack": "npmignore --auto --commentLines=autogenerated",
|
||||
"prepublishOnly": "safe-publish-latest",
|
||||
"prepublish": "not-in-publish || npm run prepublishOnly",
|
||||
"lint": "eslint --ext=js,mjs .",
|
||||
"pretest": "npm run lint",
|
||||
"tests-only": "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/inspect-js/has-proto.git"
|
||||
},
|
||||
"keywords": [
|
||||
"prototype",
|
||||
"proto",
|
||||
"set",
|
||||
"get",
|
||||
"__proto__",
|
||||
"getPrototypeOf",
|
||||
"setPrototypeOf",
|
||||
"has"
|
||||
],
|
||||
"author": "Jordan Harband <ljharb@gmail.com>",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/inspect-js/has-proto/issues"
|
||||
},
|
||||
"homepage": "https://github.com/inspect-js/has-proto#readme",
|
||||
"testling": {
|
||||
"files": "test/index.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^21.0.0",
|
||||
"aud": "^2.0.2",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"eslint": "=8.8.0",
|
||||
"in-publish": "^2.0.1",
|
||||
"npmignore": "^0.3.0",
|
||||
"safe-publish-latest": "^2.0.0",
|
||||
"tape": "^5.6.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "CHANGELOG.md",
|
||||
"template": "keepachangelog",
|
||||
"unreleased": false,
|
||||
"commitLimit": false,
|
||||
"backfillLimit": false,
|
||||
"hideCredit": true
|
||||
},
|
||||
"publishConfig": {
|
||||
"ignore": [
|
||||
".github/workflows"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,322 @@
|
||||
import process from 'node:process';
|
||||
import escapeStringRegexp from 'escape-string-regexp';
|
||||
import isUnicodeSupported from 'is-unicode-supported';
|
||||
|
||||
const {platform} = process;
|
||||
|
||||
const common = {
|
||||
square: '█',
|
||||
squareDarkShade: '▓',
|
||||
squareMediumShade: '▒',
|
||||
squareLightShade: '░',
|
||||
squareTop: '▀',
|
||||
squareBottom: '▄',
|
||||
squareLeft: '▌',
|
||||
squareRight: '▐',
|
||||
squareCenter: '■',
|
||||
bullet: '●',
|
||||
dot: '․',
|
||||
ellipsis: '…',
|
||||
pointerSmall: '›',
|
||||
triangleUp: '▲',
|
||||
triangleUpSmall: '▴',
|
||||
triangleDown: '▼',
|
||||
triangleDownSmall: '▾',
|
||||
triangleLeftSmall: '◂',
|
||||
triangleRightSmall: '▸',
|
||||
home: '⌂',
|
||||
heart: '♥',
|
||||
musicNote: '♪',
|
||||
musicNoteBeamed: '♫',
|
||||
arrowUp: '↑',
|
||||
arrowDown: '↓',
|
||||
arrowLeft: '←',
|
||||
arrowRight: '→',
|
||||
arrowLeftRight: '↔',
|
||||
arrowUpDown: '↕',
|
||||
almostEqual: '≈',
|
||||
notEqual: '≠',
|
||||
lessOrEqual: '≤',
|
||||
greaterOrEqual: '≥',
|
||||
identical: '≡',
|
||||
infinity: '∞',
|
||||
subscriptZero: '₀',
|
||||
subscriptOne: '₁',
|
||||
subscriptTwo: '₂',
|
||||
subscriptThree: '₃',
|
||||
subscriptFour: '₄',
|
||||
subscriptFive: '₅',
|
||||
subscriptSix: '₆',
|
||||
subscriptSeven: '₇',
|
||||
subscriptEight: '₈',
|
||||
subscriptNine: '₉',
|
||||
oneHalf: '½',
|
||||
oneThird: '⅓',
|
||||
oneQuarter: '¼',
|
||||
oneFifth: '⅕',
|
||||
oneSixth: '⅙',
|
||||
oneEighth: '⅛',
|
||||
twoThirds: '⅔',
|
||||
twoFifths: '⅖',
|
||||
threeQuarters: '¾',
|
||||
threeFifths: '⅗',
|
||||
threeEighths: '⅜',
|
||||
fourFifths: '⅘',
|
||||
fiveSixths: '⅚',
|
||||
fiveEighths: '⅝',
|
||||
sevenEighths: '⅞',
|
||||
line: '─',
|
||||
lineBold: '━',
|
||||
lineDouble: '═',
|
||||
lineDashed0: '┄',
|
||||
lineDashed1: '┅',
|
||||
lineDashed2: '┈',
|
||||
lineDashed3: '┉',
|
||||
lineDashed4: '╌',
|
||||
lineDashed5: '╍',
|
||||
lineDashed6: '╴',
|
||||
lineDashed7: '╶',
|
||||
lineDashed8: '╸',
|
||||
lineDashed9: '╺',
|
||||
lineDashed10: '╼',
|
||||
lineDashed11: '╾',
|
||||
lineDashed12: '−',
|
||||
lineDashed13: '–',
|
||||
lineDashed14: '‐',
|
||||
lineDashed15: '⁃',
|
||||
lineVertical: '│',
|
||||
lineVerticalBold: '┃',
|
||||
lineVerticalDouble: '║',
|
||||
lineVerticalDashed0: '┆',
|
||||
lineVerticalDashed1: '┇',
|
||||
lineVerticalDashed2: '┊',
|
||||
lineVerticalDashed3: '┋',
|
||||
lineVerticalDashed4: '╎',
|
||||
lineVerticalDashed5: '╏',
|
||||
lineVerticalDashed6: '╵',
|
||||
lineVerticalDashed7: '╷',
|
||||
lineVerticalDashed8: '╹',
|
||||
lineVerticalDashed9: '╻',
|
||||
lineVerticalDashed10: '╽',
|
||||
lineVerticalDashed11: '╿',
|
||||
lineDownLeft: '┐',
|
||||
lineDownLeftArc: '╮',
|
||||
lineDownBoldLeftBold: '┓',
|
||||
lineDownBoldLeft: '┒',
|
||||
lineDownLeftBold: '┑',
|
||||
lineDownDoubleLeftDouble: '╗',
|
||||
lineDownDoubleLeft: '╖',
|
||||
lineDownLeftDouble: '╕',
|
||||
lineDownRight: '┌',
|
||||
lineDownRightArc: '╭',
|
||||
lineDownBoldRightBold: '┏',
|
||||
lineDownBoldRight: '┎',
|
||||
lineDownRightBold: '┍',
|
||||
lineDownDoubleRightDouble: '╔',
|
||||
lineDownDoubleRight: '╓',
|
||||
lineDownRightDouble: '╒',
|
||||
lineUpLeft: '┘',
|
||||
lineUpLeftArc: '╯',
|
||||
lineUpBoldLeftBold: '┛',
|
||||
lineUpBoldLeft: '┚',
|
||||
lineUpLeftBold: '┙',
|
||||
lineUpDoubleLeftDouble: '╝',
|
||||
lineUpDoubleLeft: '╜',
|
||||
lineUpLeftDouble: '╛',
|
||||
lineUpRight: '└',
|
||||
lineUpRightArc: '╰',
|
||||
lineUpBoldRightBold: '┗',
|
||||
lineUpBoldRight: '┖',
|
||||
lineUpRightBold: '┕',
|
||||
lineUpDoubleRightDouble: '╚',
|
||||
lineUpDoubleRight: '╙',
|
||||
lineUpRightDouble: '╘',
|
||||
lineUpDownLeft: '┤',
|
||||
lineUpBoldDownBoldLeftBold: '┫',
|
||||
lineUpBoldDownBoldLeft: '┨',
|
||||
lineUpDownLeftBold: '┥',
|
||||
lineUpBoldDownLeftBold: '┩',
|
||||
lineUpDownBoldLeftBold: '┪',
|
||||
lineUpDownBoldLeft: '┧',
|
||||
lineUpBoldDownLeft: '┦',
|
||||
lineUpDoubleDownDoubleLeftDouble: '╣',
|
||||
lineUpDoubleDownDoubleLeft: '╢',
|
||||
lineUpDownLeftDouble: '╡',
|
||||
lineUpDownRight: '├',
|
||||
lineUpBoldDownBoldRightBold: '┣',
|
||||
lineUpBoldDownBoldRight: '┠',
|
||||
lineUpDownRightBold: '┝',
|
||||
lineUpBoldDownRightBold: '┡',
|
||||
lineUpDownBoldRightBold: '┢',
|
||||
lineUpDownBoldRight: '┟',
|
||||
lineUpBoldDownRight: '┞',
|
||||
lineUpDoubleDownDoubleRightDouble: '╠',
|
||||
lineUpDoubleDownDoubleRight: '╟',
|
||||
lineUpDownRightDouble: '╞',
|
||||
lineDownLeftRight: '┬',
|
||||
lineDownBoldLeftBoldRightBold: '┳',
|
||||
lineDownLeftBoldRightBold: '┯',
|
||||
lineDownBoldLeftRight: '┰',
|
||||
lineDownBoldLeftBoldRight: '┱',
|
||||
lineDownBoldLeftRightBold: '┲',
|
||||
lineDownLeftRightBold: '┮',
|
||||
lineDownLeftBoldRight: '┭',
|
||||
lineDownDoubleLeftDoubleRightDouble: '╦',
|
||||
lineDownDoubleLeftRight: '╥',
|
||||
lineDownLeftDoubleRightDouble: '╤',
|
||||
lineUpLeftRight: '┴',
|
||||
lineUpBoldLeftBoldRightBold: '┻',
|
||||
lineUpLeftBoldRightBold: '┷',
|
||||
lineUpBoldLeftRight: '┸',
|
||||
lineUpBoldLeftBoldRight: '┹',
|
||||
lineUpBoldLeftRightBold: '┺',
|
||||
lineUpLeftRightBold: '┶',
|
||||
lineUpLeftBoldRight: '┵',
|
||||
lineUpDoubleLeftDoubleRightDouble: '╩',
|
||||
lineUpDoubleLeftRight: '╨',
|
||||
lineUpLeftDoubleRightDouble: '╧',
|
||||
lineUpDownLeftRight: '┼',
|
||||
lineUpBoldDownBoldLeftBoldRightBold: '╋',
|
||||
lineUpDownBoldLeftBoldRightBold: '╈',
|
||||
lineUpBoldDownLeftBoldRightBold: '╇',
|
||||
lineUpBoldDownBoldLeftRightBold: '╊',
|
||||
lineUpBoldDownBoldLeftBoldRight: '╉',
|
||||
lineUpBoldDownLeftRight: '╀',
|
||||
lineUpDownBoldLeftRight: '╁',
|
||||
lineUpDownLeftBoldRight: '┽',
|
||||
lineUpDownLeftRightBold: '┾',
|
||||
lineUpBoldDownBoldLeftRight: '╂',
|
||||
lineUpDownLeftBoldRightBold: '┿',
|
||||
lineUpBoldDownLeftBoldRight: '╃',
|
||||
lineUpBoldDownLeftRightBold: '╄',
|
||||
lineUpDownBoldLeftBoldRight: '╅',
|
||||
lineUpDownBoldLeftRightBold: '╆',
|
||||
lineUpDoubleDownDoubleLeftDoubleRightDouble: '╬',
|
||||
lineUpDoubleDownDoubleLeftRight: '╫',
|
||||
lineUpDownLeftDoubleRightDouble: '╪',
|
||||
lineCross: '╳',
|
||||
lineBackslash: '╲',
|
||||
lineSlash: '╱',
|
||||
};
|
||||
|
||||
export const mainSymbols = {
|
||||
...common,
|
||||
// The main symbols for those do not look that good on Ubuntu.
|
||||
...(
|
||||
platform === 'linux'
|
||||
? {
|
||||
circleQuestionMark: '?⃝',
|
||||
questionMarkPrefix: '?⃝',
|
||||
}
|
||||
: {
|
||||
circleQuestionMark: '?',
|
||||
questionMarkPrefix: '?',
|
||||
}
|
||||
),
|
||||
tick: '✔',
|
||||
info: 'ℹ',
|
||||
warning: '⚠',
|
||||
cross: '✘',
|
||||
squareSmall: '◻',
|
||||
squareSmallFilled: '◼',
|
||||
circle: '◯',
|
||||
circleFilled: '◉',
|
||||
circleDotted: '◌',
|
||||
circleDouble: '◎',
|
||||
circleCircle: 'ⓞ',
|
||||
circleCross: 'ⓧ',
|
||||
circlePipe: 'Ⓘ',
|
||||
radioOn: '◉',
|
||||
radioOff: '◯',
|
||||
checkboxOn: '☒',
|
||||
checkboxOff: '☐',
|
||||
checkboxCircleOn: 'ⓧ',
|
||||
checkboxCircleOff: 'Ⓘ',
|
||||
pointer: '❯',
|
||||
triangleUpOutline: '△',
|
||||
triangleLeft: '◀',
|
||||
triangleRight: '▶',
|
||||
lozenge: '◆',
|
||||
lozengeOutline: '◇',
|
||||
hamburger: '☰',
|
||||
smiley: '㋡',
|
||||
mustache: '෴',
|
||||
star: '★',
|
||||
play: '▶',
|
||||
nodejs: '⬢',
|
||||
oneSeventh: '⅐',
|
||||
oneNinth: '⅑',
|
||||
oneTenth: '⅒',
|
||||
};
|
||||
|
||||
export const fallbackSymbols = {
|
||||
...common,
|
||||
tick: '√',
|
||||
info: 'i',
|
||||
warning: '‼',
|
||||
cross: '×',
|
||||
squareSmall: '□',
|
||||
squareSmallFilled: '■',
|
||||
circle: '( )',
|
||||
circleFilled: '(*)',
|
||||
circleDotted: '( )',
|
||||
circleDouble: '( )',
|
||||
circleCircle: '(○)',
|
||||
circleCross: '(×)',
|
||||
circlePipe: '(│)',
|
||||
circleQuestionMark: '(?)',
|
||||
radioOn: '(*)',
|
||||
radioOff: '( )',
|
||||
checkboxOn: '[×]',
|
||||
checkboxOff: '[ ]',
|
||||
checkboxCircleOn: '(×)',
|
||||
checkboxCircleOff: '( )',
|
||||
questionMarkPrefix: '?',
|
||||
pointer: '>',
|
||||
triangleUpOutline: '∆',
|
||||
triangleLeft: '◄',
|
||||
triangleRight: '►',
|
||||
lozenge: '♦',
|
||||
lozengeOutline: '◊',
|
||||
hamburger: '≡',
|
||||
smiley: '☺',
|
||||
mustache: '┌─┐',
|
||||
star: '✶',
|
||||
play: '►',
|
||||
nodejs: '♦',
|
||||
oneSeventh: '1/7',
|
||||
oneNinth: '1/9',
|
||||
oneTenth: '1/10',
|
||||
};
|
||||
|
||||
const shouldUseMain = isUnicodeSupported();
|
||||
const figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
||||
export default figures;
|
||||
|
||||
const isFallbackSymbol = (key, mainSymbol) => fallbackSymbols[key] !== mainSymbol;
|
||||
const getFigureRegExp = (key, mainSymbol) => [new RegExp(escapeStringRegexp(mainSymbol), 'g'), fallbackSymbols[key]];
|
||||
|
||||
let replacements = [];
|
||||
const getReplacements = () => {
|
||||
if (replacements.length > 0) {
|
||||
return replacements;
|
||||
}
|
||||
|
||||
replacements = Object.entries(mainSymbols)
|
||||
.filter(([key, mainSymbol]) => isFallbackSymbol(key, mainSymbol))
|
||||
.map(([key, mainSymbol]) => getFigureRegExp(key, mainSymbol));
|
||||
return replacements;
|
||||
};
|
||||
|
||||
// On terminals which do not support Unicode symbols, substitute them to other symbols
|
||||
export const replaceSymbols = string => {
|
||||
if (shouldUseMain) {
|
||||
return string;
|
||||
}
|
||||
|
||||
for (const [figureRegExp, fallbackSymbol] of getReplacements()) {
|
||||
string = string.replace(figureRegExp, fallbackSymbol);
|
||||
}
|
||||
|
||||
return string;
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
import { AsyncAction } from './AsyncAction';
|
||||
import { immediateProvider } from './immediateProvider';
|
||||
export class AsapAction extends AsyncAction {
|
||||
constructor(scheduler, work) {
|
||||
super(scheduler, work);
|
||||
this.scheduler = scheduler;
|
||||
this.work = work;
|
||||
}
|
||||
requestAsyncId(scheduler, id, delay = 0) {
|
||||
if (delay !== null && delay > 0) {
|
||||
return super.requestAsyncId(scheduler, id, delay);
|
||||
}
|
||||
scheduler.actions.push(this);
|
||||
return scheduler._scheduled || (scheduler._scheduled = immediateProvider.setImmediate(scheduler.flush.bind(scheduler, undefined)));
|
||||
}
|
||||
recycleAsyncId(scheduler, id, delay = 0) {
|
||||
var _a;
|
||||
if (delay != null ? delay > 0 : this.delay > 0) {
|
||||
return super.recycleAsyncId(scheduler, id, delay);
|
||||
}
|
||||
const { actions } = scheduler;
|
||||
if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
|
||||
immediateProvider.clearImmediate(id);
|
||||
scheduler._scheduled = undefined;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=AsapAction.js.map
|
||||
@@ -0,0 +1,564 @@
|
||||
/// <reference types="node"/>
|
||||
import {ChildProcess} from 'child_process';
|
||||
import {Stream, Readable as ReadableStream} from 'stream';
|
||||
|
||||
declare namespace execa {
|
||||
type StdioOption =
|
||||
| 'pipe'
|
||||
| 'ipc'
|
||||
| 'ignore'
|
||||
| 'inherit'
|
||||
| Stream
|
||||
| number
|
||||
| undefined;
|
||||
|
||||
interface CommonOptions<EncodingType> {
|
||||
/**
|
||||
Kill the spawned process when the parent process exits unless either:
|
||||
- the spawned process is [`detached`](https://nodejs.org/api/child_process.html#child_process_options_detached)
|
||||
- the parent process is terminated abruptly, for example, with `SIGKILL` as opposed to `SIGTERM` or a normal exit
|
||||
|
||||
@default true
|
||||
*/
|
||||
readonly cleanup?: boolean;
|
||||
|
||||
/**
|
||||
Prefer locally installed binaries when looking for a binary to execute.
|
||||
|
||||
If you `$ npm install foo`, you can then `execa('foo')`.
|
||||
|
||||
@default false
|
||||
*/
|
||||
readonly preferLocal?: boolean;
|
||||
|
||||
/**
|
||||
Preferred path to find locally installed binaries in (use with `preferLocal`).
|
||||
|
||||
@default process.cwd()
|
||||
*/
|
||||
readonly localDir?: string;
|
||||
|
||||
/**
|
||||
Path to the Node.js executable to use in child processes.
|
||||
|
||||
This can be either an absolute path or a path relative to the `cwd` option.
|
||||
|
||||
Requires `preferLocal` to be `true`.
|
||||
|
||||
For example, this can be used together with [`get-node`](https://github.com/ehmicky/get-node) to run a specific Node.js version in a child process.
|
||||
|
||||
@default process.execPath
|
||||
*/
|
||||
readonly execPath?: string;
|
||||
|
||||
/**
|
||||
Buffer the output from the spawned process. When set to `false`, you must read the output of `stdout` and `stderr` (or `all` if the `all` option is `true`). Otherwise the returned promise will not be resolved/rejected.
|
||||
|
||||
If the spawned process fails, `error.stdout`, `error.stderr`, and `error.all` will contain the buffered data.
|
||||
|
||||
@default true
|
||||
*/
|
||||
readonly buffer?: boolean;
|
||||
|
||||
/**
|
||||
Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).
|
||||
|
||||
@default 'pipe'
|
||||
*/
|
||||
readonly stdin?: StdioOption;
|
||||
|
||||
/**
|
||||
Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).
|
||||
|
||||
@default 'pipe'
|
||||
*/
|
||||
readonly stdout?: StdioOption;
|
||||
|
||||
/**
|
||||
Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).
|
||||
|
||||
@default 'pipe'
|
||||
*/
|
||||
readonly stderr?: StdioOption;
|
||||
|
||||
/**
|
||||
Setting this to `false` resolves the promise with the error instead of rejecting it.
|
||||
|
||||
@default true
|
||||
*/
|
||||
readonly reject?: boolean;
|
||||
|
||||
/**
|
||||
Add an `.all` property on the promise and the resolved value. The property contains the output of the process with `stdout` and `stderr` interleaved.
|
||||
|
||||
@default false
|
||||
*/
|
||||
readonly all?: boolean;
|
||||
|
||||
/**
|
||||
Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from the output.
|
||||
|
||||
@default true
|
||||
*/
|
||||
readonly stripFinalNewline?: boolean;
|
||||
|
||||
/**
|
||||
Set to `false` if you don't want to extend the environment variables when providing the `env` property.
|
||||
|
||||
@default true
|
||||
*/
|
||||
readonly extendEnv?: boolean;
|
||||
|
||||
/**
|
||||
Current working directory of the child process.
|
||||
|
||||
@default process.cwd()
|
||||
*/
|
||||
readonly cwd?: string;
|
||||
|
||||
/**
|
||||
Environment key-value pairs. Extends automatically from `process.env`. Set `extendEnv` to `false` if you don't want this.
|
||||
|
||||
@default process.env
|
||||
*/
|
||||
readonly env?: NodeJS.ProcessEnv;
|
||||
|
||||
/**
|
||||
Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` or `file` if not specified.
|
||||
*/
|
||||
readonly argv0?: string;
|
||||
|
||||
/**
|
||||
Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration.
|
||||
|
||||
@default 'pipe'
|
||||
*/
|
||||
readonly stdio?: 'pipe' | 'ignore' | 'inherit' | readonly StdioOption[];
|
||||
|
||||
/**
|
||||
Specify the kind of serialization used for sending messages between processes when using the `stdio: 'ipc'` option or `execa.node()`:
|
||||
- `json`: Uses `JSON.stringify()` and `JSON.parse()`.
|
||||
- `advanced`: Uses [`v8.serialize()`](https://nodejs.org/api/v8.html#v8_v8_serialize_value)
|
||||
|
||||
Requires Node.js `13.2.0` or later.
|
||||
|
||||
[More info.](https://nodejs.org/api/child_process.html#child_process_advanced_serialization)
|
||||
|
||||
@default 'json'
|
||||
*/
|
||||
readonly serialization?: 'json' | 'advanced';
|
||||
|
||||
/**
|
||||
Prepare child to run independently of its parent process. Specific behavior [depends on the platform](https://nodejs.org/api/child_process.html#child_process_options_detached).
|
||||
|
||||
@default false
|
||||
*/
|
||||
readonly detached?: boolean;
|
||||
|
||||
/**
|
||||
Sets the user identity of the process.
|
||||
*/
|
||||
readonly uid?: number;
|
||||
|
||||
/**
|
||||
Sets the group identity of the process.
|
||||
*/
|
||||
readonly gid?: number;
|
||||
|
||||
/**
|
||||
If `true`, runs `command` inside of a shell. Uses `/bin/sh` on UNIX and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows.
|
||||
|
||||
We recommend against using this option since it is:
|
||||
- not cross-platform, encouraging shell-specific syntax.
|
||||
- slower, because of the additional shell interpretation.
|
||||
- unsafe, potentially allowing command injection.
|
||||
|
||||
@default false
|
||||
*/
|
||||
readonly shell?: boolean | string;
|
||||
|
||||
/**
|
||||
Specify the character encoding used to decode the `stdout` and `stderr` output. If set to `null`, then `stdout` and `stderr` will be a `Buffer` instead of a string.
|
||||
|
||||
@default 'utf8'
|
||||
*/
|
||||
readonly encoding?: EncodingType;
|
||||
|
||||
/**
|
||||
If `timeout` is greater than `0`, the parent will send the signal identified by the `killSignal` property (the default is `SIGTERM`) if the child runs longer than `timeout` milliseconds.
|
||||
|
||||
@default 0
|
||||
*/
|
||||
readonly timeout?: number;
|
||||
|
||||
/**
|
||||
Largest amount of data in bytes allowed on `stdout` or `stderr`. Default: 100 MB.
|
||||
|
||||
@default 100_000_000
|
||||
*/
|
||||
readonly maxBuffer?: number;
|
||||
|
||||
/**
|
||||
Signal value to be used when the spawned process will be killed.
|
||||
|
||||
@default 'SIGTERM'
|
||||
*/
|
||||
readonly killSignal?: string | number;
|
||||
|
||||
/**
|
||||
If `true`, no quoting or escaping of arguments is done on Windows. Ignored on other platforms. This is set to `true` automatically when the `shell` option is `true`.
|
||||
|
||||
@default false
|
||||
*/
|
||||
readonly windowsVerbatimArguments?: boolean;
|
||||
|
||||
/**
|
||||
On Windows, do not create a new console window. Please note this also prevents `CTRL-C` [from working](https://github.com/nodejs/node/issues/29837) on Windows.
|
||||
|
||||
@default true
|
||||
*/
|
||||
readonly windowsHide?: boolean;
|
||||
}
|
||||
|
||||
interface Options<EncodingType = string> extends CommonOptions<EncodingType> {
|
||||
/**
|
||||
Write some input to the `stdin` of your binary.
|
||||
*/
|
||||
readonly input?: string | Buffer | ReadableStream;
|
||||
}
|
||||
|
||||
interface SyncOptions<EncodingType = string> extends CommonOptions<EncodingType> {
|
||||
/**
|
||||
Write some input to the `stdin` of your binary.
|
||||
*/
|
||||
readonly input?: string | Buffer;
|
||||
}
|
||||
|
||||
interface NodeOptions<EncodingType = string> extends Options<EncodingType> {
|
||||
/**
|
||||
The Node.js executable to use.
|
||||
|
||||
@default process.execPath
|
||||
*/
|
||||
readonly nodePath?: string;
|
||||
|
||||
/**
|
||||
List of [CLI options](https://nodejs.org/api/cli.html#cli_options) passed to the Node.js executable.
|
||||
|
||||
@default process.execArgv
|
||||
*/
|
||||
readonly nodeOptions?: string[];
|
||||
}
|
||||
|
||||
interface ExecaReturnBase<StdoutStderrType> {
|
||||
/**
|
||||
The file and arguments that were run, for logging purposes.
|
||||
|
||||
This is not escaped and should not be executed directly as a process, including using `execa()` or `execa.command()`.
|
||||
*/
|
||||
command: string;
|
||||
|
||||
/**
|
||||
Same as `command` but escaped.
|
||||
|
||||
This is meant to be copy and pasted into a shell, for debugging purposes.
|
||||
Since the escaping is fairly basic, this should not be executed directly as a process, including using `execa()` or `execa.command()`.
|
||||
*/
|
||||
escapedCommand: string;
|
||||
|
||||
/**
|
||||
The numeric exit code of the process that was run.
|
||||
*/
|
||||
exitCode: number;
|
||||
|
||||
/**
|
||||
The output of the process on stdout.
|
||||
*/
|
||||
stdout: StdoutStderrType;
|
||||
|
||||
/**
|
||||
The output of the process on stderr.
|
||||
*/
|
||||
stderr: StdoutStderrType;
|
||||
|
||||
/**
|
||||
Whether the process failed to run.
|
||||
*/
|
||||
failed: boolean;
|
||||
|
||||
/**
|
||||
Whether the process timed out.
|
||||
*/
|
||||
timedOut: boolean;
|
||||
|
||||
/**
|
||||
Whether the process was killed.
|
||||
*/
|
||||
killed: boolean;
|
||||
|
||||
/**
|
||||
The name of the signal that was used to terminate the process. For example, `SIGFPE`.
|
||||
|
||||
If a signal terminated the process, this property is defined and included in the error message. Otherwise it is `undefined`.
|
||||
*/
|
||||
signal?: string;
|
||||
|
||||
/**
|
||||
A human-friendly description of the signal that was used to terminate the process. For example, `Floating point arithmetic error`.
|
||||
|
||||
If a signal terminated the process, this property is defined and included in the error message. Otherwise it is `undefined`. It is also `undefined` when the signal is very uncommon which should seldomly happen.
|
||||
*/
|
||||
signalDescription?: string;
|
||||
}
|
||||
|
||||
interface ExecaSyncReturnValue<StdoutErrorType = string>
|
||||
extends ExecaReturnBase<StdoutErrorType> {
|
||||
}
|
||||
|
||||
/**
|
||||
Result of a child process execution. On success this is a plain object. On failure this is also an `Error` instance.
|
||||
|
||||
The child process fails when:
|
||||
- its exit code is not `0`
|
||||
- it was killed with a signal
|
||||
- timing out
|
||||
- being canceled
|
||||
- there's not enough memory or there are already too many child processes
|
||||
*/
|
||||
interface ExecaReturnValue<StdoutErrorType = string>
|
||||
extends ExecaSyncReturnValue<StdoutErrorType> {
|
||||
/**
|
||||
The output of the process with `stdout` and `stderr` interleaved.
|
||||
|
||||
This is `undefined` if either:
|
||||
- the `all` option is `false` (default value)
|
||||
- `execa.sync()` was used
|
||||
*/
|
||||
all?: StdoutErrorType;
|
||||
|
||||
/**
|
||||
Whether the process was canceled.
|
||||
*/
|
||||
isCanceled: boolean;
|
||||
}
|
||||
|
||||
interface ExecaSyncError<StdoutErrorType = string>
|
||||
extends Error,
|
||||
ExecaReturnBase<StdoutErrorType> {
|
||||
/**
|
||||
Error message when the child process failed to run. In addition to the underlying error message, it also contains some information related to why the child process errored.
|
||||
|
||||
The child process stderr then stdout are appended to the end, separated with newlines and not interleaved.
|
||||
*/
|
||||
message: string;
|
||||
|
||||
/**
|
||||
This is the same as the `message` property except it does not include the child process stdout/stderr.
|
||||
*/
|
||||
shortMessage: string;
|
||||
|
||||
/**
|
||||
Original error message. This is the same as the `message` property except it includes neither the child process stdout/stderr nor some additional information added by Execa.
|
||||
|
||||
This is `undefined` unless the child process exited due to an `error` event or a timeout.
|
||||
*/
|
||||
originalMessage?: string;
|
||||
}
|
||||
|
||||
interface ExecaError<StdoutErrorType = string>
|
||||
extends ExecaSyncError<StdoutErrorType> {
|
||||
/**
|
||||
The output of the process with `stdout` and `stderr` interleaved.
|
||||
|
||||
This is `undefined` if either:
|
||||
- the `all` option is `false` (default value)
|
||||
- `execa.sync()` was used
|
||||
*/
|
||||
all?: StdoutErrorType;
|
||||
|
||||
/**
|
||||
Whether the process was canceled.
|
||||
*/
|
||||
isCanceled: boolean;
|
||||
}
|
||||
|
||||
interface KillOptions {
|
||||
/**
|
||||
Milliseconds to wait for the child process to terminate before sending `SIGKILL`.
|
||||
|
||||
Can be disabled with `false`.
|
||||
|
||||
@default 5000
|
||||
*/
|
||||
forceKillAfterTimeout?: number | false;
|
||||
}
|
||||
|
||||
interface ExecaChildPromise<StdoutErrorType> {
|
||||
/**
|
||||
Stream combining/interleaving [`stdout`](https://nodejs.org/api/child_process.html#child_process_subprocess_stdout) and [`stderr`](https://nodejs.org/api/child_process.html#child_process_subprocess_stderr).
|
||||
|
||||
This is `undefined` if either:
|
||||
- the `all` option is `false` (the default value)
|
||||
- both `stdout` and `stderr` options are set to [`'inherit'`, `'ipc'`, `Stream` or `integer`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio)
|
||||
*/
|
||||
all?: ReadableStream;
|
||||
|
||||
catch<ResultType = never>(
|
||||
onRejected?: (reason: ExecaError<StdoutErrorType>) => ResultType | PromiseLike<ResultType>
|
||||
): Promise<ExecaReturnValue<StdoutErrorType> | ResultType>;
|
||||
|
||||
/**
|
||||
Same as the original [`child_process#kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal), except if `signal` is `SIGTERM` (the default value) and the child process is not terminated after 5 seconds, force it by sending `SIGKILL`.
|
||||
*/
|
||||
kill(signal?: string, options?: KillOptions): void;
|
||||
|
||||
/**
|
||||
Similar to [`childProcess.kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal). This is preferred when cancelling the child process execution as the error is more descriptive and [`childProcessResult.isCanceled`](#iscanceled) is set to `true`.
|
||||
*/
|
||||
cancel(): void;
|
||||
}
|
||||
|
||||
type ExecaChildProcess<StdoutErrorType = string> = ChildProcess &
|
||||
ExecaChildPromise<StdoutErrorType> &
|
||||
Promise<ExecaReturnValue<StdoutErrorType>>;
|
||||
}
|
||||
|
||||
declare const execa: {
|
||||
/**
|
||||
Execute a file.
|
||||
|
||||
Think of this as a mix of `child_process.execFile` and `child_process.spawn`.
|
||||
|
||||
@param file - The program/script to execute.
|
||||
@param arguments - Arguments to pass to `file` on execution.
|
||||
@returns A [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties.
|
||||
|
||||
@example
|
||||
```
|
||||
import execa = require('execa');
|
||||
|
||||
(async () => {
|
||||
const {stdout} = await execa('echo', ['unicorns']);
|
||||
console.log(stdout);
|
||||
//=> 'unicorns'
|
||||
|
||||
// Cancelling a spawned process
|
||||
|
||||
const subprocess = execa('node');
|
||||
|
||||
setTimeout(() => {
|
||||
subprocess.cancel()
|
||||
}, 1000);
|
||||
|
||||
try {
|
||||
await subprocess;
|
||||
} catch (error) {
|
||||
console.log(subprocess.killed); // true
|
||||
console.log(error.isCanceled); // true
|
||||
}
|
||||
})();
|
||||
|
||||
// Pipe the child process stdout to the current stdout
|
||||
execa('echo', ['unicorns']).stdout.pipe(process.stdout);
|
||||
```
|
||||
*/
|
||||
(
|
||||
file: string,
|
||||
arguments?: readonly string[],
|
||||
options?: execa.Options
|
||||
): execa.ExecaChildProcess;
|
||||
(
|
||||
file: string,
|
||||
arguments?: readonly string[],
|
||||
options?: execa.Options<null>
|
||||
): execa.ExecaChildProcess<Buffer>;
|
||||
(file: string, options?: execa.Options): execa.ExecaChildProcess;
|
||||
(file: string, options?: execa.Options<null>): execa.ExecaChildProcess<
|
||||
Buffer
|
||||
>;
|
||||
|
||||
/**
|
||||
Execute a file synchronously.
|
||||
|
||||
This method throws an `Error` if the command fails.
|
||||
|
||||
@param file - The program/script to execute.
|
||||
@param arguments - Arguments to pass to `file` on execution.
|
||||
@returns A result `Object` with `stdout` and `stderr` properties.
|
||||
*/
|
||||
sync(
|
||||
file: string,
|
||||
arguments?: readonly string[],
|
||||
options?: execa.SyncOptions
|
||||
): execa.ExecaSyncReturnValue;
|
||||
sync(
|
||||
file: string,
|
||||
arguments?: readonly string[],
|
||||
options?: execa.SyncOptions<null>
|
||||
): execa.ExecaSyncReturnValue<Buffer>;
|
||||
sync(file: string, options?: execa.SyncOptions): execa.ExecaSyncReturnValue;
|
||||
sync(
|
||||
file: string,
|
||||
options?: execa.SyncOptions<null>
|
||||
): execa.ExecaSyncReturnValue<Buffer>;
|
||||
|
||||
/**
|
||||
Same as `execa()` except both file and arguments are specified in a single `command` string. For example, `execa('echo', ['unicorns'])` is the same as `execa.command('echo unicorns')`.
|
||||
|
||||
If the file or an argument contains spaces, they must be escaped with backslashes. This matters especially if `command` is not a constant but a variable, for example with `__dirname` or `process.cwd()`. Except for spaces, no escaping/quoting is needed.
|
||||
|
||||
The `shell` option must be used if the `command` uses shell-specific features (for example, `&&` or `||`), as opposed to being a simple `file` followed by its `arguments`.
|
||||
|
||||
@param command - The program/script to execute and its arguments.
|
||||
@returns A [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties.
|
||||
|
||||
@example
|
||||
```
|
||||
import execa = require('execa');
|
||||
|
||||
(async () => {
|
||||
const {stdout} = await execa.command('echo unicorns');
|
||||
console.log(stdout);
|
||||
//=> 'unicorns'
|
||||
})();
|
||||
```
|
||||
*/
|
||||
command(command: string, options?: execa.Options): execa.ExecaChildProcess;
|
||||
command(command: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;
|
||||
|
||||
/**
|
||||
Same as `execa.command()` but synchronous.
|
||||
|
||||
@param command - The program/script to execute and its arguments.
|
||||
@returns A result `Object` with `stdout` and `stderr` properties.
|
||||
*/
|
||||
commandSync(command: string, options?: execa.SyncOptions): execa.ExecaSyncReturnValue;
|
||||
commandSync(command: string, options?: execa.SyncOptions<null>): execa.ExecaSyncReturnValue<Buffer>;
|
||||
|
||||
/**
|
||||
Execute a Node.js script as a child process.
|
||||
|
||||
Same as `execa('node', [scriptPath, ...arguments], options)` except (like [`child_process#fork()`](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options)):
|
||||
- the current Node version and options are used. This can be overridden using the `nodePath` and `nodeArguments` options.
|
||||
- the `shell` option cannot be used
|
||||
- an extra channel [`ipc`](https://nodejs.org/api/child_process.html#child_process_options_stdio) is passed to [`stdio`](#stdio)
|
||||
|
||||
@param scriptPath - Node.js script to execute.
|
||||
@param arguments - Arguments to pass to `scriptPath` on execution.
|
||||
@returns A [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties.
|
||||
*/
|
||||
node(
|
||||
scriptPath: string,
|
||||
arguments?: readonly string[],
|
||||
options?: execa.NodeOptions
|
||||
): execa.ExecaChildProcess;
|
||||
node(
|
||||
scriptPath: string,
|
||||
arguments?: readonly string[],
|
||||
options?: execa.Options<null>
|
||||
): execa.ExecaChildProcess<Buffer>;
|
||||
node(scriptPath: string, options?: execa.Options): execa.ExecaChildProcess;
|
||||
node(scriptPath: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;
|
||||
};
|
||||
|
||||
export = execa;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"CC","8":"J D E F A","164":"B"},B:{"1":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","513":"C K L G M N O"},C:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","8":"0 1 2 3 4 5 6 7 DC tB I v J D E F A B C K L G M N O w g x y z EC FC","66":"8 9"},D:{"1":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","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"},E:{"1":"B C K L G qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","8":"I v J D HC zB IC JC","289":"E F A KC LC 0B"},F:{"1":"0 1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB 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":"F B C G M N O w g x y z PC QC RC SC qB AC TC rB"},G:{"1":"dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","8":"zB UC BC VC WC XC","289":"E YC ZC aC bC cC"},H:{"2":"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","164":"B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:2,C:"Web Cryptography"};
|
||||
@@ -0,0 +1,34 @@
|
||||
import { EndpointInterface } from "./EndpointInterface";
|
||||
import { OctokitResponse } from "./OctokitResponse";
|
||||
import { RequestParameters } from "./RequestParameters";
|
||||
import { Route } from "./Route";
|
||||
import { Endpoints } from "./generated/Endpoints";
|
||||
export interface RequestInterface<D extends object = object> {
|
||||
/**
|
||||
* Sends a request based on endpoint options
|
||||
*
|
||||
* @param {object} endpoint Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<T = any, O extends RequestParameters = RequestParameters>(options: O & {
|
||||
method?: string;
|
||||
} & ("url" extends keyof D ? {
|
||||
url?: string;
|
||||
} : {
|
||||
url: string;
|
||||
})): Promise<OctokitResponse<T>>;
|
||||
/**
|
||||
* Sends a request based on endpoint options
|
||||
*
|
||||
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
|
||||
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<R extends Route>(route: keyof Endpoints | R, options?: R extends keyof Endpoints ? Endpoints[R]["parameters"] & RequestParameters : RequestParameters): R extends keyof Endpoints ? Promise<Endpoints[R]["response"]> : Promise<OctokitResponse<any>>;
|
||||
/**
|
||||
* Returns a new `request` with updated route and parameters
|
||||
*/
|
||||
defaults: <O extends RequestParameters = RequestParameters>(newDefaults: O) => RequestInterface<D & O>;
|
||||
/**
|
||||
* Octokit endpoint API, see {@link https://github.com/octokit/endpoint.js|@octokit/endpoint}
|
||||
*/
|
||||
endpoint: EndpointInterface<D>;
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
var common = require('./common');
|
||||
var fs = require('fs');
|
||||
|
||||
common.register('sed', _sed, {
|
||||
globStart: 3, // don't glob-expand regexes
|
||||
canReceivePipe: true,
|
||||
cmdOptions: {
|
||||
'i': 'inplace',
|
||||
},
|
||||
});
|
||||
|
||||
//@
|
||||
//@ ### sed([options,] search_regex, replacement, file [, file ...])
|
||||
//@ ### sed([options,] search_regex, replacement, file_array)
|
||||
//@
|
||||
//@ Available options:
|
||||
//@
|
||||
//@ + `-i`: Replace contents of `file` in-place. _Note that no backups will be created!_
|
||||
//@
|
||||
//@ Examples:
|
||||
//@
|
||||
//@ ```javascript
|
||||
//@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js');
|
||||
//@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js');
|
||||
//@ ```
|
||||
//@
|
||||
//@ Reads an input string from `file`s, and performs a JavaScript `replace()` on the input
|
||||
//@ using the given `search_regex` and `replacement` string or function. Returns the new string after replacement.
|
||||
//@
|
||||
//@ Note:
|
||||
//@
|
||||
//@ Like unix `sed`, ShellJS `sed` supports capture groups. Capture groups are specified
|
||||
//@ using the `$n` syntax:
|
||||
//@
|
||||
//@ ```javascript
|
||||
//@ sed(/(\w+)\s(\w+)/, '$2, $1', 'file.txt');
|
||||
//@ ```
|
||||
function _sed(options, regex, replacement, files) {
|
||||
// Check if this is coming from a pipe
|
||||
var pipe = common.readFromPipe();
|
||||
|
||||
if (typeof replacement !== 'string' && typeof replacement !== 'function') {
|
||||
if (typeof replacement === 'number') {
|
||||
replacement = replacement.toString(); // fallback
|
||||
} else {
|
||||
common.error('invalid replacement string');
|
||||
}
|
||||
}
|
||||
|
||||
// Convert all search strings to RegExp
|
||||
if (typeof regex === 'string') {
|
||||
regex = RegExp(regex);
|
||||
}
|
||||
|
||||
if (!files && !pipe) {
|
||||
common.error('no files given');
|
||||
}
|
||||
|
||||
files = [].slice.call(arguments, 3);
|
||||
|
||||
if (pipe) {
|
||||
files.unshift('-');
|
||||
}
|
||||
|
||||
var sed = [];
|
||||
files.forEach(function (file) {
|
||||
if (!fs.existsSync(file) && file !== '-') {
|
||||
common.error('no such file or directory: ' + file, 2, { continue: true });
|
||||
return;
|
||||
}
|
||||
|
||||
var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8');
|
||||
var lines = contents.split('\n');
|
||||
var result = lines.map(function (line) {
|
||||
return line.replace(regex, replacement);
|
||||
}).join('\n');
|
||||
|
||||
sed.push(result);
|
||||
|
||||
if (options.inplace) {
|
||||
fs.writeFileSync(file, result, 'utf8');
|
||||
}
|
||||
});
|
||||
|
||||
return sed.join('\n');
|
||||
}
|
||||
module.exports = _sed;
|
||||
@@ -0,0 +1,6 @@
|
||||
const parse = require('./parse')
|
||||
const prerelease = (version, options) => {
|
||||
const parsed = parse(version, options)
|
||||
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
|
||||
}
|
||||
module.exports = prerelease
|
||||
@@ -0,0 +1,77 @@
|
||||
'use strict';
|
||||
|
||||
// We define these manually to ensure they're always copied
|
||||
// even if they would move up the prototype chain
|
||||
// https://nodejs.org/api/http.html#http_class_http_incomingmessage
|
||||
const knownProperties = [
|
||||
'aborted',
|
||||
'complete',
|
||||
'headers',
|
||||
'httpVersion',
|
||||
'httpVersionMinor',
|
||||
'httpVersionMajor',
|
||||
'method',
|
||||
'rawHeaders',
|
||||
'rawTrailers',
|
||||
'setTimeout',
|
||||
'socket',
|
||||
'statusCode',
|
||||
'statusMessage',
|
||||
'trailers',
|
||||
'url'
|
||||
];
|
||||
|
||||
module.exports = (fromStream, toStream) => {
|
||||
if (toStream._readableState.autoDestroy) {
|
||||
throw new Error('The second stream must have the `autoDestroy` option set to `false`');
|
||||
}
|
||||
|
||||
const fromProperties = new Set(Object.keys(fromStream).concat(knownProperties));
|
||||
|
||||
const properties = {};
|
||||
|
||||
for (const property of fromProperties) {
|
||||
// Don't overwrite existing properties.
|
||||
if (property in toStream) {
|
||||
continue;
|
||||
}
|
||||
|
||||
properties[property] = {
|
||||
get() {
|
||||
const value = fromStream[property];
|
||||
const isFunction = typeof value === 'function';
|
||||
|
||||
return isFunction ? value.bind(fromStream) : value;
|
||||
},
|
||||
set(value) {
|
||||
fromStream[property] = value;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: false
|
||||
};
|
||||
}
|
||||
|
||||
Object.defineProperties(toStream, properties);
|
||||
|
||||
fromStream.once('aborted', () => {
|
||||
toStream.destroy();
|
||||
|
||||
toStream.emit('aborted');
|
||||
});
|
||||
|
||||
fromStream.once('close', () => {
|
||||
if (fromStream.complete) {
|
||||
if (toStream.readable) {
|
||||
toStream.once('end', () => {
|
||||
toStream.emit('close');
|
||||
});
|
||||
} else {
|
||||
toStream.emit('close');
|
||||
}
|
||||
} else {
|
||||
toStream.emit('close');
|
||||
}
|
||||
});
|
||||
|
||||
return toStream;
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
if(typeof cptable === 'undefined') cptable = {};
|
||||
cptable[57004] = (function(){ var d = [], e = {}, D = [], j;
|
||||
D[0] = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~
<C29E><C29F>ஂஃஅஆஇஈஉஊ<E0AE89>ஏஏஐஐஒஓஔஔககககஙசசஜஜஞடடடடணததததநனபபபபமயயரறலளழவஷஷஸஹ<E0AEB8>ாிீுூ<E0AF81>ெேைைொோௌௌ்<E0AF8C>.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0௧௨௩௪௫௬௭௮௯<E0AFAE><E0AFAF><EFBFBD><EFBFBD><EFBFBD>".split("");
|
||||
for(j = 0; j != D[0].length; ++j) if(D[0][j].charCodeAt(0) !== 0xFFFD) { e[D[0][j]] = 0 + j; d[0 + j] = D[0][j];}
|
||||
D[239] = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>௯௯௯௯௯௯௯௯௯௯௯௯<E0AFAF><E0AFAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>".split("");
|
||||
for(j = 0; j != D[239].length; ++j) if(D[239][j].charCodeAt(0) !== 0xFFFD) { e[D[239][j]] = 61184 + j; d[61184 + j] = D[239][j];}
|
||||
return {"enc": e, "dec": d }; })();
|
||||
@@ -0,0 +1,9 @@
|
||||
import { map } from "../operators/map";
|
||||
const { isArray } = Array;
|
||||
function callOrApply(fn, args) {
|
||||
return isArray(args) ? fn(...args) : fn(args);
|
||||
}
|
||||
export function mapOneOrManyArgs(fn) {
|
||||
return map(args => callOrApply(fn, args));
|
||||
}
|
||||
//# sourceMappingURL=mapOneOrManyArgs.js.map
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').foldr;
|
||||
@@ -0,0 +1,153 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for csv2json/src/ProcessorLocal.test.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> ProcessorLocal.test.ts
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>23/23</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'>3/3</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>21/21</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a>
|
||||
<a name='L15'></a><a href='#L15'>15</a>
|
||||
<a name='L16'></a><a href='#L16'>16</a>
|
||||
<a name='L17'></a><a href='#L17'>17</a>
|
||||
<a name='L18'></a><a href='#L18'>18</a>
|
||||
<a name='L19'></a><a href='#L19'>19</a>
|
||||
<a name='L20'></a><a href='#L20'>20</a>
|
||||
<a name='L21'></a><a href='#L21'>21</a>
|
||||
<a name='L22'></a><a href='#L22'>22</a>
|
||||
<a name='L23'></a><a href='#L23'>23</a>
|
||||
<a name='L24'></a><a href='#L24'>24</a>
|
||||
<a name='L25'></a><a href='#L25'>25</a>
|
||||
<a name='L26'></a><a href='#L26'>26</a>
|
||||
<a name='L27'></a><a href='#L27'>27</a>
|
||||
<a name='L28'></a><a href='#L28'>28</a>
|
||||
<a name='L29'></a><a href='#L29'>29</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import {ProcessorLocal} from "./ProcessorLocal";
|
||||
import { Converter } from "./Converter";
|
||||
import P from "bluebird";
|
||||
import {readFileSync} from "fs";
|
||||
import path from "path";
|
||||
import assert from "assert";
|
||||
import { JSONResult } from "./lineToJson";
|
||||
const dataDir=path.join(__dirname,"../test/data/");
|
||||
describe("ProcessLocal",()=>{
|
||||
it ("should process csv chunks and output json",async function (){
|
||||
const processor=new ProcessorLocal(new Converter());
|
||||
const data=readFileSync(dataDir+"/complexJSONCSV");
|
||||
const lines=await processor.process(data);
|
||||
assert(lines.length === 2);
|
||||
const line0=lines[0] as JSONResult;
|
||||
assert.equal(line0.fieldA.title,"Food Factory");
|
||||
assert.equal(line0.fieldA.children.length,2);
|
||||
assert.equal(line0.fieldA.children[1].employee[0].name,"Tim");
|
||||
})
|
||||
it ("should process csv chunks and output csv rows",async function (){
|
||||
const processor=new ProcessorLocal(new Converter({output:"line"}));
|
||||
const data=readFileSync(dataDir+"/complexJSONCSV");
|
||||
const lines=await processor.process(data);
|
||||
|
||||
assert(lines.length === 2);
|
||||
})
|
||||
})
|
||||
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri May 11 2018 21:36:07 GMT+0100 (IST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../sorter.js"></script>
|
||||
<script src="../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,7 @@
|
||||
module.exports = [
|
||||
require('./parser_array.js'),
|
||||
require('./parser_json.js'),
|
||||
require('./parser_omit.js'),
|
||||
require('./parser_jsonarray.js'),
|
||||
require("./parser_flat.js")
|
||||
];
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0.01338,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0.60192,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0.72899,"110":0.25414,"111":0,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.00669,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0.02006,"62":0,"63":0,"64":0,"65":0.02006,"66":0,"67":0,"68":0,"69":0.04013,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0.04013,"77":0,"78":0,"79":0.04013,"80":0,"81":0,"83":0.01338,"84":0,"85":0,"86":0,"87":0.06688,"88":0.00669,"89":0,"90":0.00669,"91":0.06688,"92":0.00669,"93":0.02006,"94":0,"95":0,"96":0,"97":0.02006,"98":0,"99":0.00669,"100":0,"101":0,"102":0,"103":0.18726,"104":0.02006,"105":0.04013,"106":0.00669,"107":0.02006,"108":1.10352,"109":11.18234,"110":6.93546,"111":0.00669,"112":0,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.0535,"94":0.62867,"95":0.38122,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"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.02675,"93":0,"94":0,"95":0,"96":0,"97":0.00669,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0.00669,"106":0,"107":0.02006,"108":0.0535,"109":3.02966,"110":5.45741},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.2207,"14":0.29427,"15":0.01338,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0.00669,"13.1":0.04013,"14.1":9.28294,"15.1":0.00669,"15.2-15.3":0.02006,"15.4":0.10701,"15.5":0.12707,"15.6":0.34778,"16.0":0.0535,"16.1":0.06688,"16.2":1.27741,"16.3":0.21402,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00308,"10.0-10.2":0.00615,"10.3":0.24462,"11.0-11.2":0.08154,"11.3-11.4":0.01385,"12.0-12.1":0.02923,"12.2-12.5":0.55539,"13.0-13.1":0.02462,"13.2":0,"13.3":0.05231,"13.4-13.7":0.02,"14.0-14.4":0.86309,"14.5-14.8":0.35385,"15.0-15.1":0.44308,"15.2-15.3":0.10923,"15.4":0.23693,"15.5":0.25539,"15.6":1.2231,"16.0":1.72618,"16.1":3.55699,"16.2":3.57852,"16.3":1.40464,"16.4":0.00615},P:{"4":0,"20":2.86455,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0,"12.0":0,"13.0":0.0924,"14.0":0,"15.0":0,"16.0":0,"17.0":0.01027,"18.0":0.0308,"19.0":3.05963},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.35032},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.00669,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.00662},H:{"0":0.08466},L:{"0":30.07371},R:{_:"0"},M:{"0":0.96048},Q:{"13.1":0}};
|
||||
@@ -0,0 +1,64 @@
|
||||
import { switchMap } from './switchMap';
|
||||
import { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';
|
||||
import { isFunction } from '../util/isFunction';
|
||||
|
||||
/** @deprecated Will be removed in v9. Use {@link switchMap} instead: `switchMap(() => result)` */
|
||||
export function switchMapTo<O extends ObservableInput<unknown>>(observable: O): OperatorFunction<unknown, ObservedValueOf<O>>;
|
||||
/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */
|
||||
export function switchMapTo<O extends ObservableInput<unknown>>(
|
||||
observable: O,
|
||||
resultSelector: undefined
|
||||
): OperatorFunction<unknown, ObservedValueOf<O>>;
|
||||
/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */
|
||||
export function switchMapTo<T, R, O extends ObservableInput<unknown>>(
|
||||
observable: O,
|
||||
resultSelector: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R
|
||||
): OperatorFunction<T, R>;
|
||||
|
||||
/**
|
||||
* Projects each source value to the same Observable which is flattened multiple
|
||||
* times with {@link switchMap} in the output Observable.
|
||||
*
|
||||
* <span class="informal">It's like {@link switchMap}, but maps each value
|
||||
* always to the same inner Observable.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* Maps each source value to the given Observable `innerObservable` regardless
|
||||
* of the source value, and then flattens those resulting Observables into one
|
||||
* single Observable, which is the output Observable. The output Observables
|
||||
* emits values only from the most recently emitted instance of
|
||||
* `innerObservable`.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* Restart an interval Observable on every click event
|
||||
*
|
||||
* ```ts
|
||||
* import { fromEvent, switchMapTo, interval } from 'rxjs';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const result = clicks.pipe(switchMapTo(interval(1000)));
|
||||
* result.subscribe(x => console.log(x));
|
||||
* ```
|
||||
*
|
||||
* @see {@link concatMapTo}
|
||||
* @see {@link switchAll}
|
||||
* @see {@link switchMap}
|
||||
* @see {@link mergeMapTo}
|
||||
*
|
||||
* @param {ObservableInput} innerObservable An Observable to replace each value from
|
||||
* the source Observable.
|
||||
* @return A function that returns an Observable that emits items from the
|
||||
* given `innerObservable` (and optionally transformed through the deprecated
|
||||
* `resultSelector`) every time a value is emitted on the source Observable,
|
||||
* and taking only the values from the most recently projected inner
|
||||
* Observable.
|
||||
* @deprecated Will be removed in v9. Use {@link switchMap} instead: `switchMap(() => result)`
|
||||
*/
|
||||
export function switchMapTo<T, R, O extends ObservableInput<unknown>>(
|
||||
innerObservable: O,
|
||||
resultSelector?: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R
|
||||
): OperatorFunction<T, ObservedValueOf<O> | R> {
|
||||
return isFunction(resultSelector) ? switchMap(() => innerObservable, resultSelector) : switchMap(() => innerObservable);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["src/crypto.ts"],"names":[],"mappings":";;;AAAA,qCAAqC;AAExB,QAAA,MAAM,GAA8B;IAC/C,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,SAAS;CACf,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"2":"C K L G M N O P Q R S T U V W X Y Z","132":"a b c d e i j k l m n o p q r s t u f H"},C:{"2":"0 1 2 3 4 5 6 7 8 DC tB I v J D E F A B C K L G M N O w g x y z EC FC","132":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z","132":"a b c d e i j k l m n o p q r s t u f H xB yB GC"},E:{"2":"I v J D E F A B C K L G HC zB IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB PC QC RC SC qB AC TC rB","132":"oB pB P Q R wB S T U V W X Y Z a b c d e"},G:{"2":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"2":"oC"},I:{"2":"tB I pC qC rC sC BC tC uC","132":"f"},J:{"2":"D A"},K:{"2":"A B C qB AC rB","132":"h"},L:{"132":"H"},M:{"132":"H"},N:{"2":"A B"},O:{"2":"vC"},P:{"2":"I wC xC yC zC 0C 0B 1C 2C 3C 4C 5C","132":"g sB 6C 7C 8C"},Q:{"2":"1B"},R:{"132":"9C"},S:{"132":"AD BD"}},B:4,C:"CSS Counter Styles"};
|
||||
@@ -0,0 +1,12 @@
|
||||
import TemplateScope from './shared/TemplateScope';
|
||||
import AbstractBlock from './shared/AbstractBlock';
|
||||
import AwaitBlock from './AwaitBlock';
|
||||
import Component from '../Component';
|
||||
import { TemplateNode } from '../../interfaces';
|
||||
import ConstTag from './ConstTag';
|
||||
export default class ThenBlock extends AbstractBlock {
|
||||
type: 'ThenBlock';
|
||||
scope: TemplateScope;
|
||||
const_tags: ConstTag[];
|
||||
constructor(component: Component, parent: AwaitBlock, scope: TemplateScope, info: TemplateNode);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
var resolveException = require("../lib/resolve-exception")
|
||||
, is = require("./is");
|
||||
|
||||
module.exports = function (value/*, options*/) {
|
||||
if (is(value)) return value;
|
||||
var options = arguments[1];
|
||||
var errorMessage =
|
||||
options && options.name ? "Expected a promise for %n, received %v" : "%v is not a promise";
|
||||
return resolveException(value, errorMessage, options);
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
export interface Options {
|
||||
/**
|
||||
Count [ambiguous width characters](https://www.unicode.org/reports/tr11/#Ambiguous) as having narrow width (count of 1) instead of wide width (count of 2).
|
||||
|
||||
@default true
|
||||
*/
|
||||
readonly ambiguousIsNarrow: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
Get the visual width of a string - the number of columns required to display it.
|
||||
|
||||
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
|
||||
|
||||
@example
|
||||
```
|
||||
import stringWidth from 'string-width';
|
||||
|
||||
stringWidth('a');
|
||||
//=> 1
|
||||
|
||||
stringWidth('古');
|
||||
//=> 2
|
||||
|
||||
stringWidth('\u001B[1m古\u001B[22m');
|
||||
//=> 2
|
||||
```
|
||||
*/
|
||||
export default function stringWidth(string: string, options?: Options): number;
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('assign', require('../assign'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,61 @@
|
||||
import { OperatorFunction } from '../types';
|
||||
import { operate } from '../util/lift';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
|
||||
/**
|
||||
* Groups pairs of consecutive emissions together and emits them as an array of
|
||||
* two values.
|
||||
*
|
||||
* <span class="informal">Puts the current value and previous value together as
|
||||
* an array, and emits that.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* The Nth emission from the source Observable will cause the output Observable
|
||||
* to emit an array [(N-1)th, Nth] of the previous and the current value, as a
|
||||
* pair. For this reason, `pairwise` emits on the second and subsequent
|
||||
* emissions from the source Observable, but not on the first emission, because
|
||||
* there is no previous value in that case.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* On every click (starting from the second), emit the relative distance to the previous click
|
||||
*
|
||||
* ```ts
|
||||
* import { fromEvent, pairwise, map } from 'rxjs';
|
||||
*
|
||||
* const clicks = fromEvent<PointerEvent>(document, 'click');
|
||||
* const pairs = clicks.pipe(pairwise());
|
||||
* const distance = pairs.pipe(
|
||||
* map(([first, second]) => {
|
||||
* const x0 = first.clientX;
|
||||
* const y0 = first.clientY;
|
||||
* const x1 = second.clientX;
|
||||
* const y1 = second.clientY;
|
||||
* return Math.sqrt(Math.pow(x0 - x1, 2) + Math.pow(y0 - y1, 2));
|
||||
* })
|
||||
* );
|
||||
*
|
||||
* distance.subscribe(x => console.log(x));
|
||||
* ```
|
||||
*
|
||||
* @see {@link buffer}
|
||||
* @see {@link bufferCount}
|
||||
*
|
||||
* @return A function that returns an Observable of pairs (as arrays) of
|
||||
* consecutive values from the source Observable.
|
||||
*/
|
||||
export function pairwise<T>(): OperatorFunction<T, [T, T]> {
|
||||
return operate((source, subscriber) => {
|
||||
let prev: T;
|
||||
let hasPrev = false;
|
||||
source.subscribe(
|
||||
createOperatorSubscriber(subscriber, (value) => {
|
||||
const p = prev;
|
||||
prev = value;
|
||||
hasPrev && subscriber.next([p, value]);
|
||||
hasPrev = true;
|
||||
})
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"defer.js","sourceRoot":"","sources":["../../../../src/internal/observable/defer.ts"],"names":[],"mappings":";;;AAAA,4CAA2C;AAE3C,yCAAwC;AAkDxC,SAAgB,KAAK,CAAiC,iBAA0B;IAC9E,OAAO,IAAI,uBAAU,CAAqB,UAAC,UAAU;QACnD,qBAAS,CAAC,iBAAiB,EAAE,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,sBAIC"}
|
||||
@@ -0,0 +1,2 @@
|
||||
/* frac.js (C) 2012-present SheetJS -- http://sheetjs.com */
|
||||
var frac=function frac(x,D,mixed){var n1=Math.floor(x),d1=1;var n2=n1+1,d2=1;if(x!==n1)while(d1<=D&&d2<=D){var m=(n1+n2)/(d1+d2);if(x===m){if(d1+d2<=D){d1+=d2;n1+=n2;d2=D+1}else if(d1>d2)d2=D+1;else d1=D+1;break}else if(x<m){n2=n1+n2;d2=d1+d2}else{n1=n1+n2;d1=d1+d2}}if(d1>D){d1=d2;n1=n2}if(!mixed)return[0,n1,d1];var q=Math.floor(n1/d1);return[q,n1-q*d1,d1]};frac.cont=function cont(x,D,mixed){var sgn=x<0?-1:1;var B=x*sgn;var P_2=0,P_1=1,P=0;var Q_2=1,Q_1=0,Q=0;var A=Math.floor(B);while(Q_1<D){A=Math.floor(B);P=A*P_1+P_2;Q=A*Q_1+Q_2;if(B-A<5e-8)break;B=1/(B-A);P_2=P_1;P_1=P;Q_2=Q_1;Q_1=Q}if(Q>D){if(Q_1>D){Q=Q_2;P=P_2}else{Q=Q_1;P=P_1}}if(!mixed)return[0,sgn*P,Q];var q=Math.floor(sgn*P/Q);return[q,sgn*P-q*Q,Q]};if(typeof module!=="undefined"&&typeof DO_NOT_EXPORT_FRAC==="undefined")module.exports=frac;
|
||||
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
var resolveException = require("../lib/resolve-exception")
|
||||
, is = require("./is");
|
||||
|
||||
module.exports = function (value/*, options*/) {
|
||||
if (is(value)) return value;
|
||||
return resolveException(value, "%v is not an object", arguments[1]);
|
||||
};
|
||||
@@ -0,0 +1,193 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
--- Exceptions to the Apache 2.0 License ----
|
||||
|
||||
As an exception, if, as a result of your compiling your source code, portions
|
||||
of this Software are embedded into an Object form of such source code, you
|
||||
may redistribute such embedded portions in such Object form without complying
|
||||
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
|
||||
|
||||
In addition, if you combine or link compiled forms of this Software with
|
||||
software that is licensed under the GPLv2 ("Combined Software") and if a
|
||||
court of competent jurisdiction determines that the patent provision (Section
|
||||
3), the indemnity provision (Section 9) or other Section of the License
|
||||
conflicts with the conditions of the GPLv2, you may retroactively and
|
||||
prospectively choose to deem waived or otherwise exclude such Section(s) of
|
||||
the License, but only in their entirety and only with respect to the Combined
|
||||
Software.
|
||||
Reference in New Issue
Block a user