This commit is contained in:
2025-05-09 05:30:08 +02:00
parent 7bb10e7df4
commit 73367bad9e
5322 changed files with 1266973 additions and 313 deletions

View File

@@ -0,0 +1,189 @@
/**
* @fileoverview enforce a maximum file length
* @author Alberto Rodríguez
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Creates an array of numbers from `start` up to, but not including, `end`
* @param {number} start The start of the range
* @param {number} end The end of the range
* @returns {number[]} The range of numbers
*/
function range(start, end) {
return [...Array(end - start).keys()].map(x => x + start);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Enforce a maximum number of lines per file",
recommended: false,
url: "https://eslint.org/docs/latest/rules/max-lines",
},
schema: [
{
oneOf: [
{
type: "integer",
minimum: 0,
},
{
type: "object",
properties: {
max: {
type: "integer",
minimum: 0,
},
skipComments: {
type: "boolean",
},
skipBlankLines: {
type: "boolean",
},
},
additionalProperties: false,
},
],
},
],
messages: {
exceed: "File has too many lines ({{actual}}). Maximum allowed is {{max}}.",
},
},
create(context) {
const option = context.options[0];
let max = 300;
if (typeof option === "object" && Object.hasOwn(option, "max")) {
max = option.max;
} else if (typeof option === "number") {
max = option;
}
const skipComments = option && option.skipComments;
const skipBlankLines = option && option.skipBlankLines;
const sourceCode = context.sourceCode;
/**
* Returns whether or not a token is a comment node type
* @param {Token} token The token to check
* @returns {boolean} True if the token is a comment node
*/
function isCommentNodeType(token) {
return token && (token.type === "Block" || token.type === "Line");
}
/**
* Returns the line numbers of a comment that don't have any code on the same line
* @param {Node} comment The comment node to check
* @returns {number[]} The line numbers
*/
function getLinesWithoutCode(comment) {
let start = comment.loc.start.line;
let end = comment.loc.end.line;
let token;
token = comment;
do {
token = sourceCode.getTokenBefore(token, {
includeComments: true,
});
} while (isCommentNodeType(token));
if (token && astUtils.isTokenOnSameLine(token, comment)) {
start += 1;
}
token = comment;
do {
token = sourceCode.getTokenAfter(token, {
includeComments: true,
});
} while (isCommentNodeType(token));
if (token && astUtils.isTokenOnSameLine(comment, token)) {
end -= 1;
}
if (start <= end) {
return range(start, end + 1);
}
return [];
}
return {
"Program:exit"() {
let lines = sourceCode.lines.map((text, i) => ({
lineNumber: i + 1,
text,
}));
/*
* If file ends with a linebreak, `sourceCode.lines` will have one extra empty line at the end.
* That isn't a real line, so we shouldn't count it.
*/
if (lines.length > 1 && lines.at(-1).text === "") {
lines.pop();
}
if (skipBlankLines) {
lines = lines.filter(l => l.text.trim() !== "");
}
if (skipComments) {
const comments = sourceCode.getAllComments();
const commentLines = new Set(
comments.flatMap(getLinesWithoutCode),
);
lines = lines.filter(l => !commentLines.has(l.lineNumber));
}
if (lines.length > max) {
const loc = {
start: {
line: lines[max].lineNumber,
column: 0,
},
end: {
line: sourceCode.lines.length,
column: sourceCode.lines.at(-1).length,
},
};
context.report({
loc,
messageId: "exceed",
data: {
max,
actual: lines.length,
},
});
}
},
};
},
};

View File

@@ -0,0 +1,29 @@
function redirect(opts) {
opts.isRedirect = true;
opts.statusCode = opts.statusCode || opts.code || 307;
opts.headers = opts.headers || {};
if (!opts.reloadDocument) {
opts.reloadDocument = false;
try {
new URL(`${opts.href}`);
opts.reloadDocument = true;
} catch {
}
}
if (opts.throw) {
throw opts;
}
return opts;
}
function isRedirect(obj) {
return !!(obj == null ? void 0 : obj.isRedirect);
}
function isResolvedRedirect(obj) {
return !!(obj == null ? void 0 : obj.isRedirect) && obj.href;
}
export {
isRedirect,
isResolvedRedirect,
redirect
};
//# sourceMappingURL=redirect.js.map

View File

