update
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "inherits",
|
||||
"description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
|
||||
"version": "2.0.4",
|
||||
"keywords": [
|
||||
"inheritance",
|
||||
"class",
|
||||
"klass",
|
||||
"oop",
|
||||
"object-oriented",
|
||||
"inherits",
|
||||
"browser",
|
||||
"browserify"
|
||||
],
|
||||
"main": "./inherits.js",
|
||||
"browser": "./inherits_browser.js",
|
||||
"repository": "git://github.com/isaacs/inherits",
|
||||
"license": "ISC",
|
||||
"scripts": {
|
||||
"test": "tap"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tap": "^14.2.4"
|
||||
},
|
||||
"files": [
|
||||
"inherits.js",
|
||||
"inherits_browser.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,283 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ExportAllDeclaration = ExportAllDeclaration;
|
||||
exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
|
||||
exports.ExportDefaultSpecifier = ExportDefaultSpecifier;
|
||||
exports.ExportNamedDeclaration = ExportNamedDeclaration;
|
||||
exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier;
|
||||
exports.ExportSpecifier = ExportSpecifier;
|
||||
exports.ImportAttribute = ImportAttribute;
|
||||
exports.ImportDeclaration = ImportDeclaration;
|
||||
exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
|
||||
exports.ImportExpression = ImportExpression;
|
||||
exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
|
||||
exports.ImportSpecifier = ImportSpecifier;
|
||||
exports._printAttributes = _printAttributes;
|
||||
var _t = require("@babel/types");
|
||||
var _index = require("../node/index.js");
|
||||
const {
|
||||
isClassDeclaration,
|
||||
isExportDefaultSpecifier,
|
||||
isExportNamespaceSpecifier,
|
||||
isImportDefaultSpecifier,
|
||||
isImportNamespaceSpecifier,
|
||||
isStatement
|
||||
} = _t;
|
||||
function ImportSpecifier(node) {
|
||||
if (node.importKind === "type" || node.importKind === "typeof") {
|
||||
this.word(node.importKind);
|
||||
this.space();
|
||||
}
|
||||
this.print(node.imported);
|
||||
if (node.local && node.local.name !== node.imported.name) {
|
||||
this.space();
|
||||
this.word("as");
|
||||
this.space();
|
||||
this.print(node.local);
|
||||
}
|
||||
}
|
||||
function ImportDefaultSpecifier(node) {
|
||||
this.print(node.local);
|
||||
}
|
||||
function ExportDefaultSpecifier(node) {
|
||||
this.print(node.exported);
|
||||
}
|
||||
function ExportSpecifier(node) {
|
||||
if (node.exportKind === "type") {
|
||||
this.word("type");
|
||||
this.space();
|
||||
}
|
||||
this.print(node.local);
|
||||
if (node.exported && node.local.name !== node.exported.name) {
|
||||
this.space();
|
||||
this.word("as");
|
||||
this.space();
|
||||
this.print(node.exported);
|
||||
}
|
||||
}
|
||||
function ExportNamespaceSpecifier(node) {
|
||||
this.tokenChar(42);
|
||||
this.space();
|
||||
this.word("as");
|
||||
this.space();
|
||||
this.print(node.exported);
|
||||
}
|
||||
let warningShown = false;
|
||||
function _printAttributes(node, hasPreviousBrace) {
|
||||
var _node$extra;
|
||||
const {
|
||||
importAttributesKeyword
|
||||
} = this.format;
|
||||
const {
|
||||
attributes,
|
||||
assertions
|
||||
} = node;
|
||||
if (attributes && !importAttributesKeyword && node.extra && (node.extra.deprecatedAssertSyntax || node.extra.deprecatedWithLegacySyntax) && !warningShown) {
|
||||
warningShown = true;
|
||||
console.warn(`\
|
||||
You are using import attributes, without specifying the desired output syntax.
|
||||
Please specify the "importAttributesKeyword" generator option, whose value can be one of:
|
||||
- "with" : \`import { a } from "b" with { type: "json" };\`
|
||||
- "assert" : \`import { a } from "b" assert { type: "json" };\`
|
||||
- "with-legacy" : \`import { a } from "b" with type: "json";\`
|
||||
`);
|
||||
}
|
||||
const useAssertKeyword = importAttributesKeyword === "assert" || !importAttributesKeyword && assertions;
|
||||
this.word(useAssertKeyword ? "assert" : "with");
|
||||
this.space();
|
||||
if (!useAssertKeyword && (importAttributesKeyword === "with-legacy" || !importAttributesKeyword && (_node$extra = node.extra) != null && _node$extra.deprecatedWithLegacySyntax)) {
|
||||
this.printList(attributes || assertions);
|
||||
return;
|
||||
}
|
||||
const occurrenceCount = hasPreviousBrace ? 1 : 0;
|
||||
this.token("{", null, occurrenceCount);
|
||||
this.space();
|
||||
this.printList(attributes || assertions, this.shouldPrintTrailingComma("}"));
|
||||
this.space();
|
||||
this.token("}", null, occurrenceCount);
|
||||
}
|
||||
function ExportAllDeclaration(node) {
|
||||
var _node$attributes, _node$assertions;
|
||||
this.word("export");
|
||||
this.space();
|
||||
if (node.exportKind === "type") {
|
||||
this.word("type");
|
||||
this.space();
|
||||
}
|
||||
this.tokenChar(42);
|
||||
this.space();
|
||||
this.word("from");
|
||||
this.space();
|
||||
if ((_node$attributes = node.attributes) != null && _node$attributes.length || (_node$assertions = node.assertions) != null && _node$assertions.length) {
|
||||
this.print(node.source, true);
|
||||
this.space();
|
||||
this._printAttributes(node, false);
|
||||
} else {
|
||||
this.print(node.source);
|
||||
}
|
||||
this.semicolon();
|
||||
}
|
||||
function maybePrintDecoratorsBeforeExport(printer, node) {
|
||||
if (isClassDeclaration(node.declaration) && printer._shouldPrintDecoratorsBeforeExport(node)) {
|
||||
printer.printJoin(node.declaration.decorators);
|
||||
}
|
||||
}
|
||||
function ExportNamedDeclaration(node) {
|
||||
maybePrintDecoratorsBeforeExport(this, node);
|
||||
this.word("export");
|
||||
this.space();
|
||||
if (node.declaration) {
|
||||
const declar = node.declaration;
|
||||
this.print(declar);
|
||||
if (!isStatement(declar)) this.semicolon();
|
||||
} else {
|
||||
if (node.exportKind === "type") {
|
||||
this.word("type");
|
||||
this.space();
|
||||
}
|
||||
const specifiers = node.specifiers.slice(0);
|
||||
let hasSpecial = false;
|
||||
for (;;) {
|
||||
const first = specifiers[0];
|
||||
if (isExportDefaultSpecifier(first) || isExportNamespaceSpecifier(first)) {
|
||||
hasSpecial = true;
|
||||
this.print(specifiers.shift());
|
||||
if (specifiers.length) {
|
||||
this.tokenChar(44);
|
||||
this.space();
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
let hasBrace = false;
|
||||
if (specifiers.length || !specifiers.length && !hasSpecial) {
|
||||
hasBrace = true;
|
||||
this.tokenChar(123);
|
||||
if (specifiers.length) {
|
||||
this.space();
|
||||
this.printList(specifiers, this.shouldPrintTrailingComma("}"));
|
||||
this.space();
|
||||
}
|
||||
this.tokenChar(125);
|
||||
}
|
||||
if (node.source) {
|
||||
var _node$attributes2, _node$assertions2;
|
||||
this.space();
|
||||
this.word("from");
|
||||
this.space();
|
||||
if ((_node$attributes2 = node.attributes) != null && _node$attributes2.length || (_node$assertions2 = node.assertions) != null && _node$assertions2.length) {
|
||||
this.print(node.source, true);
|
||||
this.space();
|
||||
this._printAttributes(node, hasBrace);
|
||||
} else {
|
||||
this.print(node.source);
|
||||
}
|
||||
}
|
||||
this.semicolon();
|
||||
}
|
||||
}
|
||||
function ExportDefaultDeclaration(node) {
|
||||
maybePrintDecoratorsBeforeExport(this, node);
|
||||
this.word("export");
|
||||
this.noIndentInnerCommentsHere();
|
||||
this.space();
|
||||
this.word("default");
|
||||
this.space();
|
||||
this.tokenContext |= _index.TokenContext.exportDefault;
|
||||
const declar = node.declaration;
|
||||
this.print(declar);
|
||||
if (!isStatement(declar)) this.semicolon();
|
||||
}
|
||||
function ImportDeclaration(node) {
|
||||
var _node$attributes3, _node$assertions3;
|
||||
this.word("import");
|
||||
this.space();
|
||||
const isTypeKind = node.importKind === "type" || node.importKind === "typeof";
|
||||
if (isTypeKind) {
|
||||
this.noIndentInnerCommentsHere();
|
||||
this.word(node.importKind);
|
||||
this.space();
|
||||
} else if (node.module) {
|
||||
this.noIndentInnerCommentsHere();
|
||||
this.word("module");
|
||||
this.space();
|
||||
} else if (node.phase) {
|
||||
this.noIndentInnerCommentsHere();
|
||||
this.word(node.phase);
|
||||
this.space();
|
||||
}
|
||||
const specifiers = node.specifiers.slice(0);
|
||||
const hasSpecifiers = !!specifiers.length;
|
||||
while (hasSpecifiers) {
|
||||
const first = specifiers[0];
|
||||
if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) {
|
||||
this.print(specifiers.shift());
|
||||
if (specifiers.length) {
|
||||
this.tokenChar(44);
|
||||
this.space();
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
let hasBrace = false;
|
||||
if (specifiers.length) {
|
||||
hasBrace = true;
|
||||
this.tokenChar(123);
|
||||
this.space();
|
||||
this.printList(specifiers, this.shouldPrintTrailingComma("}"));
|
||||
this.space();
|
||||
this.tokenChar(125);
|
||||
} else if (isTypeKind && !hasSpecifiers) {
|
||||
hasBrace = true;
|
||||
this.tokenChar(123);
|
||||
this.tokenChar(125);
|
||||
}
|
||||
if (hasSpecifiers || isTypeKind) {
|
||||
this.space();
|
||||
this.word("from");
|
||||
this.space();
|
||||
}
|
||||
if ((_node$attributes3 = node.attributes) != null && _node$attributes3.length || (_node$assertions3 = node.assertions) != null && _node$assertions3.length) {
|
||||
this.print(node.source, true);
|
||||
this.space();
|
||||
this._printAttributes(node, hasBrace);
|
||||
} else {
|
||||
this.print(node.source);
|
||||
}
|
||||
this.semicolon();
|
||||
}
|
||||
function ImportAttribute(node) {
|
||||
this.print(node.key);
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
this.print(node.value);
|
||||
}
|
||||
function ImportNamespaceSpecifier(node) {
|
||||
this.tokenChar(42);
|
||||
this.space();
|
||||
this.word("as");
|
||||
this.space();
|
||||
this.print(node.local);
|
||||
}
|
||||
function ImportExpression(node) {
|
||||
this.word("import");
|
||||
if (node.phase) {
|
||||
this.tokenChar(46);
|
||||
this.word(node.phase);
|
||||
}
|
||||
this.tokenChar(40);
|
||||
this.print(node.source);
|
||||
if (node.options != null) {
|
||||
this.tokenChar(44);
|
||||
this.space();
|
||||
this.print(node.options);
|
||||
}
|
||||
this.tokenChar(41);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=modules.js.map
|
||||
@@ -0,0 +1,10 @@
|
||||
import { URISchemeHandler, URIComponents, URIOptions } from "../uri";
|
||||
export interface URNComponents extends URIComponents {
|
||||
nid?: string;
|
||||
nss?: string;
|
||||
}
|
||||
export interface URNOptions extends URIOptions {
|
||||
nid?: string;
|
||||
}
|
||||
declare const handler: URISchemeHandler<URNComponents, URNOptions>;
|
||||
export default handler;
|
||||
@@ -0,0 +1,9 @@
|
||||
export default class Ref {
|
||||
num: number;
|
||||
gen: number;
|
||||
constructor({ num, gen }: {
|
||||
num: number;
|
||||
gen: number;
|
||||
});
|
||||
toString(): string;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},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","2":"C L M G N O P"},C:{"1":"0 9 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 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 qC rC"},D:{"1":"0 9 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":"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","194":"rB sB tB uB vB MC wB NC xB yB"},E:{"1":"M G 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 GC","66":"L"},F:{"1":"0 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":"1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB 4C 5C 6C 7C FC kC 8C GC","194":"eB fB gB hB iB jB kB lB mB nB oB"},G:{"1":"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":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D 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 hD TC iD jD kD lD mD IC JC KC nD","2":"J dD eD fD gD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"rD","2":"qD"}},B:5,C:"Resize Observer",D:true};
|
||||
@@ -0,0 +1,270 @@
|
||||
/**
|
||||
* @fileoverview Rule to replace assignment expressions with operator assignment
|
||||
* @author Brandon Mills
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Requirements
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const astUtils = require("./utils/ast-utils");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Checks whether an operator is commutative and has an operator assignment
|
||||
* shorthand form.
|
||||
* @param {string} operator Operator to check.
|
||||
* @returns {boolean} True if the operator is commutative and has a
|
||||
* shorthand form.
|
||||
*/
|
||||
function isCommutativeOperatorWithShorthand(operator) {
|
||||
return ["*", "&", "^", "|"].includes(operator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether an operator is not commutative and has an operator assignment
|
||||
* shorthand form.
|
||||
* @param {string} operator Operator to check.
|
||||
* @returns {boolean} True if the operator is not commutative and has
|
||||
* a shorthand form.
|
||||
*/
|
||||
function isNonCommutativeOperatorWithShorthand(operator) {
|
||||
return ["+", "-", "/", "%", "<<", ">>", ">>>", "**"].includes(operator);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Determines if the left side of a node can be safely fixed (i.e. if it activates the same getters/setters and)
|
||||
* toString calls regardless of whether assignment shorthand is used)
|
||||
* @param {ASTNode} node The node on the left side of the expression
|
||||
* @returns {boolean} `true` if the node can be fixed
|
||||
*/
|
||||
function canBeFixed(node) {
|
||||
return (
|
||||
node.type === "Identifier" ||
|
||||
(node.type === "MemberExpression" &&
|
||||
(node.object.type === "Identifier" ||
|
||||
node.object.type === "ThisExpression") &&
|
||||
(!node.computed || node.property.type === "Literal"))
|
||||
);
|
||||
}
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
|
||||
defaultOptions: ["always"],
|
||||
|
||||
docs: {
|
||||
description:
|
||||
"Require or disallow assignment operator shorthand where possible",
|
||||
recommended: false,
|
||||
frozen: true,
|
||||
url: "https://eslint.org/docs/latest/rules/operator-assignment",
|
||||
},
|
||||
|
||||
schema: [
|
||||
{
|
||||
enum: ["always", "never"],
|
||||
},
|
||||
],
|
||||
|
||||
fixable: "code",
|
||||
messages: {
|
||||
replaced:
|
||||
"Assignment (=) can be replaced with operator assignment ({{operator}}).",
|
||||
unexpected:
|
||||
"Unexpected operator assignment ({{operator}}) shorthand.",
|
||||
},
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const never = context.options[0] === "never";
|
||||
const sourceCode = context.sourceCode;
|
||||
|
||||
/**
|
||||
* Returns the operator token of an AssignmentExpression or BinaryExpression
|
||||
* @param {ASTNode} node An AssignmentExpression or BinaryExpression node
|
||||
* @returns {Token} The operator token in the node
|
||||
*/
|
||||
function getOperatorToken(node) {
|
||||
return sourceCode.getFirstTokenBetween(
|
||||
node.left,
|
||||
node.right,
|
||||
token => token.value === node.operator,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that an assignment uses the shorthand form where possible.
|
||||
* @param {ASTNode} node An AssignmentExpression node.
|
||||
* @returns {void}
|
||||
*/
|
||||
function verify(node) {
|
||||
if (
|
||||
node.operator !== "=" ||
|
||||
node.right.type !== "BinaryExpression"
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const left = node.left;
|
||||
const expr = node.right;
|
||||
const operator = expr.operator;
|
||||
|
||||
if (
|
||||
isCommutativeOperatorWithShorthand(operator) ||
|
||||
isNonCommutativeOperatorWithShorthand(operator)
|
||||
) {
|
||||
const replacementOperator = `${operator}=`;
|
||||
|
||||
if (astUtils.isSameReference(left, expr.left, true)) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "replaced",
|
||||
data: { operator: replacementOperator },
|
||||
fix(fixer) {
|
||||
if (canBeFixed(left) && canBeFixed(expr.left)) {
|
||||
const equalsToken = getOperatorToken(node);
|
||||
const operatorToken = getOperatorToken(expr);
|
||||
const leftText = sourceCode
|
||||
.getText()
|
||||
.slice(node.range[0], equalsToken.range[0]);
|
||||
const rightText = sourceCode
|
||||
.getText()
|
||||
.slice(
|
||||
operatorToken.range[1],
|
||||
node.right.range[1],
|
||||
);
|
||||
|
||||
// Check for comments that would be removed.
|
||||
if (
|
||||
sourceCode.commentsExistBetween(
|
||||
equalsToken,
|
||||
operatorToken,
|
||||
)
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return fixer.replaceText(
|
||||
node,
|
||||
`${leftText}${replacementOperator}${rightText}`,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
});
|
||||
} else if (
|
||||
astUtils.isSameReference(left, expr.right, true) &&
|
||||
isCommutativeOperatorWithShorthand(operator)
|
||||
) {
|
||||
/*
|
||||
* This case can't be fixed safely.
|
||||
* If `a` and `b` both have custom valueOf() behavior, then fixing `a = b * a` to `a *= b` would
|
||||
* change the execution order of the valueOf() functions.
|
||||
*/
|
||||
context.report({
|
||||
node,
|
||||
messageId: "replaced",
|
||||
data: { operator: replacementOperator },
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Warns if an assignment expression uses operator assignment shorthand.
|
||||
* @param {ASTNode} node An AssignmentExpression node.
|
||||
* @returns {void}
|
||||
*/
|
||||
function prohibit(node) {
|
||||
if (
|
||||
node.operator !== "=" &&
|
||||
!astUtils.isLogicalAssignmentOperator(node.operator)
|
||||
) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "unexpected",
|
||||
data: { operator: node.operator },
|
||||
fix(fixer) {
|
||||
if (canBeFixed(node.left)) {
|
||||
const firstToken = sourceCode.getFirstToken(node);
|
||||
const operatorToken = getOperatorToken(node);
|
||||
const leftText = sourceCode
|
||||
.getText()
|
||||
.slice(node.range[0], operatorToken.range[0]);
|
||||
const newOperator = node.operator.slice(0, -1);
|
||||
let rightText;
|
||||
|
||||
// Check for comments that would be duplicated.
|
||||
if (
|
||||
sourceCode.commentsExistBetween(
|
||||
firstToken,
|
||||
operatorToken,
|
||||
)
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// If this change would modify precedence (e.g. `foo *= bar + 1` => `foo = foo * (bar + 1)`), parenthesize the right side.
|
||||
if (
|
||||
astUtils.getPrecedence(node.right) <=
|
||||
astUtils.getPrecedence({
|
||||
type: "BinaryExpression",
|
||||
operator: newOperator,
|
||||
}) &&
|
||||
!astUtils.isParenthesised(
|
||||
sourceCode,
|
||||
node.right,
|
||||
)
|
||||
) {
|
||||
rightText = `${sourceCode.text.slice(operatorToken.range[1], node.right.range[0])}(${sourceCode.getText(node.right)})`;
|
||||
} else {
|
||||
const tokenAfterOperator =
|
||||
sourceCode.getTokenAfter(operatorToken, {
|
||||
includeComments: true,
|
||||
});
|
||||
let rightTextPrefix = "";
|
||||
|
||||
if (
|
||||
operatorToken.range[1] ===
|
||||
tokenAfterOperator.range[0] &&
|
||||
!astUtils.canTokensBeAdjacent(
|
||||
{
|
||||
type: "Punctuator",
|
||||
value: newOperator,
|
||||
},
|
||||
tokenAfterOperator,
|
||||
)
|
||||
) {
|
||||
rightTextPrefix = " "; // foo+=+bar -> foo= foo+ +bar
|
||||
}
|
||||
|
||||
rightText = `${rightTextPrefix}${sourceCode.text.slice(operatorToken.range[1], node.range[1])}`;
|
||||
}
|
||||
|
||||
return fixer.replaceText(
|
||||
node,
|
||||
`${leftText}= ${leftText}${newOperator}${rightText}`,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
AssignmentExpression: !never ? verify : prohibit,
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.TargetNames = void 0;
|
||||
const TargetNames = exports.TargetNames = {
|
||||
node: "node",
|
||||
deno: "deno",
|
||||
chrome: "chrome",
|
||||
opera: "opera",
|
||||
edge: "edge",
|
||||
firefox: "firefox",
|
||||
safari: "safari",
|
||||
ie: "ie",
|
||||
ios: "ios",
|
||||
android: "android",
|
||||
electron: "electron",
|
||||
samsung: "samsung",
|
||||
rhino: "rhino",
|
||||
opera_mobile: "opera_mobile"
|
||||
};
|
||||
|
||||
//# sourceMappingURL=options.js.map
|
||||
@@ -0,0 +1,5 @@
|
||||
import { NoInfer, PickOptional } from './utils.cjs';
|
||||
import { SearchMiddleware } from './route.cjs';
|
||||
import { IsRequiredParams } from './link.cjs';
|
||||
export declare function retainSearchParams<TSearchSchema extends object>(keys: Array<keyof TSearchSchema> | true): SearchMiddleware<TSearchSchema>;
|
||||
export declare function stripSearchParams<TSearchSchema, TOptionalProps = PickOptional<NoInfer<TSearchSchema>>, const TValues = Partial<NoInfer<TOptionalProps>> | Array<keyof TOptionalProps>, const TInput = IsRequiredParams<TSearchSchema> extends never ? TValues | true : TValues>(input: NoInfer<TInput>): SearchMiddleware<TSearchSchema>;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E mC","8":"F","292":"A B"},B:{"1":"0 9 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","292":"C L M G"},C:{"1":"0 9 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 J PB K D E F A B C L M G N O P qC rC","8":"1 2 3 4 5 6 7 8 QB RB SB TB UB VB WB XB YB ZB aB bB cB","584":"dB eB fB gB hB iB jB kB lB mB nB oB","1025":"pB qB"},D:{"1":"0 9 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":"1 2 3 4 5 J PB K D E F A B C L M G N O P QB","8":"6 7 8 RB","200":"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","1025":"uB"},E:{"1":"B C L M G 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","2":"J PB sC SC tC","8":"K D E F A uC vC wC"},F:{"1":"0 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":"1 2 3 4 5 6 7 8 F B C G N O P QB 4C 5C 6C 7C FC kC 8C GC","200":"RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB"},G:{"1":"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","2":"SC 9C lC AD","8":"E BD CD DD ED FD GD"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD","8":"lC bD cD"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"292":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 eD fD gD hD TC iD jD kD lD mD IC JC KC nD","2":"dD","8":"J"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"qD rD"}},B:4,C:"CSS Grid Layout (level 1)",D:true};
|
||||
@@ -0,0 +1,30 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { pdfjs, Document, Outline, Page, Thumbnail } from './index.js';
|
||||
|
||||
describe('default entry', () => {
|
||||
describe('has pdfjs exported properly', () => {
|
||||
it('has pdfjs.version exported properly', () => {
|
||||
expect(typeof pdfjs.version).toBe('string');
|
||||
});
|
||||
|
||||
it('has GlobalWorkerOptions exported properly', () => {
|
||||
expect(typeof pdfjs.GlobalWorkerOptions).toBe('function');
|
||||
});
|
||||
});
|
||||
|
||||
it('has Document exported properly', () => {
|
||||
expect(Document).toBeInstanceOf(Object);
|
||||
});
|
||||
|
||||
it('has Outline exported properly', () => {
|
||||
expect(Outline).toBeInstanceOf(Object);
|
||||
});
|
||||
|
||||
it('has Page exported properly', () => {
|
||||
expect(Page).toBeInstanceOf(Object);
|
||||
});
|
||||
|
||||
it('has Thumbnail exported properly', () => {
|
||||
expect(Thumbnail).toBeInstanceOf(Object);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
const{parse:t,stringify:e}=JSON,{keys:n}=Object,l=String,o="string",r={},s="object",c=(t,e)=>e,a=t=>t instanceof l?l(t):t,f=(t,e)=>typeof e===o?new l(e):e,i=(t,e,o,c)=>{const a=[];for(let f=n(o),{length:i}=f,p=0;p<i;p++){const n=f[p],i=o[n];if(i instanceof l){const l=t[i];typeof l!==s||e.has(l)?o[n]=c.call(o,n,l):(e.add(l),o[n]=r,a.push({k:n,a:[t,e,l,c]}))}else o[n]!==r&&(o[n]=c.call(o,n,i))}for(let{length:t}=a,e=0;e<t;e++){const{k:t,a:n}=a[e];o[t]=c.call(o,t,i.apply(null,n))}return o},p=(t,e,n)=>{const o=l(e.push(n)-1);return t.set(n,o),o},u=(e,n)=>{const l=t(e,f).map(a),o=l[0],r=n||c,p=typeof o===s&&o?i(l,new Set,o,r):o;return r.call({"":p},"",p)},h=(t,n,l)=>{const r=n&&typeof n===s?(t,e)=>""===t||-1<n.indexOf(t)?e:void 0:n||c,a=new Map,f=[],i=[];let u=+p(a,f,r.call({"":t},"",t)),h=!u;for(;u<f.length;)h=!0,i[u]=e(f[u++],y,l);return"["+i.join(",")+"]";function y(t,e){if(h)return h=!h,e;const n=r.call(this,t,e);switch(typeof n){case s:if(null===n)return n;case o:return a.get(n)||p(a,f,n)}return n}},y=e=>t(h(e)),g=t=>u(e(t));export{g as fromJSON,u as parse,h as stringify,y as toJSON};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
// https://nodejs.org/api/module.html#moduleregisterspecifier-parenturl-options
|
||||
import { register } from "node:module";
|
||||
|
||||
register("./jiti-hooks.mjs", import.meta.url, {});
|
||||
@@ -0,0 +1,163 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isLocalFileSystem = exports.isBrowser = void 0;
|
||||
exports.isDefined = isDefined;
|
||||
exports.isProvided = isProvided;
|
||||
exports.isString = isString;
|
||||
exports.isArrayBuffer = isArrayBuffer;
|
||||
exports.isBlob = isBlob;
|
||||
exports.isDataURI = isDataURI;
|
||||
exports.dataURItoByteString = dataURItoByteString;
|
||||
exports.getDevicePixelRatio = getDevicePixelRatio;
|
||||
exports.displayCORSWarning = displayCORSWarning;
|
||||
exports.displayWorkerWarning = displayWorkerWarning;
|
||||
exports.cancelRunningTask = cancelRunningTask;
|
||||
exports.makePageCallback = makePageCallback;
|
||||
exports.isCancelException = isCancelException;
|
||||
exports.loadFromFile = loadFromFile;
|
||||
const tiny_invariant_1 = __importDefault(require("tiny-invariant"));
|
||||
const warning_1 = __importDefault(require("warning"));
|
||||
/**
|
||||
* Checks if we're running in a browser environment.
|
||||
*/
|
||||
exports.isBrowser = typeof window !== 'undefined';
|
||||
/**
|
||||
* Checks whether we're running from a local file system.
|
||||
*/
|
||||
exports.isLocalFileSystem = exports.isBrowser && window.location.protocol === 'file:';
|
||||
/**
|
||||
* Checks whether a variable is defined.
|
||||
*
|
||||
* @param {*} variable Variable to check
|
||||
*/
|
||||
function isDefined(variable) {
|
||||
return typeof variable !== 'undefined';
|
||||
}
|
||||
/**
|
||||
* Checks whether a variable is defined and not null.
|
||||
*
|
||||
* @param {*} variable Variable to check
|
||||
*/
|
||||
function isProvided(variable) {
|
||||
return isDefined(variable) && variable !== null;
|
||||
}
|
||||
/**
|
||||
* Checks whether a variable provided is a string.
|
||||
*
|
||||
* @param {*} variable Variable to check
|
||||
*/
|
||||
function isString(variable) {
|
||||
return typeof variable === 'string';
|
||||
}
|
||||
/**
|
||||
* Checks whether a variable provided is an ArrayBuffer.
|
||||
*
|
||||
* @param {*} variable Variable to check
|
||||
*/
|
||||
function isArrayBuffer(variable) {
|
||||
return variable instanceof ArrayBuffer;
|
||||
}
|
||||
/**
|
||||
* Checks whether a variable provided is a Blob.
|
||||
*
|
||||
* @param {*} variable Variable to check
|
||||
*/
|
||||
function isBlob(variable) {
|
||||
(0, tiny_invariant_1.default)(exports.isBrowser, 'isBlob can only be used in a browser environment');
|
||||
return variable instanceof Blob;
|
||||
}
|
||||
/**
|
||||
* Checks whether a variable provided is a data URI.
|
||||
*
|
||||
* @param {*} variable String to check
|
||||
*/
|
||||
function isDataURI(variable) {
|
||||
return isString(variable) && /^data:/.test(variable);
|
||||
}
|
||||
function dataURItoByteString(dataURI) {
|
||||
(0, tiny_invariant_1.default)(isDataURI(dataURI), 'Invalid data URI.');
|
||||
const [headersString = '', dataString = ''] = dataURI.split(',');
|
||||
const headers = headersString.split(';');
|
||||
if (headers.indexOf('base64') !== -1) {
|
||||
return atob(dataString);
|
||||
}
|
||||
return unescape(dataString);
|
||||
}
|
||||
function getDevicePixelRatio() {
|
||||
return (exports.isBrowser && window.devicePixelRatio) || 1;
|
||||
}
|
||||
const allowFileAccessFromFilesTip = 'On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.';
|
||||
function displayCORSWarning() {
|
||||
(0, warning_1.default)(!exports.isLocalFileSystem, `Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${allowFileAccessFromFilesTip}`);
|
||||
}
|
||||
function displayWorkerWarning() {
|
||||
(0, warning_1.default)(!exports.isLocalFileSystem, `Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${allowFileAccessFromFilesTip}`);
|
||||
}
|
||||
function cancelRunningTask(runningTask) {
|
||||
if (runningTask === null || runningTask === void 0 ? void 0 : runningTask.cancel)
|
||||
runningTask.cancel();
|
||||
}
|
||||
function makePageCallback(page, scale) {
|
||||
Object.defineProperty(page, 'width', {
|
||||
get() {
|
||||
return this.view[2] * scale;
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
Object.defineProperty(page, 'height', {
|
||||
get() {
|
||||
return this.view[3] * scale;
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
Object.defineProperty(page, 'originalWidth', {
|
||||
get() {
|
||||
return this.view[2];
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
Object.defineProperty(page, 'originalHeight', {
|
||||
get() {
|
||||
return this.view[3];
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
return page;
|
||||
}
|
||||
function isCancelException(error) {
|
||||
return error.name === 'RenderingCancelledException';
|
||||
}
|
||||
function loadFromFile(file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
if (!reader.result) {
|
||||
return reject(new Error('Error while reading a file.'));
|
||||
}
|
||||
resolve(reader.result);
|
||||
};
|
||||
reader.onerror = (event) => {
|
||||
if (!event.target) {
|
||||
return reject(new Error('Error while reading a file.'));
|
||||
}
|
||||
const { error } = event.target;
|
||||
if (!error) {
|
||||
return reject(new Error('Error while reading a file.'));
|
||||
}
|
||||
switch (error.code) {
|
||||
case error.NOT_FOUND_ERR:
|
||||
return reject(new Error('Error while reading a file: File not found.'));
|
||||
case error.SECURITY_ERR:
|
||||
return reject(new Error('Error while reading a file: Security error.'));
|
||||
case error.ABORT_ERR:
|
||||
return reject(new Error('Error while reading a file: Aborted.'));
|
||||
default:
|
||||
return reject(new Error('Error while reading a file.'));
|
||||
}
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
});
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @fileoverview The instance of Ajv validator.
|
||||
* @author Evgeny Poberezkin
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Requirements
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const Ajv = require("ajv"),
|
||||
metaSchema = require("ajv/lib/refs/json-schema-draft-04.json");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Public Interface
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
module.exports = (additionalOptions = {}) => {
|
||||
const ajv = new Ajv({
|
||||
meta: false,
|
||||
useDefaults: true,
|
||||
validateSchema: false,
|
||||
missingRefs: "ignore",
|
||||
verbose: true,
|
||||
schemaId: "auto",
|
||||
...additionalOptions,
|
||||
});
|
||||
|
||||
ajv.addMetaSchema(metaSchema);
|
||||
// eslint-disable-next-line no-underscore-dangle -- Ajv's API
|
||||
ajv._opts.defaultMeta = metaSchema.id;
|
||||
|
||||
return ajv;
|
||||
};
|
||||
@@ -0,0 +1,64 @@
|
||||
# strip-json-comments [](https://travis-ci.org/sindresorhus/strip-json-comments)
|
||||
|
||||
> Strip comments from JSON. Lets you use comments in your JSON files!
|
||||
|
||||
This is now possible:
|
||||
|
||||
```js
|
||||
{
|
||||
// rainbows
|
||||
"unicorn": /* ❤ */ "cake"
|
||||
}
|
||||
```
|
||||
|
||||
It will replace single-line comments `//` and multi-line comments `/**/` with whitespace. This allows JSON error positions to remain as close as possible to the original source.
|
||||
|
||||
Also available as a [gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save strip-json-comments
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const json = '{/*rainbows*/"unicorn":"cake"}';
|
||||
|
||||
JSON.parse(stripJsonComments(json));
|
||||
//=> {unicorn: 'cake'}
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### stripJsonComments(input, [options])
|
||||
|
||||
#### input
|
||||
|
||||
Type: `string`
|
||||
|
||||
Accepts a string with JSON and returns a string without comments.
|
||||
|
||||
#### options
|
||||
|
||||
##### whitespace
|
||||
|
||||
Type: `boolean`
|
||||
Default: `true`
|
||||
|
||||
Replace comments with whitespace instead of stripping them entirely.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [strip-json-comments-cli](https://github.com/sindresorhus/strip-json-comments-cli) - CLI for this module
|
||||
- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_getPrototypeOf","require","_isNativeReflectConstruct","_possibleConstructorReturn","_callSuper","_this","derived","args","getPrototypeOf","possibleConstructorReturn","isNativeReflectConstruct","Reflect","construct","constructor","apply"],"sources":["../../src/helpers/callSuper.ts"],"sourcesContent":["/* @minVersion 7.23.8 */\n\n// This is duplicated to packages/babel-plugin-transform-classes/src/inline-callSuper-helpers.ts\n\nimport getPrototypeOf from \"./getPrototypeOf.ts\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.ts\";\nimport possibleConstructorReturn from \"./possibleConstructorReturn.ts\";\n\nexport default function _callSuper(\n _this: object,\n derived: Function,\n args: ArrayLike<any>,\n) {\n // Super\n derived = getPrototypeOf(derived);\n return possibleConstructorReturn(\n _this,\n isNativeReflectConstruct()\n ? // NOTE: This doesn't work if this.__proto__.constructor has been modified.\n Reflect.construct(\n derived,\n args || [],\n getPrototypeOf(_this).constructor,\n )\n : derived.apply(_this, args),\n );\n}\n"],"mappings":";;;;;;AAIA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AAEe,SAASG,UAAUA,CAChCC,KAAa,EACbC,OAAiB,EACjBC,IAAoB,EACpB;EAEAD,OAAO,GAAG,IAAAE,uBAAc,EAACF,OAAO,CAAC;EACjC,OAAO,IAAAG,kCAAyB,EAC9BJ,KAAK,EACL,IAAAK,iCAAwB,EAAC,CAAC,GAEtBC,OAAO,CAACC,SAAS,CACfN,OAAO,EACPC,IAAI,IAAI,EAAE,EACV,IAAAC,uBAAc,EAACH,KAAK,CAAC,CAACQ,WACxB,CAAC,GACDP,OAAO,CAACQ,KAAK,CAACT,KAAK,EAAEE,IAAI,CAC/B,CAAC;AACH","ignoreList":[]}
|
||||
Reference in New Issue
Block a user