@@ -0,0 +1,154 @@
/**
* @fileoverview An object that caches and applies source code fixes.
* @author Nicholas C. Zakas
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const debug = require("debug")("eslint:source-code-fixer");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const BOM = "\uFEFF";
/**
* Compares items in a messages array by range.
* @param {Message} a The first message.
* @param {Message} b The second message.
* @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal.
* @private
*/
function compareMessagesByFixRange(a, b) {
return a.fix.range[0] - b.fix.range[0] || a.fix.range[1] - b.fix.range[1];
}
/**
* Compares items in a messages array by line and column.
* @param {Message} a The first message.
* @param {Message} b The second message.
* @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal.
* @private
*/
function compareMessagesByLocation(a, b) {
return a.line - b.line || a.column - b.column;
}
//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------
/**
* Utility for apply fixes to source code.
* @constructor
*/
function SourceCodeFixer() {
Object.freeze(this);
}
/**
* Applies the fixes specified by the messages to the given text. Tries to be
* smart about the fixes and won't apply fixes over the same area in the text.
* @param {string} sourceText The text to apply the changes to.
* @param {Message[]} messages The array of messages reported by ESLint.
* @param {boolean|Function} [shouldFix=true] Determines whether each message should be fixed
* @returns {Object} An object containing the fixed text and any unfixed messages.
*/
SourceCodeFixer.applyFixes = function (sourceText, messages, shouldFix) {
debug("Applying fixes");
if (shouldFix === false) {
debug("shouldFix parameter was false, not attempting fixes");
return {
fixed: false,
messages,
output: sourceText,
};
}
// clone the array
const remainingMessages = [],
fixes = [],
bom = sourceText.startsWith(BOM) ? BOM : "",
text = bom ? sourceText.slice(1) : sourceText;
let lastPos = Number.NEGATIVE_INFINITY,
output = bom;
/**
* Try to use the 'fix' from a problem.
* @param {Message} problem The message object to apply fixes from
* @returns {boolean} Whether fix was successfully applied
*/
function attemptFix(problem) {
const fix = problem.fix;
const start = fix.range[0];
const end = fix.range[1];
// Remain it as a problem if it's overlapped or it's a negative range
if (lastPos >= start || start > end) {
remainingMessages.push(problem);
return false;
}
// Remove BOM.
if (
(start < 0 && end >= 0) ||
(start === 0 && fix.text.startsWith(BOM))
) {
output = "";
}
// Make output to this fix.
output += text.slice(Math.max(0, lastPos), Math.max(0, start));
output += fix.text;
lastPos = end;
return true;
}
messages.forEach(problem => {
if (Object.hasOwn(problem, "fix") && problem.fix) {
fixes.push(problem);
} else {
remainingMessages.push(problem);
}
});
if (fixes.length) {
debug("Found fixes to apply");
let fixesWereApplied = false;
for (const problem of fixes.sort(compareMessagesByFixRange)) {
if (typeof shouldFix !== "function" || shouldFix(problem)) {
attemptFix(problem);
/*
* The only time attemptFix will fail is if a previous fix was
* applied which conflicts with it. So we can mark this as true.
*/
fixesWereApplied = true;
} else {
remainingMessages.push(problem);
}
}
output += text.slice(Math.max(0, lastPos));
return {
fixed: fixesWereApplied,
messages: remainingMessages.sort(compareMessagesByLocation),
output,
};
}
debug("No fixes to apply");
return {
fixed: false,
messages,
output: bom + text,
};
};
module.exports = SourceCodeFixer;

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L"},C:{"1":"0 9 SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"1 2 3 4 5 6 7 8 nC LC J PB K D E F A B C L M G N O P QB RB qC rC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"J PB K D E F A B C L M G N O P QB"},E:{"1":"L M G GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"J PB K D E F A B C sC SC tC uC vC wC TC FC"},F:{"1":"0 1 2 3 4 5 6 7 8 B C O P QB RB SB TB UB VB WB XB YB ZB 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 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z FC kC 8C GC","2":"F G N 4C 5C 6C 7C"},G:{"2":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD","129":"LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC"},H:{"2":"WD"},I:{"1":"I bD cD","2":"LC J XD YD ZD aD lC"},J:{"1":"D A"},K:{"1":"A B C H FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"rD","2":"qD"}},B:1,C:"Color input type",D:true};

View File

@@ -0,0 +1,18 @@
'use strict';
var l, s;
if (process.env.NODE_ENV === 'production') {
l = require('./cjs/react-dom-server-legacy.node.production.js');
s = require('./cjs/react-dom-server.node.production.js');
} else {
l = require('./cjs/react-dom-server-legacy.node.development.js');
s = require('./cjs/react-dom-server.node.development.js');
}
exports.version = l.version;
exports.renderToString = l.renderToString;
exports.renderToStaticMarkup = l.renderToStaticMarkup;
exports.renderToPipeableStream = s.renderToPipeableStream;
if (s.resumeToPipeableStream) {
exports.resumeToPipeableStream = s.resumeToPipeableStream;
}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A mC","132":"B"},B:{"1":"C L M G N O P","4":"0 9 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I"},C:{"2":"nC LC qC","4":"0 1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","8":"J PB rC"},D:{"2":"J PB K","4":"0 1 2 3 4 5 6 7 8 9 D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC"},E:{"2":"J PB K D E F A B C L M G sC SC tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C"},F:{"2":"F B C 4C 5C 6C 7C FC kC 8C GC","4":"0 1 2 3 4 5 6 7 8 G N O P QB RB SB TB UB VB WB XB YB ZB 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 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{"2":"SC 9C","4":"E lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC"},H:{"2":"WD"},I:{"2":"XD YD ZD","4":"LC J I aD lC bD cD"},J:{"2":"D","4":"A"},K:{"1":"C GC","2":"A B FC kC","4":"H"},L:{"4":"I"},M:{"4":"EC"},N:{"1":"B","2":"A"},O:{"4":"HC"},P:{"4":"1 2 3 4 5 6 7 8 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"4":"oD"},R:{"4":"pD"},S:{"4":"qD rD"}},B:4,C:"DeviceOrientation & DeviceMotion events",D:true};

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N O P","1220":"Q H R S T U V W"},C:{"1":"0 9 DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"nC LC qC rC","548":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC"},D:{"1":"0 9 X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","16":"J PB K D E F A B C L M","164":"1 2 3 4 5 6 7 8 G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB","196":"0B 1B 2B","1220":"3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W"},E:{"1":"M G yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"J sC SC","16":"PB","164":"K D E tC uC vC","260":"F A B C L wC TC FC GC xC"},F:{"1":"0 AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C 4C 5C 6C 7C FC kC 8C GC","164":"1 2 3 4 5 6 7 8 G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB","196":"pB qB rB","1220":"sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B"},G:{"1":"QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","16":"SC 9C lC AD BD","164":"E CD DD","260":"ED FD GD HD ID JD KD LD MD ND OD PD"},H:{"2":"WD"},I:{"1":"I","16":"LC XD YD ZD","164":"J aD lC bD cD"},J:{"16":"D","164":"A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 mD IC JC KC nD","164":"J dD eD fD gD hD TC iD jD kD lD"},Q:{"1220":"oD"},R:{"1":"pD"},S:{"1":"rD","548":"qD"}},B:5,C:":is() CSS pseudo-class",D:true};

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = rewriteThis;
var _core = require("@babel/core");
var _traverse = require("@babel/traverse");
let rewriteThisVisitor;
function rewriteThis(programPath) {
if (!rewriteThisVisitor) {
rewriteThisVisitor = _traverse.visitors.environmentVisitor({
ThisExpression(path) {
path.replaceWith(_core.types.unaryExpression("void", _core.types.numericLiteral(0), true));
}
});
rewriteThisVisitor.noScope = true;
}
(0, _traverse.default)(programPath.node, rewriteThisVisitor);
}
//# sourceMappingURL=rewrite-this.js.map

View File

@@ -0,0 +1,126 @@
/**
* @fileoverview Rule to disallow if as the only statement in an else block
* @author Brandon Mills
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"Disallow `if` statements as the only statement in `else` blocks",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/no-lonely-if",
},
schema: [],
fixable: "code",
messages: {
unexpectedLonelyIf:
"Unexpected if as the only statement in an else block.",
},
},
create(context) {
const sourceCode = context.sourceCode;
return {
IfStatement(node) {
const parent = node.parent,
grandparent = parent.parent;
if (
parent &&
parent.type === "BlockStatement" &&
parent.body.length === 1 &&
!astUtils.areBracesNecessary(parent, sourceCode) &&
grandparent &&
grandparent.type === "IfStatement" &&
parent === grandparent.alternate
) {
context.report({
node,
messageId: "unexpectedLonelyIf",
fix(fixer) {
const openingElseCurly =
sourceCode.getFirstToken(parent);
const closingElseCurly =
sourceCode.getLastToken(parent);
const elseKeyword =
sourceCode.getTokenBefore(openingElseCurly);
const tokenAfterElseBlock =
sourceCode.getTokenAfter(closingElseCurly);
const lastIfToken = sourceCode.getLastToken(
node.consequent,
);
const sourceText = sourceCode.getText();
if (
sourceText
.slice(
openingElseCurly.range[1],
node.range[0],
)
.trim() ||
sourceText
.slice(
node.range[1],
closingElseCurly.range[0],
)
.trim()
) {
// Don't fix if there are any non-whitespace characters interfering (e.g. comments)
return null;
}
if (
node.consequent.type !== "BlockStatement" &&
lastIfToken.value !== ";" &&
tokenAfterElseBlock &&
(node.consequent.loc.end.line ===
tokenAfterElseBlock.loc.start.line ||
/^[([/+`-]/u.test(
tokenAfterElseBlock.value,
) ||
lastIfToken.value === "++" ||
lastIfToken.value === "--")
) {
/*
* If the `if` statement has no block, and is not followed by a semicolon, make sure that fixing
* the issue would not change semantics due to ASI. If this would happen, don't do a fix.
*/
return null;
}
return fixer.replaceTextRange(
[
openingElseCurly.range[0],
closingElseCurly.range[1],
],
(elseKeyword.range[1] ===
openingElseCurly.range[0]
? " "
: "") + sourceCode.getText(node),
);
},
});
}
},
};
},
};

View File

@@ -0,0 +1 @@
module.exports={C:{"52":0.00115,"72":0.00115,"88":0.00805,"115":0.0023,"128":0.00115,"133":0.01725,"135":0.01955,"136":0.06325,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 127 129 130 131 132 134 137 138 139 140 3.5 3.6"},D:{"11":0.00575,"38":0.00115,"49":0.00115,"50":0.0023,"52":0.00115,"53":0.00115,"54":0.00115,"55":0.00115,"56":0.0023,"58":0.00115,"64":0.0023,"67":0.00115,"68":0.0023,"70":0.00115,"74":0.00345,"75":0.00345,"76":0.0414,"79":0.01265,"81":0.0023,"83":0.00115,"84":0.0023,"86":0.00115,"87":0.01725,"88":0.0023,"89":0.00115,"90":0.00345,"91":0.00115,"92":0.00115,"93":0.18055,"94":0.00115,"95":0.00115,"97":0.0138,"98":0.0023,"99":0.00115,"102":0.00115,"103":0.0437,"105":0.03795,"106":0.0069,"108":0.04255,"109":0.11845,"110":0.0046,"111":0.0782,"112":0.0023,"113":0.00115,"114":0.02415,"116":0.01495,"117":0.0046,"118":0.00345,"119":0.02185,"120":0.07245,"121":0.0069,"122":0.00345,"123":0.0046,"124":0.0069,"125":0.02415,"126":0.0322,"127":0.01035,"128":0.02645,"129":0.0092,"130":0.0092,"131":0.1242,"132":0.1265,"133":0.9039,"134":1.03845,"135":0.00345,_:"4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 39 40 41 42 43 44 45 46 47 48 51 57 59 60 61 62 63 65 66 69 71 72 73 77 78 80 85 96 100 101 104 107 115 136 137 138"},F:{"79":0.00115,"87":0.00115,"95":0.0023,"105":0.00115,"114":0.00115,"115":0.00115,"116":0.01725,"117":0.08855,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 86 88 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 106 107 108 109 110 111 112 113 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.00345,"15":0.00115,"17":0.00115,"18":0.00345,"84":0.00115,"90":0.00115,"92":0.0115,"96":0.00345,"109":0.0069,"112":0.00115,"114":0.00115,"120":0.00115,"122":0.00115,"123":0.0023,"125":0.00115,"126":0.00115,"127":0.0046,"128":0.0023,"129":0.00115,"130":0.0046,"131":0.0092,"132":0.01495,"133":0.20585,"134":0.56235,_:"13 14 16 79 80 81 83 85 86 87 88 89 91 93 94 95 97 98 99 100 101 102 103 104 105 106 107 108 110 111 113 115 116 117 118 119 121 124"},E:{"11":0.00115,"13":0.00115,"14":0.0483,_:"0 4 5 6 7 8 9 10 12 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 15.4 16.0 17.0 18.4","11.1":0.0023,"12.1":0.00115,"13.1":0.0023,"14.1":0.02185,"15.1":0.00115,"15.2-15.3":0.0023,"15.5":0.00345,"15.6":0.04255,"16.1":0.00115,"16.2":0.0023,"16.3":0.00345,"16.4":0.00115,"16.5":0.00115,"16.6":0.01035,"17.1":0.00115,"17.2":0.00115,"17.3":0.0023,"17.4":0.0023,"17.5":0.0023,"17.6":0.01035,"18.0":0.00575,"18.1":0.00575,"18.2":0.00115,"18.3":0.05865},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00196,"5.0-5.1":0,"6.0-6.1":0.00588,"7.0-7.1":0.00392,"8.1-8.4":0,"9.0-9.2":0.00294,"9.3":0.01371,"10.0-10.2":0.00098,"10.3":0.02253,"11.0-11.2":0.10384,"11.3-11.4":0.00686,"12.0-12.1":0.00392,"12.2-12.5":0.09698,"13.0-13.1":0.00196,"13.2":0.00294,"13.3":0.00392,"13.4-13.7":0.01371,"14.0-14.4":0.03429,"14.5-14.8":0.04114,"15.0-15.1":0.02253,"15.2-15.3":0.02253,"15.4":0.02743,"15.5":0.03135,"15.6-15.8":0.38596,"16.0":0.05486,"16.1":0.11265,"16.2":0.05878,"16.3":0.10188,"16.4":0.02253,"16.5":0.04212,"16.6-16.7":0.45747,"17.0":0.02743,"17.1":0.04898,"17.2":0.03722,"17.3":0.05192,"17.4":0.10384,"17.5":0.23118,"17.6-17.7":0.67102,"18.0":0.18808,"18.1":0.61518,"18.2":0.27526,"18.3":5.7531,"18.4":0.08522},P:{"4":0.06256,"20":0.02085,"21":0.05214,"22":0.04171,"23":0.04171,"24":0.14598,"25":0.07299,"26":0.19812,"27":0.49009,"5.0-5.4":0.02085,"6.2-6.4":0.01043,"7.2-7.4":0.06256,_:"8.2 10.1 12.0 15.0","9.2":0.12513,"11.1-11.2":0.23983,"13.0":0.12513,"14.0":0.05214,"16.0":0.1147,"17.0":0.01043,"18.0":0.01043,"19.0":0.03128},I:{"0":0.05298,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00002,"4.4":0,"4.4.3-4.4.4":0.00006},K:{"0":0.11504,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.0023,_:"6 7 8 9 10 5.5"},S:{"2.5":0.0177,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.07079},Q:{_:"14.9"},O:{"0":0.0177},H:{"0":0},L:{"0":83.43841}};

View File

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _unsupportedIterableToArray;
var _arrayLikeToArray = require("./arrayLikeToArray.js");
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return (0, _arrayLikeToArray.default)(o, minLen);
var name = Object.prototype.toString.call(o).slice(8, -1);
if (name === "Object" && o.constructor) name = o.constructor.name;
if (name === "Map" || name === "Set") return Array.from(o);
if (name === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(name)) {
return (0, _arrayLikeToArray.default)(o, minLen);
}
}
//# sourceMappingURL=unsupportedIterableToArray.js.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F mC","1156":"A B"},B:{"1":"0 9 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","1028":"C L M G N O P"},C:{"1":"0 9 kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"nC LC","1028":"1 2 3 4 5 6 7 8 C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB","1284":"A B","1412":"K D E F","1924":"J PB qC rC"},D:{"1":"0 9 nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","16":"J PB K","1028":"UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB","1156":"SB TB","1412":"1 2 3 4 5 6 7 8 D E F A B C L M G N O P QB RB"},E:{"1":"C L M G FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"J sC SC","1028":"E F A B vC wC TC","1156":"D uC","1412":"PB K tC"},F:{"1":"0 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 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B 4C 5C 6C 7C FC kC 8C","132":"G N O","1028":"1 2 3 4 5 6 7 8 C P QB RB SB TB UB VB WB XB YB ZB GC"},G:{"1":"ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","2":"SC 9C lC","1028":"E DD ED FD GD HD","1156":"CD","1412":"AD BD"},H:{"2":"WD"},I:{"1":"I","2":"XD YD ZD","1028":"cD","1412":"bD","1924":"LC J aD lC"},J:{"1156":"A","1412":"D"},K:{"1":"H","2":"A B FC kC","1028":"C GC"},L:{"1":"I"},M:{"1":"EC"},N:{"1156":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD","1028":"J"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"qD rD"}},B:1,C:"XMLHttpRequest advanced features",D:true};

View File

@@ -0,0 +1,242 @@
# ObjectSchema Package
## Overview
A JavaScript object merge/validation utility where you can define a different merge and validation strategy for each key. This is helpful when you need to validate complex data structures and then merge them in a way that is more complex than `Object.assign()`. This is used in the [`@eslint/config-array`](https://npmjs.com/package/@eslint/config-array) package but can also be used on its own.
## Installation
For Node.js and compatible runtimes:
```shell
npm install @eslint/object-schema
# or
yarn add @eslint/object-schema
# or
pnpm install @eslint/object-schema
# or
bun install @eslint/object-schema
```
For Deno:
```shell
deno add @eslint/object-schema
```
## Usage
Import the `ObjectSchema` constructor:
```js
// using ESM
import { ObjectSchema } from "@eslint/object-schema";
// using CommonJS
const { ObjectSchema } = require("@eslint/object-schema");
const schema = new ObjectSchema({
// define a definition for the "downloads" key
downloads: {
required: true,
merge(value1, value2) {
return value1 + value2;
},
validate(value) {
if (typeof value !== "number") {
throw new Error("Expected downloads to be a number.");
}
},
},
// define a strategy for the "versions" key
version: {
required: true,
merge(value1, value2) {
return value1.concat(value2);
},
validate(value) {
if (!Array.isArray(value)) {
throw new Error("Expected versions to be an array.");
}
},
},
});
const record1 = {
downloads: 25,
versions: ["v1.0.0", "v1.1.0", "v1.2.0"],
};
const record2 = {
downloads: 125,
versions: ["v2.0.0", "v2.1.0", "v3.0.0"],
};
// make sure the records are valid
schema.validate(record1);
schema.validate(record2);
// merge together (schema.merge() accepts any number of objects)
const result = schema.merge(record1, record2);
// result looks like this:
const result = {
downloads: 75,
versions: ["v1.0.0", "v1.1.0", "v1.2.0", "v2.0.0", "v2.1.0", "v3.0.0"],
};
```
## Tips and Tricks
### Named merge strategies
Instead of specifying a `merge()` method, you can specify one of the following strings to use a default merge strategy:
- `"assign"` - use `Object.assign()` to merge the two values into one object.
- `"overwrite"` - the second value always replaces the first.
- `"replace"` - the second value replaces the first if the second is not `undefined`.
For example:
```js
const schema = new ObjectSchema({
name: {
merge: "replace",
validate() {},
},
});
```
### Named validation strategies
Instead of specifying a `validate()` method, you can specify one of the following strings to use a default validation strategy:
- `"array"` - value must be an array.
- `"boolean"` - value must be a boolean.
- `"number"` - value must be a number.
- `"object"` - value must be an object.
- `"object?"` - value must be an object or null.
- `"string"` - value must be a string.
- `"string!"` - value must be a non-empty string.
For example:
```js
const schema = new ObjectSchema({
name: {
merge: "replace",
validate: "string",
},
});
```
### Subschemas
If you are defining a key that is, itself, an object, you can simplify the process by using a subschema. Instead of defining `merge()` and `validate()`, assign a `schema` key that contains a schema definition, like this:
```js
const schema = new ObjectSchema({
name: {
schema: {
first: {
merge: "replace",
validate: "string",
},
last: {
merge: "replace",
validate: "string",
},
},
},
});
schema.validate({
name: {
first: "n",
last: "z",
},
});
```
### Remove Keys During Merge
If the merge strategy for a key returns `undefined`, then the key will not appear in the final object. For example:
```js
const schema = new ObjectSchema({
date: {
merge() {
return undefined;
},
validate(value) {
Date.parse(value); // throws an error when invalid
},
},
});
const object1 = { date: "5/5/2005" };
const object2 = { date: "6/6/2006" };
const result = schema.merge(object1, object2);
console.log("date" in result); // false
```
### Requiring Another Key Be Present
If you'd like the presence of one key to require the presence of another key, you can use the `requires` property to specify an array of other properties that any key requires. For example:
```js
const schema = new ObjectSchema();
const schema = new ObjectSchema({
date: {
merge() {
return undefined;
},
validate(value) {
Date.parse(value); // throws an error when invalid
},
},
time: {
requires: ["date"],
merge(first, second) {
return second;
},
validate(value) {
// ...
},
},
});
// throws error: Key "time" requires keys "date"
schema.validate({
time: "13:45",
});
```
In this example, even though `date` is an optional key, it is required to be present whenever `time` is present.
## License
Apache 2.0
<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->
## Sponsors
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).
<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://www.serptriumph.com/"><img src="https://images.opencollective.com/serp-triumph5/fea3074/logo.png" alt="SERP Triumph" height="64"></a> <a href="https://www.jetbrains.com/"><img src="https://images.opencollective.com/jetbrains/fe76f99/logo.png" alt="JetBrains" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nolebase.ayaka.io"><img src="https://avatars.githubusercontent.com/u/11081491" alt="Neko" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->

View File

@@ -0,0 +1 @@
{"version":3,"names":["_cloneNode","require","cloneWithoutLoc","node","cloneNode"],"sources":["../../src/clone/cloneWithoutLoc.ts"],"sourcesContent":["import cloneNode from \"./cloneNode.ts\";\nimport type * as t from \"../index.ts\";\n\n/**\n * Create a shallow clone of a `node` excluding `_private` and location properties.\n */\nexport default function cloneWithoutLoc<T extends t.Node>(node: T): T {\n return cloneNode(node, /* deep */ false, /* withoutLoc */ true);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAMe,SAASC,eAAeA,CAAmBC,IAAO,EAAK;EACpE,OAAO,IAAAC,kBAAS,EAACD,IAAI,EAAa,KAAK,EAAmB,IAAI,CAAC;AACjE","ignoreList":[]}

View File

@@ -0,0 +1,17 @@
/**
* @private
*/
export type AnyUpdater = (prev: any) => any
/**
* @private
*/
export interface ListenerValue<T> {
prevVal: T
currentVal: T
}
/**
* @private
*/
export type Listener<T> = (value: ListenerValue<T>) => void

View File

@@ -0,0 +1,278 @@
# flat-cache - Changelog
## v3.0.4
- **Refactoring**
- add files by name to the list of exported files - [89a2698](https://github.com/royriojas/flat-cache/commit/89a2698), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 02:35:39
## v3.0.3
- **Bug Fixes**
- Fix wrong eslint command - [f268e42](https://github.com/royriojas/flat-cache/commit/f268e42), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 02:15:04
## v3.0.2
- **Refactoring**
- Update the files paths - [6983a80](https://github.com/royriojas/flat-cache/commit/6983a80), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:58:39
- Move code to src/ - [18ed6e8](https://github.com/royriojas/flat-cache/commit/18ed6e8), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:57:17
- Change eslint-cache location - [beed74c](https://github.com/royriojas/flat-cache/commit/beed74c), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:48:32
## v3.0.1
- **Refactoring**
- Remove unused deps - [8c6d9dc](https://github.com/royriojas/flat-cache/commit/8c6d9dc), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:43:29
## v3.0.0
- **Refactoring**
- Fix engines - [52b824c](https://github.com/royriojas/flat-cache/commit/52b824c), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:01:52
- **Other changes**
- Replace write with combination of mkdir and writeFile ([#49](https://github.com/royriojas/flat-cache/issues/49)) - [ef48276](https://github.com/royriojas/flat-cache/commit/ef48276), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 08/11/2020 00:17:15
Node v10 introduced a great "recursive" option for mkdir which allows to
get rid from mkdirp package and easily rewrite "write" package usage
with two function calls.
https://nodejs.org/api/fs.html#fs_fs_mkdir_path_options_callback
- Added a testcase for clearAll ([#48](https://github.com/royriojas/flat-cache/issues/48)) - [45b51ca](https://github.com/royriojas/flat-cache/commit/45b51ca), [Aaron Chen](https://github.com/Aaron Chen), 21/05/2020 08:40:03
- requet node>=10 - [a5c482c](https://github.com/royriojas/flat-cache/commit/a5c482c), [yumetodo](https://github.com/yumetodo), 10/04/2020 23:14:53
thanks @SuperITMan
- Update README.md - [29fe40b](https://github.com/royriojas/flat-cache/commit/29fe40b), [Roy Riojas](https://github.com/Roy Riojas), 10/04/2020 20:08:05
- reduce vulnerability to 1 - [e9db1b2](https://github.com/royriojas/flat-cache/commit/e9db1b2), [yumetodo](https://github.com/yumetodo), 30/03/2020 11:10:43
- reduce vulnerabilities dependencies to 8 - [b58d196](https://github.com/royriojas/flat-cache/commit/b58d196), [yumetodo](https://github.com/yumetodo), 30/03/2020 10:54:56
- use prettier instead of esbeautifier - [03b1db7](https://github.com/royriojas/flat-cache/commit/03b1db7), [yumetodo](https://github.com/yumetodo), 30/03/2020 10:27:14
- update proxyquire - [c2f048d](https://github.com/royriojas/flat-cache/commit/c2f048d), [yumetodo](https://github.com/yumetodo), 30/03/2020 10:16:16
- update flatted and mocha - [a0e56da](https://github.com/royriojas/flat-cache/commit/a0e56da), [yumetodo](https://github.com/yumetodo), 30/03/2020 09:46:45
mocha > mkdirp is updated
istanble >>> optimist > minimist is not updated
- drop support node.js < 10 in develop - [beba691](https://github.com/royriojas/flat-cache/commit/beba691), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:31:09
see mkdirp
- npm aufit fix(still remains) - [ce166cb](https://github.com/royriojas/flat-cache/commit/ce166cb), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:18:08
37 vulnerabilities required manual review and could not be updated
- updtate sinon - [9f2d1b6](https://github.com/royriojas/flat-cache/commit/9f2d1b6), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:17:51
- apply eslint-plugin-mocha - [07343b5](https://github.com/royriojas/flat-cache/commit/07343b5), [yumetodo](https://github.com/yumetodo), 13/03/2020 22:17:21
- Less strint version check ([#44](https://github.com/royriojas/flat-cache/issues/44)) - [92aca1c](https://github.com/royriojas/flat-cache/commit/92aca1c), [Wojciech Maj](https://github.com/Wojciech Maj), 13/11/2019 16:18:25
- Use ^ version matching for production dependencies
- Run npm audit fix
- **Bug Fixes**
- update dependencies and use eslint directly - [73fbed2](https://github.com/royriojas/flat-cache/commit/73fbed2), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:17:27
## v2.0.1
- **Refactoring**
- upgrade node modules to latest versions - [6402ed3](https://github.com/royriojas/flat-cache/commit/6402ed3), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 18:47:05
## v2.0.0
- **Bug Fixes**
- upgrade package.json lock file - [8d21c7b](https://github.com/royriojas/flat-cache/commit/8d21c7b), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 17:03:13
- Use the same versions of node_js that eslint use - [8d23379](https://github.com/royriojas/flat-cache/commit/8d23379), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 16:25:11
- **Other changes**
- Replace circular-json with flatted ([#36](https://github.com/royriojas/flat-cache/issues/36)) - [b93aced](https://github.com/royriojas/flat-cache/commit/b93aced), [C. K. Tang](https://github.com/C. K. Tang), 08/01/2019 17:03:01
- Change JSON parser from circular-json to flatted & 1 more changes ([#37](https://github.com/royriojas/flat-cache/issues/37)) - [745e65a](https://github.com/royriojas/flat-cache/commit/745e65a), [Andy Chen](https://github.com/Andy Chen), 08/01/2019 16:17:20
- Change JSON parser from circular-json to flatted & 1 more changes
- Change JSON parser from circular-json
- Audited 2 vulnerabilities
- Update package.json
- Update Engine require
- There's a bunch of dependencies in this pkg requires node >=4, so I changed it to 4
- Remove and add node versions
- I have seen this pkg is not available with node 0.12 so I removed it
- I have added a popular used LTS version of node - 10
## v1.3.4
- **Refactoring**
- Add del.js and utils.js to the list of files to be beautified - [9d0ca9b](https://github.com/royriojas/flat-cache/commit/9d0ca9b), [Roy Riojas](https://github.com/Roy Riojas), 14/11/2018 12:19:02
## v1.3.3
- **Refactoring**
- Make sure package-lock.json is up to date - [a7d2598](https://github.com/royriojas/flat-cache/commit/a7d2598), [Roy Riojas](https://github.com/Roy Riojas), 14/11/2018 11:36:08
- **Other changes**
- Removed the need for del ([#33](https://github.com/royriojas/flat-cache/issues/33)) - [c429012](https://github.com/royriojas/flat-cache/commit/c429012), [S. Gilroy](https://github.com/S. Gilroy), 13/11/2018 13:56:37
- Removed the need for del
Removed the need for del as newer versions have broken backwards
compatibility. del mainly uses rimraf for deleting folders
and files, replaceing it with rimraf only is a minimal change.
- Disable glob on rimraf calls
- Added glob disable to wrong call
- Wrapped rimraf to simplify solution
## v1.3.2
- **Refactoring**
- remove yarn.lock file - [704c6c4](https://github.com/royriojas/flat-cache/commit/704c6c4), [Roy Riojas](https://github.com/Roy Riojas), 07/11/2018 15:41:08
- **Other changes**
- replace circular-json with flatted ([#23](https://github.com/royriojas/flat-cache/issues/23))" - [db12d74](https://github.com/royriojas/flat-cache/commit/db12d74), [Roy Riojas](https://github.com/Roy Riojas), 07/11/2018 15:40:39
This reverts commit 00f689277a75e85fef28e6a048fad227afc525e6.
## v1.3.1
- **Refactoring**
- upgrade deps to remove some security warnings - [f405719](https://github.com/royriojas/flat-cache/commit/f405719), [Roy Riojas](https://github.com/Roy Riojas), 06/11/2018 12:07:31
- **Bug Fixes**
- replace circular-json with flatted ([#23](https://github.com/royriojas/flat-cache/issues/23)) - [00f6892](https://github.com/royriojas/flat-cache/commit/00f6892), [Terry](https://github.com/Terry), 05/11/2018 18:44:16
- **Other changes**
- update del to v3.0.0 ([#26](https://github.com/royriojas/flat-cache/issues/26)) - [d42883f](https://github.com/royriojas/flat-cache/commit/d42883f), [Patrick Silva](https://github.com/Patrick Silva), 03/11/2018 01:00:44
Closes <a target="_blank" class="info-link" href="https://github.com/royriojas/flat-cache/issues/25"><span>#25</span></a>
## v1.3.0
- **Other changes**
- Added #all method ([#16](https://github.com/royriojas/flat-cache/issues/16)) - [12293be](https://github.com/royriojas/flat-cache/commit/12293be), [Ozair Patel](https://github.com/Ozair Patel), 25/09/2017 14:46:38
- Added #all method
- Added #all method test
- Updated readme
- Added yarn.lock
- Added more keys for #all test
- Beautified file
- fix changelog title style ([#14](https://github.com/royriojas/flat-cache/issues/14)) - [af8338a](https://github.com/royriojas/flat-cache/commit/af8338a), [前端小武](https://github.com/前端小武), 19/12/2016 20:34:48
## v1.2.2
- **Bug Fixes**
- Do not crash if cache file is invalid JSON. ([#13](https://github.com/royriojas/flat-cache/issues/13)) - [87beaa6](https://github.com/royriojas/flat-cache/commit/87beaa6), [Roy Riojas](https://github.com/Roy Riojas), 19/12/2016 18:03:35
Fixes <a target="_blank" class="info-link" href="https://github.com/royriojas/flat-cache/issues/12"><span>#12</span></a>
Not sure under which situations a cache file might exist that does
not contain a valid JSON structure, but just in case to cover
the possibility of this happening a try catch block has been added
If the cache is somehow not valid the cache will be discarded an a
a new cache will be stored instead
- **Other changes**
- Added travis ci support for modern node versions ([#11](https://github.com/royriojas/flat-cache/issues/11)) - [1c2b1f7](https://github.com/royriojas/flat-cache/commit/1c2b1f7), [Amila Welihinda](https://github.com/Amila Welihinda), 10/11/2016 23:47:52
- Bumping `circular-son` version ([#10](https://github.com/royriojas/flat-cache/issues/10)) - [4d5e861](https://github.com/royriojas/flat-cache/commit/4d5e861), [Andrea Giammarchi](https://github.com/Andrea Giammarchi), 02/08/2016 07:13:52
As mentioned in https://github.com/WebReflection/circular-json/issues/25 `circular-json` wan't rightly implementing the license field.
Latest version bump changed only that bit so that ESLint should now be happy.
## v1.2.1
- **Bug Fixes**
- Add missing utils.js file to the package. closes [#8](https://github.com/royriojas/flat-cache/issues/8) - [ec10cf2](https://github.com/royriojas/flat-cache/commit/ec10cf2), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 02:18:57
## v1.2.0
- **Documentation**
- Add documentation about noPrune option - [23e11f9](https://github.com/royriojas/flat-cache/commit/23e11f9), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 02:06:49
## v1.0.11
- **Features**
- Add noPrune option to cache.save() method. closes [#7](https://github.com/royriojas/flat-cache/issues/7) - [2c8016a](https://github.com/royriojas/flat-cache/commit/2c8016a), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 02:00:29
- Add json read and write utility based on circular-json - [c31081e](https://github.com/royriojas/flat-cache/commit/c31081e), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08:58:17
- **Bug Fixes**
- Remove UTF16 BOM stripping - [4a41e22](https://github.com/royriojas/flat-cache/commit/4a41e22), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 02:18:06
Since we control both writing and reading of JSON stream, there no needs
to handle unicode BOM.
- Use circular-json to handle circular references (fix [#5](https://github.com/royriojas/flat-cache/issues/5)) - [cd7aeed](https://github.com/royriojas/flat-cache/commit/cd7aeed), [Jean Ponchon](https://github.com/Jean Ponchon), 25/07/2016 11:11:59
- **Tests Related fixes**
- Add missing file from eslint test - [d6fa3c3](https://github.com/royriojas/flat-cache/commit/d6fa3c3), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 02:15:51
- Add test for circular json serialization / deserialization - [07d2ddd](https://github.com/royriojas/flat-cache/commit/07d2ddd), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08:59:36
- **Refactoring**
- Remove unused read-json-sync - [2be1c24](https://github.com/royriojas/flat-cache/commit/2be1c24), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08:59:18
- **Build Scripts Changes**
- travis tests on 0.12 and 4x - [3a613fd](https://github.com/royriojas/flat-cache/commit/3a613fd), [royriojas](https://github.com/royriojas), 15/11/2015 14:34:40
## v1.0.10
- **Build Scripts Changes**
- add eslint-fix task - [fd29e52](https://github.com/royriojas/flat-cache/commit/fd29e52), [royriojas](https://github.com/royriojas), 01/11/2015 15:04:08
- make sure the test script also verify beautification and linting of files before running tests - [e94e176](https://github.com/royriojas/flat-cache/commit/e94e176), [royriojas](https://github.com/royriojas), 01/11/2015 11:54:48
- **Other changes**
- add clearAll for cacheDir - [97383d9](https://github.com/royriojas/flat-cache/commit/97383d9), [xieyaowu](https://github.com/xieyaowu), 31/10/2015 21:02:18
## v1.0.9
- **Bug Fixes**
- wrong default values for changelogx user repo name - [7bb52d1](https://github.com/royriojas/flat-cache/commit/7bb52d1), [royriojas](https://github.com/royriojas), 11/09/2015 15:59:30
## v1.0.8
- **Build Scripts Changes**
- test against node 4 - [c395b66](https://github.com/royriojas/flat-cache/commit/c395b66), [royriojas](https://github.com/royriojas), 11/09/2015 15:51:39
## v1.0.7
- **Other changes**
- Move dependencies into devDep - [7e47099](https://github.com/royriojas/flat-cache/commit/7e47099), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 15:10:57
- **Documentation**
- Add missing changelog link - [f51197a](https://github.com/royriojas/flat-cache/commit/f51197a), [royriojas](https://github.com/royriojas), 11/09/2015 14:48:05
## v1.0.6
- **Build Scripts Changes**
- Add helpers/code check scripts - [bdb82f3](https://github.com/royriojas/flat-cache/commit/bdb82f3), [royriojas](https://github.com/royriojas), 11/09/2015 14:44:31
## v1.0.5
- **Documentation**
- better description for the module - [436817f](https://github.com/royriojas/flat-cache/commit/436817f), [royriojas](https://github.com/royriojas), 11/09/2015 14:35:33
- **Other changes**
- Update dependencies - [be88aa3](https://github.com/royriojas/flat-cache/commit/be88aa3), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 13:47:41
## v1.0.4
- **Refactoring**
- load a cache file using the full filepath - [b8f68c2](https://github.com/royriojas/flat-cache/commit/b8f68c2), [Roy Riojas](https://github.com/Roy Riojas), 30/08/2015 04:19:14
- **Documentation**
- Add documentation about `clearAll` and `clearCacheById` - [13947c1](https://github.com/royriojas/flat-cache/commit/13947c1), [Roy Riojas](https://github.com/Roy Riojas), 01/03/2015 23:44:05
- **Features**
- Add methods to remove the cache documents created - [af40443](https://github.com/royriojas/flat-cache/commit/af40443), [Roy Riojas](https://github.com/Roy Riojas), 01/03/2015 23:39:27
## v1.0.1
- **Other changes**
- Update README.md - [c2b6805](https://github.com/royriojas/flat-cache/commit/c2b6805), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 04:28:07
## v1.0.0
- **Refactoring**
- flat-cache v.1.0.0 - [c984274](https://github.com/royriojas/flat-cache/commit/c984274), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 04:11:50
- **Other changes**
- Initial commit - [d43cccf](https://github.com/royriojas/flat-cache/commit/d43cccf), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 01:12:16

View File

@@ -0,0 +1,15 @@
var test = require('tape');
var equal = require('../');
test('0 values', function (t) {
t.ok(equal( 0, 0), ' 0 === 0');
t.ok(equal( 0, +0), ' 0 === +0');
t.ok(equal(+0, +0), '+0 === +0');
t.ok(equal(-0, -0), '-0 === -0');
t.notOk(equal(-0, 0), '-0 !== 0');
t.notOk(equal(-0, +0), '-0 !== +0');
t.end();
});

View File

@@ -0,0 +1 @@
module.exports={C:{"52":0.02191,"60":0.00548,"68":0.00548,"78":0.02191,"83":0.01095,"88":0.00548,"91":0.00548,"95":0.01643,"100":0.00548,"102":0.00548,"109":0.00548,"113":0.03834,"115":0.77773,"116":0.00548,"120":0.00548,"122":0.01643,"125":0.00548,"126":0.01095,"127":0.01643,"128":0.1424,"129":0.00548,"130":0.00548,"131":0.01095,"132":0.11502,"133":0.02739,"134":0.16979,"135":1.45688,"136":5.43866,"137":0.00548,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 61 62 63 64 65 66 67 69 70 71 72 73 74 75 76 77 79 80 81 82 84 85 86 87 89 90 92 93 94 96 97 98 99 101 103 104 105 106 107 108 110 111 112 114 117 118 119 121 123 124 138 139 140 3.5 3.6"},D:{"49":0.01095,"58":0.01095,"60":0.00548,"67":0.01095,"79":0.02191,"85":0.00548,"87":0.03834,"88":0.00548,"91":0.03834,"92":0.00548,"98":0.03834,"100":0.01643,"101":0.00548,"103":0.02191,"105":0.00548,"106":0.00548,"108":0.00548,"109":1.57738,"110":0.00548,"111":0.03286,"112":0.01643,"114":0.01643,"115":0.00548,"116":0.2136,"117":0.05477,"118":0.03286,"119":0.04382,"120":0.04929,"121":0.03834,"122":0.08216,"123":0.08763,"124":0.15883,"125":0.03286,"126":0.07668,"127":0.03286,"128":0.09311,"129":0.0712,"130":0.10406,"131":0.68463,"132":0.66272,"133":8.97133,"134":19.73363,"135":0.01095,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 56 57 59 61 62 63 64 65 66 68 69 70 71 72 73 74 75 76 77 78 80 81 83 84 86 89 90 93 94 95 96 97 99 102 104 107 113 136 137 138"},F:{"46":0.03286,"87":0.00548,"95":0.04929,"114":0.00548,"116":0.34505,"117":1.37473,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 88 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"85":0.01095,"92":0.00548,"107":0.01095,"108":0.00548,"109":0.08763,"111":0.00548,"118":0.00548,"119":0.05477,"120":0.00548,"122":0.00548,"124":0.00548,"125":0.00548,"126":0.01095,"127":0.00548,"128":0.01095,"129":0.01095,"130":0.02739,"131":0.04929,"132":0.07668,"133":1.86218,"134":4.22824,_:"12 13 14 15 16 17 18 79 80 81 83 84 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 110 112 113 114 115 116 117 121 123"},E:{"14":0.01095,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1","13.1":0.01643,"14.1":0.05477,"15.2-15.3":0.00548,"15.4":0.00548,"15.5":0.01095,"15.6":0.09311,"16.0":0.01643,"16.1":0.01643,"16.2":0.02739,"16.3":0.06025,"16.4":0.00548,"16.5":0.01643,"16.6":0.15883,"17.0":0.02191,"17.1":0.06025,"17.2":0.01643,"17.3":0.01643,"17.4":0.06572,"17.5":0.13145,"17.6":0.21908,"18.0":0.10406,"18.1":0.08763,"18.2":0.06025,"18.3":1.42402,"18.4":0.02739},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00218,"5.0-5.1":0,"6.0-6.1":0.00655,"7.0-7.1":0.00437,"8.1-8.4":0,"9.0-9.2":0.00328,"9.3":0.01529,"10.0-10.2":0.00109,"10.3":0.02511,"11.0-11.2":0.11574,"11.3-11.4":0.00764,"12.0-12.1":0.00437,"12.2-12.5":0.10809,"13.0-13.1":0.00218,"13.2":0.00328,"13.3":0.00437,"13.4-13.7":0.01529,"14.0-14.4":0.03821,"14.5-14.8":0.04586,"15.0-15.1":0.02511,"15.2-15.3":0.02511,"15.4":0.03057,"15.5":0.03494,"15.6-15.8":0.43019,"16.0":0.06114,"16.1":0.12556,"16.2":0.06551,"16.3":0.11355,"16.4":0.02511,"16.5":0.04695,"16.6-16.7":0.50989,"17.0":0.03057,"17.1":0.05459,"17.2":0.04149,"17.3":0.05787,"17.4":0.11574,"17.5":0.25768,"17.6-17.7":0.74792,"18.0":0.20964,"18.1":0.68568,"18.2":0.30681,"18.3":6.41245,"18.4":0.09499},P:{"4":0.11431,"20":0.01039,"21":0.01039,"22":0.02078,"23":0.02078,"24":0.08313,"25":0.03117,"26":0.06235,"27":2.88882,_:"5.0-5.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 16.0 17.0 18.0 19.0","6.2-6.4":0.01039,"7.2-7.4":0.02078,"15.0":0.01039},I:{"0":0.03611,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00004},K:{"0":0.24424,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00548,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.48848},Q:{_:"14.9"},O:{"0":0.00905},H:{"0":0},L:{"0":30.89988}};