update
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_utils","require","_placeholders","_core","defineType","defineAliasedType","visitor","builder","fields","Object","assign","name","validate","assertNodeType","expectedNode","assertOneOf","PLACEHOLDERS","patternLikeCommon","assertValueType"],"sources":["../../src/definitions/misc.ts"],"sourcesContent":["import {\n defineAliasedType,\n assertNodeType,\n assertOneOf,\n assertValueType,\n} from \"./utils.ts\";\nimport { PLACEHOLDERS } from \"./placeholders.ts\";\nimport { patternLikeCommon } from \"./core.ts\";\n\nconst defineType = defineAliasedType(\"Miscellaneous\");\n\nif (!process.env.BABEL_8_BREAKING) {\n defineType(\"Noop\", {\n visitor: [],\n });\n}\n\ndefineType(\"Placeholder\", {\n visitor: [],\n builder: [\"expectedNode\", \"name\"],\n // aliases: [], defined in placeholders.js\n fields: {\n name: {\n validate: assertNodeType(\"Identifier\"),\n },\n expectedNode: {\n validate: assertOneOf(...PLACEHOLDERS),\n },\n ...patternLikeCommon(),\n },\n});\n\ndefineType(\"V8IntrinsicIdentifier\", {\n builder: [\"name\"],\n fields: {\n name: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,MAAMG,UAAU,GAAG,IAAAC,wBAAiB,EAAC,eAAe,CAAC;AAElB;EACjCD,UAAU,CAAC,MAAM,EAAE;IACjBE,OAAO,EAAE;EACX,CAAC,CAAC;AACJ;AAEAF,UAAU,CAAC,aAAa,EAAE;EACxBE,OAAO,EAAE,EAAE;EACXC,OAAO,EAAE,CAAC,cAAc,EAAE,MAAM,CAAC;EAEjCC,MAAM,EAAAC,MAAA,CAAAC,MAAA;IACJC,IAAI,EAAE;MACJC,QAAQ,EAAE,IAAAC,qBAAc,EAAC,YAAY;IACvC,CAAC;IACDC,YAAY,EAAE;MACZF,QAAQ,EAAE,IAAAG,kBAAW,EAAC,GAAGC,0BAAY;IACvC;EAAC,GACE,IAAAC,uBAAiB,EAAC,CAAC;AAE1B,CAAC,CAAC;AAEFb,UAAU,CAAC,uBAAuB,EAAE;EAClCG,OAAO,EAAE,CAAC,MAAM,CAAC;EACjBC,MAAM,EAAE;IACNG,IAAI,EAAE;MACJC,QAAQ,EAAE,IAAAM,sBAAe,EAAC,QAAQ;IACpC;EACF;AACF,CAAC,CAAC","ignoreList":[]}
|
||||
@@ -0,0 +1,236 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = applyDecs2311;
|
||||
var _checkInRHS = require("./checkInRHS.js");
|
||||
var _setFunctionName = require("./setFunctionName.js");
|
||||
var _toPropertyKey = require("./toPropertyKey.js");
|
||||
function applyDecs2311(targetClass, classDecs, memberDecs, classDecsHaveThis, instanceBrand, parentClass) {
|
||||
var symbolMetadata = Symbol.metadata || Symbol.for("Symbol.metadata");
|
||||
var defineProperty = Object.defineProperty;
|
||||
var create = Object.create;
|
||||
var metadata;
|
||||
var existingNonFields = [create(null), create(null)];
|
||||
var hasClassDecs = classDecs.length;
|
||||
var _;
|
||||
function createRunInitializers(initializers, useStaticThis, hasValue) {
|
||||
return function (thisArg, value) {
|
||||
if (useStaticThis) {
|
||||
value = thisArg;
|
||||
thisArg = targetClass;
|
||||
}
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
value = initializers[i].apply(thisArg, hasValue ? [value] : []);
|
||||
}
|
||||
return hasValue ? value : thisArg;
|
||||
};
|
||||
}
|
||||
function assertCallable(fn, hint1, hint2, throwUndefined) {
|
||||
if (typeof fn !== "function") {
|
||||
if (throwUndefined || fn !== void 0) {
|
||||
throw new TypeError(hint1 + " must " + (hint2 || "be") + " a function" + (throwUndefined ? "" : " or undefined"));
|
||||
}
|
||||
}
|
||||
return fn;
|
||||
}
|
||||
function applyDec(Class, decInfo, decoratorsHaveThis, name, kind, initializers, ret, isStatic, isPrivate, isField, hasPrivateBrand) {
|
||||
function assertInstanceIfPrivate(target) {
|
||||
if (!hasPrivateBrand(target)) {
|
||||
throw new TypeError("Attempted to access private element on non-instance");
|
||||
}
|
||||
}
|
||||
var decs = [].concat(decInfo[0]),
|
||||
decVal = decInfo[3],
|
||||
isClass = !ret;
|
||||
var isAccessor = kind === 1;
|
||||
var isGetter = kind === 3;
|
||||
var isSetter = kind === 4;
|
||||
var isMethod = kind === 2;
|
||||
function _bindPropCall(name, useStaticThis, before) {
|
||||
return function (_this, value) {
|
||||
if (useStaticThis) {
|
||||
value = _this;
|
||||
_this = Class;
|
||||
}
|
||||
if (before) {
|
||||
before(_this);
|
||||
}
|
||||
return desc[name].call(_this, value);
|
||||
};
|
||||
}
|
||||
if (!isClass) {
|
||||
var desc = {},
|
||||
init = [],
|
||||
key = isGetter ? "get" : isSetter || isAccessor ? "set" : "value";
|
||||
if (isPrivate) {
|
||||
if (isField || isAccessor) {
|
||||
desc = {
|
||||
get: (0, _setFunctionName.default)(function () {
|
||||
return decVal(this);
|
||||
}, name, "get"),
|
||||
set: function (value) {
|
||||
decInfo[4](this, value);
|
||||
}
|
||||
};
|
||||
} else {
|
||||
desc[key] = decVal;
|
||||
}
|
||||
if (!isField) {
|
||||
(0, _setFunctionName.default)(desc[key], name, isMethod ? "" : key);
|
||||
}
|
||||
} else if (!isField) {
|
||||
desc = Object.getOwnPropertyDescriptor(Class, name);
|
||||
}
|
||||
if (!isField && !isPrivate) {
|
||||
_ = existingNonFields[+isStatic][name];
|
||||
if (_ && (_ ^ kind) !== 7) {
|
||||
throw new Error("Decorating two elements with the same name (" + desc[key].name + ") is not supported yet");
|
||||
}
|
||||
existingNonFields[+isStatic][name] = kind < 3 ? 1 : kind;
|
||||
}
|
||||
}
|
||||
var newValue = Class;
|
||||
for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) {
|
||||
var dec = assertCallable(decs[i], "A decorator", "be", true),
|
||||
decThis = decoratorsHaveThis ? decs[i - 1] : void 0;
|
||||
var decoratorFinishedRef = {};
|
||||
var ctx = {
|
||||
kind: ["field", "accessor", "method", "getter", "setter", "class"][kind],
|
||||
name: name,
|
||||
metadata: metadata,
|
||||
addInitializer: function (decoratorFinishedRef, initializer) {
|
||||
if (decoratorFinishedRef.v) {
|
||||
throw new TypeError("attempted to call addInitializer after decoration was finished");
|
||||
}
|
||||
assertCallable(initializer, "An initializer", "be", true);
|
||||
initializers.push(initializer);
|
||||
}.bind(null, decoratorFinishedRef)
|
||||
};
|
||||
if (isClass) {
|
||||
_ = dec.call(decThis, newValue, ctx);
|
||||
decoratorFinishedRef.v = 1;
|
||||
if (assertCallable(_, "class decorators", "return")) {
|
||||
newValue = _;
|
||||
}
|
||||
} else {
|
||||
ctx.static = isStatic;
|
||||
ctx.private = isPrivate;
|
||||
_ = ctx.access = {
|
||||
has: isPrivate ? hasPrivateBrand.bind() : function (target) {
|
||||
return name in target;
|
||||
}
|
||||
};
|
||||
if (!isSetter) {
|
||||
_.get = isPrivate ? isMethod ? function (_this) {
|
||||
assertInstanceIfPrivate(_this);
|
||||
return desc.value;
|
||||
} : _bindPropCall("get", 0, assertInstanceIfPrivate) : function (target) {
|
||||
return target[name];
|
||||
};
|
||||
}
|
||||
if (!isMethod && !isGetter) {
|
||||
_.set = isPrivate ? _bindPropCall("set", 0, assertInstanceIfPrivate) : function (target, v) {
|
||||
target[name] = v;
|
||||
};
|
||||
}
|
||||
newValue = dec.call(decThis, isAccessor ? {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
} : desc[key], ctx);
|
||||
decoratorFinishedRef.v = 1;
|
||||
if (isAccessor) {
|
||||
if (typeof newValue === "object" && newValue) {
|
||||
if (_ = assertCallable(newValue.get, "accessor.get")) {
|
||||
desc.get = _;
|
||||
}
|
||||
if (_ = assertCallable(newValue.set, "accessor.set")) {
|
||||
desc.set = _;
|
||||
}
|
||||
if (_ = assertCallable(newValue.init, "accessor.init")) {
|
||||
init.unshift(_);
|
||||
}
|
||||
} else if (newValue !== void 0) {
|
||||
throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined");
|
||||
}
|
||||
} else if (assertCallable(newValue, (isField ? "field" : "method") + " decorators", "return")) {
|
||||
if (isField) {
|
||||
init.unshift(newValue);
|
||||
} else {
|
||||
desc[key] = newValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (kind < 2) {
|
||||
ret.push(createRunInitializers(init, isStatic, 1), createRunInitializers(initializers, isStatic, 0));
|
||||
}
|
||||
if (!isField && !isClass) {
|
||||
if (isPrivate) {
|
||||
if (isAccessor) {
|
||||
ret.splice(-1, 0, _bindPropCall("get", isStatic), _bindPropCall("set", isStatic));
|
||||
} else {
|
||||
ret.push(isMethod ? desc[key] : assertCallable.call.bind(desc[key]));
|
||||
}
|
||||
} else {
|
||||
defineProperty(Class, name, desc);
|
||||
}
|
||||
}
|
||||
return newValue;
|
||||
}
|
||||
function applyMemberDecs() {
|
||||
var ret = [];
|
||||
var protoInitializers;
|
||||
var staticInitializers;
|
||||
var pushInitializers = function (initializers) {
|
||||
if (initializers) {
|
||||
ret.push(createRunInitializers(initializers));
|
||||
}
|
||||
};
|
||||
var applyMemberDecsOfKind = function (isStatic, isField) {
|
||||
for (var i = 0; i < memberDecs.length; i++) {
|
||||
var decInfo = memberDecs[i];
|
||||
var kind = decInfo[1];
|
||||
var kindOnly = kind & 7;
|
||||
if ((kind & 8) == isStatic && !kindOnly == isField) {
|
||||
var name = decInfo[2];
|
||||
var isPrivate = !!decInfo[3];
|
||||
var decoratorsHaveThis = kind & 16;
|
||||
applyDec(isStatic ? targetClass : targetClass.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : (0, _toPropertyKey.default)(name), kindOnly, kindOnly < 2 ? [] : isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, !!isStatic, isPrivate, isField, isStatic && isPrivate ? function (_) {
|
||||
return (0, _checkInRHS.default)(_) === targetClass;
|
||||
} : instanceBrand);
|
||||
}
|
||||
}
|
||||
};
|
||||
applyMemberDecsOfKind(8, 0);
|
||||
applyMemberDecsOfKind(0, 0);
|
||||
applyMemberDecsOfKind(8, 1);
|
||||
applyMemberDecsOfKind(0, 1);
|
||||
pushInitializers(protoInitializers);
|
||||
pushInitializers(staticInitializers);
|
||||
return ret;
|
||||
}
|
||||
function defineMetadata(Class) {
|
||||
return defineProperty(Class, symbolMetadata, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
value: metadata
|
||||
});
|
||||
}
|
||||
if (parentClass !== undefined) {
|
||||
metadata = parentClass[symbolMetadata];
|
||||
}
|
||||
metadata = create(metadata == null ? null : metadata);
|
||||
_ = applyMemberDecs();
|
||||
if (!hasClassDecs) defineMetadata(targetClass);
|
||||
return {
|
||||
e: _,
|
||||
get c() {
|
||||
var initializers = [];
|
||||
return hasClassDecs && [defineMetadata(targetClass = applyDec(targetClass, [classDecs], classDecsHaveThis, targetClass.name, 5, initializers)), createRunInitializers(initializers, 1)];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=applyDecs2311.js.map
|
||||
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _createSuper;
|
||||
var _getPrototypeOf = require("getPrototypeOf");
|
||||
var _isNativeReflectConstruct = require("isNativeReflectConstruct");
|
||||
var _possibleConstructorReturn = require("possibleConstructorReturn");
|
||||
function _createSuper(Derived) {
|
||||
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
||||
return function _createSuperInternal() {
|
||||
var Super = _getPrototypeOf(Derived),
|
||||
result;
|
||||
if (hasNativeReflectConstruct) {
|
||||
var NewTarget = _getPrototypeOf(this).constructor;
|
||||
result = Reflect.construct(Super, arguments, NewTarget);
|
||||
} else {
|
||||
result = Super.apply(this, arguments);
|
||||
}
|
||||
return _possibleConstructorReturn(this, result);
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=createSuper.js.map
|
||||
@@ -0,0 +1,20 @@
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import { useMemo } from 'react';
|
||||
import { getAttributes, isStructTreeNode, isStructTreeNodeWithOnlyContentChild, } from './shared/structTreeUtils.js';
|
||||
export default function StructTreeItem({ className, node, }) {
|
||||
const attributes = useMemo(() => getAttributes(node), [node]);
|
||||
const children = useMemo(() => {
|
||||
if (!isStructTreeNode(node)) {
|
||||
return null;
|
||||
}
|
||||
if (isStructTreeNodeWithOnlyContentChild(node)) {
|
||||
return null;
|
||||
}
|
||||
return node.children.map((child, index) => {
|
||||
return (
|
||||
// biome-ignore lint/suspicious/noArrayIndexKey: index is stable here
|
||||
_jsx(StructTreeItem, { node: child }, index));
|
||||
});
|
||||
}, [node]);
|
||||
return (_jsx("span", Object.assign({ className: className }, attributes, { children: children })));
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"4":0.08066,"52":0.03156,"81":0.00701,"88":0.00351,"115":0.09469,"127":0.00351,"128":0.04208,"129":0.00351,"130":0.00351,"131":0.01052,"133":0.00351,"135":0.36122,"136":1.06964,"137":0.00701,_:"2 3 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 72 73 74 75 76 77 78 79 80 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 132 134 138 139 140 3.5 3.6"},D:{"39":0.00351,"40":0.00351,"41":0.00351,"42":0.00351,"43":0.00701,"44":0.00351,"45":0.00351,"46":0.00351,"47":0.00351,"48":0.00351,"49":0.00701,"50":0.00351,"51":0.00351,"52":0.00351,"53":0.00351,"54":0.00351,"55":0.00351,"56":0.00701,"57":0.00351,"58":0.00701,"59":0.00701,"60":0.00351,"69":0.01052,"73":0.00351,"75":0.00351,"76":0.01403,"78":0.00351,"79":0.02455,"81":0.01754,"83":0.00701,"85":0.03156,"86":0.00351,"87":0.01754,"88":0.03507,"90":0.00351,"91":0.32264,"92":0.00351,"93":0.01052,"94":0.02104,"98":0.02806,"99":0.00351,"100":0.00351,"101":0.00701,"103":0.04208,"104":0.01403,"106":0.00351,"107":0.00351,"108":0.01403,"109":0.62425,"110":0.01754,"111":0.01052,"112":0.00701,"113":0.00351,"114":0.00701,"115":0.00351,"116":0.02455,"117":0.00701,"118":0.00351,"119":0.02104,"120":0.01052,"121":0.01754,"122":0.06313,"123":0.01754,"124":0.03507,"125":0.39278,"126":0.05962,"127":0.05261,"128":0.08768,"129":0.02806,"130":0.04559,"131":0.30511,"132":0.19289,"133":6.09166,"134":12.02901,"135":0.02455,"136":0.00351,_:"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 61 62 63 64 65 66 67 68 70 71 72 74 77 80 84 89 95 96 97 102 105 137 138"},F:{"87":0.00701,"88":0.00351,"95":0.03507,"113":0.01403,"116":0.31563,"117":0.86623,_:"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 79 80 81 82 83 84 85 86 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 114 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.01052,"85":0.00351,"92":0.0982,"100":0.01754,"105":0.00351,"109":0.01754,"113":0.00701,"114":0.02104,"115":0.01052,"120":0.00351,"121":0.00351,"122":0.01052,"123":0.02104,"124":0.00701,"125":0.01754,"126":0.01052,"127":0.01403,"128":0.02104,"129":0.01403,"130":0.04559,"131":0.1017,"132":0.08066,"133":1.60621,"134":3.68586,_:"12 13 14 15 16 17 79 80 81 83 84 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 103 104 106 107 108 110 111 112 116 117 118 119"},E:{"12":0.00351,"13":0.00701,_:"0 4 5 6 7 8 9 10 11 14 15 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 15.5 16.0 16.4","5.1":0.02104,"13.1":0.00351,"14.1":0.00701,"15.6":0.12976,"16.1":0.00351,"16.2":0.00701,"16.3":0.01052,"16.5":0.01754,"16.6":0.0491,"17.0":0.00701,"17.1":0.02455,"17.2":0.01052,"17.3":0.01754,"17.4":0.02455,"17.5":0.03858,"17.6":0.11222,"18.0":0.05962,"18.1":0.03858,"18.2":0.03858,"18.3":0.47345,"18.4":0.00351},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.00327,"9.3":0.01528,"10.0-10.2":0.00109,"10.3":0.0251,"11.0-11.2":0.1157,"11.3-11.4":0.00764,"12.0-12.1":0.00437,"12.2-12.5":0.10806,"13.0-13.1":0.00218,"13.2":0.00327,"13.3":0.00437,"13.4-13.7":0.01528,"14.0-14.4":0.0382,"14.5-14.8":0.04584,"15.0-15.1":0.0251,"15.2-15.3":0.0251,"15.4":0.03056,"15.5":0.03493,"15.6-15.8":0.43004,"16.0":0.06112,"16.1":0.12552,"16.2":0.06549,"16.3":0.11351,"16.4":0.0251,"16.5":0.04693,"16.6-16.7":0.50972,"17.0":0.03056,"17.1":0.05457,"17.2":0.04148,"17.3":0.05785,"17.4":0.1157,"17.5":0.25759,"17.6-17.7":0.74766,"18.0":0.20956,"18.1":0.68545,"18.2":0.3067,"18.3":6.41022,"18.4":0.09496},P:{"4":0.1238,"20":0.02063,"21":0.09285,"22":0.04127,"23":0.07221,"24":0.14443,"25":0.05158,"26":0.25791,"27":1.89822,_:"5.0-5.4 6.2-6.4 8.2 9.2 10.1 12.0 14.0 15.0 18.0","7.2-7.4":0.13411,"11.1-11.2":0.04127,"13.0":0.01032,"16.0":0.02063,"17.0":0.01032,"19.0":0.03095},I:{"0":0.02592,"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.00003},K:{"0":0.52593,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.01052,_:"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.20128},Q:{"14.9":0.01299},O:{"0":0.11687},H:{"0":0},L:{"0":52.90759}};
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Ivan Kopeykin @vankop
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
const forEachBail = require("./forEachBail");
|
||||
|
||||
/** @typedef {import("./Resolver")} Resolver */
|
||||
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
|
||||
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
|
||||
|
||||
class RootsPlugin {
|
||||
/**
|
||||
* @param {string | ResolveStepHook} source source hook
|
||||
* @param {Set<string>} roots roots
|
||||
* @param {string | ResolveStepHook} target target hook
|
||||
*/
|
||||
constructor(source, roots, target) {
|
||||
this.roots = Array.from(roots);
|
||||
this.source = source;
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Resolver} resolver the resolver
|
||||
* @returns {void}
|
||||
*/
|
||||
apply(resolver) {
|
||||
const target = resolver.ensureHook(this.target);
|
||||
|
||||
resolver
|
||||
.getHook(this.source)
|
||||
.tapAsync("RootsPlugin", (request, resolveContext, callback) => {
|
||||
const req = request.request;
|
||||
if (!req) return callback();
|
||||
if (!req.startsWith("/")) return callback();
|
||||
|
||||
forEachBail(
|
||||
this.roots,
|
||||
/**
|
||||
* @param {string} root root
|
||||
* @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback
|
||||
* @returns {void}
|
||||
*/
|
||||
(root, callback) => {
|
||||
const path = resolver.join(root, req.slice(1));
|
||||
/** @type {ResolveRequest} */
|
||||
const obj = {
|
||||
...request,
|
||||
path,
|
||||
relativePath: request.relativePath && path
|
||||
};
|
||||
resolver.doResolve(
|
||||
target,
|
||||
obj,
|
||||
`root path ${root}`,
|
||||
resolveContext,
|
||||
callback
|
||||
);
|
||||
},
|
||||
callback
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RootsPlugin;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"86":0.0115,"91":0.023,"102":0.00575,"115":0.5634,"128":0.06324,"129":0.04599,"131":0.0115,"135":0.20696,"136":0.55765,_:"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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 87 88 89 90 92 93 94 95 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 127 130 132 133 134 137 138 139 140 3.5 3.6"},D:{"51":0.00575,"60":0.00575,"109":0.5634,"111":0.023,"112":0.023,"116":0.04024,"123":0.00575,"126":0.0115,"129":0.0115,"130":0.00575,"131":0.04024,"132":0.09773,"133":4.80042,"134":5.31208,_:"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 52 53 54 55 56 57 58 59 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 113 114 115 117 118 119 120 121 122 124 125 127 128 135 136 137 138"},F:{"116":0.04024,"117":0.03449,_:"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 79 80 81 82 83 84 85 86 87 88 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 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"128":0.00575,"131":0.00575,"132":4.57046,"133":0.51741,"134":0.82786,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 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 115 116 117 118 119 120 121 122 123 124 125 126 127 129 130"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 14.1 15.4","13.1":0.00575,"15.1":0.39093,"15.2-15.3":0.00575,"15.5":0.02875,"15.6":1.1498,"16.0":0.18972,"16.1":0.38518,"16.2":0.38518,"16.3":1.32802,"16.4":0.65539,"16.5":1.05207,"16.6":4.0128,"17.0":0.16097,"17.1":2.41458,"17.2":1.52349,"17.3":0.97158,"17.4":3.42066,"17.5":2.10413,"17.6":11.05533,"18.0":0.12073,"18.1":0.40818,"18.2":0.51741,"18.3":4.5762,"18.4":0.18397},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0066,"5.0-5.1":0,"6.0-6.1":0.0198,"7.0-7.1":0.0132,"8.1-8.4":0,"9.0-9.2":0.0099,"9.3":0.04621,"10.0-10.2":0.0033,"10.3":0.07592,"11.0-11.2":0.34989,"11.3-11.4":0.02311,"12.0-12.1":0.0132,"12.2-12.5":0.32678,"13.0-13.1":0.0066,"13.2":0.0099,"13.3":0.0132,"13.4-13.7":0.04621,"14.0-14.4":0.11553,"14.5-14.8":0.13863,"15.0-15.1":0.07592,"15.2-15.3":0.07592,"15.4":0.09242,"15.5":0.10563,"15.6-15.8":1.30053,"16.0":0.18485,"16.1":0.3796,"16.2":0.19805,"16.3":0.34329,"16.4":0.07592,"16.5":0.14194,"16.6-16.7":1.54149,"17.0":0.09242,"17.1":0.16504,"17.2":0.12543,"17.3":0.17494,"17.4":0.34989,"17.5":0.779,"17.6-17.7":2.26107,"18.0":0.63376,"18.1":2.07292,"18.2":0.92753,"18.3":19.38576,"18.4":0.28717},P:{"27":0.68608,_:"4 20 21 22 23 24 25 26 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.01125},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0.01701,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.1148},Q:{_:"14.9"},O:{_:"0"},H:{"0":0},L:{"0":8.8275}};
|
||||
@@ -0,0 +1,227 @@
|
||||
export type PDFPageProxy = import("./api").PDFPageProxy;
|
||||
export type PageViewport = import("./display_utils").PageViewport;
|
||||
export type TextAccessibilityManager = import("../../web/text_accessibility.js").TextAccessibilityManager;
|
||||
export type IDownloadManager = import("../../web/interfaces").IDownloadManager;
|
||||
export type IPDFLinkService = import("../../web/interfaces").IPDFLinkService;
|
||||
export type AnnotationEditorUIManager = any;
|
||||
export type StructTreeLayerBuilder = import("../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder;
|
||||
export type AnnotationElementParameters = {
|
||||
data: Object;
|
||||
layer: HTMLDivElement;
|
||||
linkService: IPDFLinkService;
|
||||
downloadManager?: import("../../web/interfaces").IDownloadManager | undefined;
|
||||
annotationStorage?: AnnotationStorage | undefined;
|
||||
/**
|
||||
* - Path for image resources, mainly
|
||||
* for annotation icons. Include trailing slash.
|
||||
*/
|
||||
imageResourcesPath?: string | undefined;
|
||||
renderForms: boolean;
|
||||
svgFactory: Object;
|
||||
enableScripting?: boolean | undefined;
|
||||
hasJSActions?: boolean | undefined;
|
||||
fieldObjects?: Object | undefined;
|
||||
};
|
||||
export type AnnotationLayerParameters = {
|
||||
viewport: PageViewport;
|
||||
div: HTMLDivElement;
|
||||
annotations: any[];
|
||||
page: PDFPageProxy;
|
||||
linkService: IPDFLinkService;
|
||||
downloadManager?: import("../../web/interfaces").IDownloadManager | undefined;
|
||||
annotationStorage?: AnnotationStorage | undefined;
|
||||
/**
|
||||
* - Path for image resources, mainly
|
||||
* for annotation icons. Include trailing slash.
|
||||
*/
|
||||
imageResourcesPath?: string | undefined;
|
||||
renderForms: boolean;
|
||||
/**
|
||||
* - Enable embedded script execution.
|
||||
*/
|
||||
enableScripting?: boolean | undefined;
|
||||
/**
|
||||
* - Some fields have JS actions.
|
||||
* The default value is `false`.
|
||||
*/
|
||||
hasJSActions?: boolean | undefined;
|
||||
fieldObjects?: {
|
||||
[x: string]: Object[];
|
||||
} | null | undefined;
|
||||
annotationCanvasMap?: Map<string, HTMLCanvasElement> | undefined;
|
||||
accessibilityManager?: import("../../web/text_accessibility.js").TextAccessibilityManager | undefined;
|
||||
annotationEditorUIManager?: AnnotationEditorUIManager;
|
||||
structTreeLayer?: import("../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder | undefined;
|
||||
};
|
||||
/**
|
||||
* @typedef {Object} AnnotationLayerParameters
|
||||
* @property {PageViewport} viewport
|
||||
* @property {HTMLDivElement} div
|
||||
* @property {Array} annotations
|
||||
* @property {PDFPageProxy} page
|
||||
* @property {IPDFLinkService} linkService
|
||||
* @property {IDownloadManager} [downloadManager]
|
||||
* @property {AnnotationStorage} [annotationStorage]
|
||||
* @property {string} [imageResourcesPath] - Path for image resources, mainly
|
||||
* for annotation icons. Include trailing slash.
|
||||
* @property {boolean} renderForms
|
||||
* @property {boolean} [enableScripting] - Enable embedded script execution.
|
||||
* @property {boolean} [hasJSActions] - Some fields have JS actions.
|
||||
* The default value is `false`.
|
||||
* @property {Object<string, Array<Object>> | null} [fieldObjects]
|
||||
* @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap]
|
||||
* @property {TextAccessibilityManager} [accessibilityManager]
|
||||
* @property {AnnotationEditorUIManager} [annotationEditorUIManager]
|
||||
* @property {StructTreeLayerBuilder} [structTreeLayer]
|
||||
*/
|
||||
/**
|
||||
* Manage the layer containing all the annotations.
|
||||
*/
|
||||
export class AnnotationLayer {
|
||||
constructor({ div, accessibilityManager, annotationCanvasMap, annotationEditorUIManager, page, viewport, structTreeLayer, }: {
|
||||
div: any;
|
||||
accessibilityManager: any;
|
||||
annotationCanvasMap: any;
|
||||
annotationEditorUIManager: any;
|
||||
page: any;
|
||||
viewport: any;
|
||||
structTreeLayer: any;
|
||||
});
|
||||
div: any;
|
||||
page: any;
|
||||
viewport: any;
|
||||
zIndex: number;
|
||||
_annotationEditorUIManager: any;
|
||||
popupShow: any[] | undefined;
|
||||
hasEditableAnnotations(): boolean;
|
||||
/**
|
||||
* Render a new annotation layer with all annotation elements.
|
||||
*
|
||||
* @param {AnnotationLayerParameters} params
|
||||
* @memberof AnnotationLayer
|
||||
*/
|
||||
render(params: AnnotationLayerParameters): Promise<void>;
|
||||
/**
|
||||
* Update the annotation elements on existing annotation layer.
|
||||
*
|
||||
* @param {AnnotationLayerParameters} viewport
|
||||
* @memberof AnnotationLayer
|
||||
*/
|
||||
update({ viewport }: AnnotationLayerParameters): void;
|
||||
getEditableAnnotations(): any[];
|
||||
getEditableAnnotation(id: any): any;
|
||||
#private;
|
||||
}
|
||||
export class FreeTextAnnotationElement extends AnnotationElement {
|
||||
constructor(parameters: any);
|
||||
textContent: any;
|
||||
textPosition: any;
|
||||
annotationEditorType: number;
|
||||
render(): HTMLElement | undefined;
|
||||
}
|
||||
export class HighlightAnnotationElement extends AnnotationElement {
|
||||
constructor(parameters: any);
|
||||
annotationEditorType: number;
|
||||
render(): HTMLElement | undefined;
|
||||
}
|
||||
export class InkAnnotationElement extends AnnotationElement {
|
||||
constructor(parameters: any);
|
||||
containerClassName: string;
|
||||
svgElementName: string;
|
||||
annotationEditorType: number;
|
||||
render(): HTMLElement | undefined;
|
||||
getElementsToTriggerPopup(): any[];
|
||||
#private;
|
||||
}
|
||||
export class StampAnnotationElement extends AnnotationElement {
|
||||
constructor(parameters: any);
|
||||
annotationEditorType: number;
|
||||
render(): HTMLElement | undefined;
|
||||
}
|
||||
import { AnnotationStorage } from "./annotation_storage.js";
|
||||
declare class AnnotationElement {
|
||||
static _hasPopupData({ titleObj, contentsObj, richText }: {
|
||||
titleObj: any;
|
||||
contentsObj: any;
|
||||
richText: any;
|
||||
}): boolean;
|
||||
constructor(parameters: any, { isRenderable, ignoreBorder, createQuadrilaterals, }?: {
|
||||
isRenderable?: boolean | undefined;
|
||||
ignoreBorder?: boolean | undefined;
|
||||
createQuadrilaterals?: boolean | undefined;
|
||||
});
|
||||
isRenderable: boolean;
|
||||
data: any;
|
||||
layer: any;
|
||||
linkService: any;
|
||||
downloadManager: any;
|
||||
imageResourcesPath: any;
|
||||
renderForms: any;
|
||||
svgFactory: any;
|
||||
annotationStorage: any;
|
||||
enableScripting: any;
|
||||
hasJSActions: any;
|
||||
_fieldObjects: any;
|
||||
parent: any;
|
||||
container: HTMLElement | undefined;
|
||||
get _isEditable(): any;
|
||||
get hasPopupData(): boolean;
|
||||
updateEdited(params: any): void;
|
||||
resetEdited(): void;
|
||||
/**
|
||||
* Create an empty container for the annotation's HTML element.
|
||||
*
|
||||
* @private
|
||||
* @param {boolean} ignoreBorder
|
||||
* @memberof AnnotationElement
|
||||
* @returns {HTMLElement} A section element.
|
||||
*/
|
||||
private _createContainer;
|
||||
setRotation(angle: any, container?: HTMLElement | undefined): void;
|
||||
get _commonActions(): any;
|
||||
_dispatchEventFromSandbox(actions: any, jsEvent: any): void;
|
||||
_setDefaultPropertiesFromJS(element: any): void;
|
||||
/**
|
||||
* Create quadrilaterals from the annotation's quadpoints.
|
||||
*
|
||||
* @private
|
||||
* @memberof AnnotationElement
|
||||
*/
|
||||
private _createQuadrilaterals;
|
||||
/**
|
||||
* Create a popup for the annotation's HTML element. This is used for
|
||||
* annotations that do not have a Popup entry in the dictionary, but
|
||||
* are of a type that works with popups (such as Highlight annotations).
|
||||
*
|
||||
* @private
|
||||
* @memberof AnnotationElement
|
||||
*/
|
||||
private _createPopup;
|
||||
/**
|
||||
* Render the annotation's HTML element(s).
|
||||
*
|
||||
* @public
|
||||
* @memberof AnnotationElement
|
||||
*/
|
||||
public render(): void;
|
||||
/**
|
||||
* @private
|
||||
* @returns {Array}
|
||||
*/
|
||||
private _getElementsByName;
|
||||
show(): void;
|
||||
hide(): void;
|
||||
/**
|
||||
* Get the HTML element(s) which can trigger a popup when clicked or hovered.
|
||||
*
|
||||
* @public
|
||||
* @memberof AnnotationElement
|
||||
* @returns {Array<HTMLElement>|HTMLElement} An array of elements or an
|
||||
* element.
|
||||
*/
|
||||
public getElementsToTriggerPopup(): Array<HTMLElement> | HTMLElement;
|
||||
addHighlightArea(): void;
|
||||
_editOnDoubleClick(): void;
|
||||
#private;
|
||||
}
|
||||
export {};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"132":"K D E F A B mC"},B:{"1":"0 9 C L 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"},C:{"1":"0 9 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 SB TB UB VB WB XB YB qC rC","322":"ZB aB bB cB dB"},D:{"1":"0 9 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","16":"D","33":"1 2 3 4 5 6 7 8 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"},E:{"1":"B 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","16":"PB","33":"K D E F A tC uC vC wC TC"},F:{"1":"0 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","2":"F B C 4C 5C 6C 7C FC kC 8C GC","33":"1 2 3 4 5 6 7 8 G N O P QB RB SB TB UB VB WB XB"},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","16":"SC 9C lC","33":"E AD BD CD DD ED FD GD HD"},H:{"2":"WD"},I:{"1":"I","2":"XD YD ZD","33":"LC J aD lC bD cD"},J:{"33":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"36":"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","33":"J"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"qD rD"}},B:2,C:"CSS writing-mode property",D:true};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_isType","require","_index","isImmutable","node","isType","type","isIdentifier","name"],"sources":["../../src/validators/isImmutable.ts"],"sourcesContent":["import isType from \"./isType.ts\";\nimport { isIdentifier } from \"./generated/index.ts\";\nimport type * as t from \"../index.ts\";\n\n/**\n * Check if the input `node` is definitely immutable.\n */\nexport default function isImmutable(node: t.Node): boolean {\n if (isType(node.type, \"Immutable\")) return true;\n\n if (isIdentifier(node)) {\n if (node.name === \"undefined\") {\n // immutable!\n return true;\n } else {\n // no idea...\n return false;\n }\n }\n\n return false;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAMe,SAASE,WAAWA,CAACC,IAAY,EAAW;EACzD,IAAI,IAAAC,eAAM,EAACD,IAAI,CAACE,IAAI,EAAE,WAAW,CAAC,EAAE,OAAO,IAAI;EAE/C,IAAI,IAAAC,mBAAY,EAACH,IAAI,CAAC,EAAE;IACtB,IAAIA,IAAI,CAACI,IAAI,KAAK,WAAW,EAAE;MAE7B,OAAO,IAAI;IACb,CAAC,MAAM;MAEL,OAAO,KAAK;IACd;EACF;EAEA,OAAO,KAAK;AACd","ignoreList":[]}
|
||||
@@ -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","33":"C L M G N O P"},C:{"2":"0 1 2 3 4 5 6 7 8 9 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 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 qC rC"},D:{"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 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 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","258":"7"},E:{"2":"J PB K D E F A B C L M G sC SC 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","258":"tC"},F:{"1":"0 gB 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 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB hB 4C 5C 6C 7C FC kC 8C GC"},G:{"2":"SC 9C lC","33":"E 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:{"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:{"33":"EC"},N:{"161":"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","2":"J"},Q:{"1":"oD"},R:{"1":"pD"},S:{"2":"qD rD"}},B:7,C:"CSS text-size-adjust",D:true};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_unsupportedIterableToArray","require","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","unsupportedIterableToArray","length","i","F","s","n","done","value","e","f","TypeError","normalCompletion","didErr","err","call","step","next","return"],"sources":["../../src/helpers/createForOfIteratorHelper.ts"],"sourcesContent":["/* @minVersion 7.9.0 */\n\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.ts\";\n\nexport type IteratorFunction<T> = () => Iterator<T>;\n\nexport interface ForOfIteratorHelper<T> {\n // s: start (create the iterator)\n s: () => void;\n // n: next\n n: () => IteratorResult<T, undefined>;\n // e: error (called whenever something throws)\n e: (e: Error) => void;\n // f: finish (always called at the end)\n f: () => void;\n}\n\nexport default function _createForOfIteratorHelper<T>(\n o: T[] | Iterable<T> | ArrayLike<T>,\n allowArrayLike: boolean,\n): ForOfIteratorHelper<T> {\n var it: IteratorFunction<T> | Iterator<T> | T[] | undefined =\n (typeof Symbol !== \"undefined\" && (o as Iterable<T>)[Symbol.iterator]) ||\n (o as any)[\"@@iterator\"];\n\n if (!it) {\n // Fallback for engines without symbol support\n if (\n Array.isArray(o) ||\n // union type doesn't work with function overload, have to use \"as any\".\n (it = unsupportedIterableToArray(o as any) as T[] | undefined) ||\n (allowArrayLike && o && typeof (o as ArrayLike<T>).length === \"number\")\n ) {\n if (it) o = it;\n var i = 0;\n var F = function () {};\n return {\n s: F,\n n: function () {\n // After \"Array.isArray\" check, unsupportedIterableToArray to array, and allow arraylike\n // o is sure to be an array or arraylike, but TypeScript doesn't know that\n if (i >= (o as T[] | ArrayLike<T>).length) {\n // explicit missing the \"value\" (undefined) to reduce the bundle size\n return { done: true } as IteratorReturnResult<undefined>;\n }\n return { done: false, value: (o as T[] | ArrayLike<T>)[i++] };\n },\n e: function (e: Error) {\n throw e;\n },\n f: F,\n };\n }\n\n throw new TypeError(\n \"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\",\n );\n }\n\n var normalCompletion = true,\n didErr = false,\n err: Error | undefined;\n\n // \"it\" is being reassigned multiple times to reduce the variables (bundle size)\n // thus TypeScript can't infer the correct type of the \"it\"\n return {\n s: function () {\n it = (it as IteratorFunction<T>).call(o);\n },\n n: function () {\n var step = (it as Iterator<T>).next();\n normalCompletion = step.done!;\n return step;\n },\n e: function (e: Error) {\n didErr = true;\n err = e;\n },\n f: function () {\n try {\n if (!normalCompletion && (it as Iterator<T>).return != null) {\n (it as Iterator<T>).return!();\n }\n } finally {\n // eslint-disable-next-line no-unsafe-finally\n if (didErr) throw err!;\n }\n },\n };\n}\n"],"mappings":";;;;;;AAEA,IAAAA,2BAAA,GAAAC,OAAA;AAee,SAASC,0BAA0BA,CAChDC,CAAmC,EACnCC,cAAuB,EACC;EACxB,IAAIC,EAAuD,GACxD,OAAOC,MAAM,KAAK,WAAW,IAAKH,CAAC,CAAiBG,MAAM,CAACC,QAAQ,CAAC,IACpEJ,CAAC,CAAS,YAAY,CAAC;EAE1B,IAAI,CAACE,EAAE,EAAE;IAEP,IACEG,KAAK,CAACC,OAAO,CAACN,CAAC,CAAC,KAEfE,EAAE,GAAG,IAAAK,mCAA0B,EAACP,CAAQ,CAAoB,CAAC,IAC7DC,cAAc,IAAID,CAAC,IAAI,OAAQA,CAAC,CAAkBQ,MAAM,KAAK,QAAS,EACvE;MACA,IAAIN,EAAE,EAAEF,CAAC,GAAGE,EAAE;MACd,IAAIO,CAAC,GAAG,CAAC;MACT,IAAIC,CAAC,GAAG,SAAAA,CAAA,EAAY,CAAC,CAAC;MACtB,OAAO;QACLC,CAAC,EAAED,CAAC;QACJE,CAAC,EAAE,SAAAA,CAAA,EAAY;UAGb,IAAIH,CAAC,IAAKT,CAAC,CAAwBQ,MAAM,EAAE;YAEzC,OAAO;cAAEK,IAAI,EAAE;YAAK,CAAC;UACvB;UACA,OAAO;YAAEA,IAAI,EAAE,KAAK;YAAEC,KAAK,EAAGd,CAAC,CAAwBS,CAAC,EAAE;UAAE,CAAC;QAC/D,CAAC;QACDM,CAAC,EAAE,SAAAA,CAAUA,CAAQ,EAAE;UACrB,MAAMA,CAAC;QACT,CAAC;QACDC,CAAC,EAAEN;MACL,CAAC;IACH;IAEA,MAAM,IAAIO,SAAS,CACjB,uIACF,CAAC;EACH;EAEA,IAAIC,gBAAgB,GAAG,IAAI;IACzBC,MAAM,GAAG,KAAK;IACdC,GAAsB;EAIxB,OAAO;IACLT,CAAC,EAAE,SAAAA,CAAA,EAAY;MACbT,EAAE,GAAIA,EAAE,CAAyBmB,IAAI,CAACrB,CAAC,CAAC;IAC1C,CAAC;IACDY,CAAC,EAAE,SAAAA,CAAA,EAAY;MACb,IAAIU,IAAI,GAAIpB,EAAE,CAAiBqB,IAAI,CAAC,CAAC;MACrCL,gBAAgB,GAAGI,IAAI,CAACT,IAAK;MAC7B,OAAOS,IAAI;IACb,CAAC;IACDP,CAAC,EAAE,SAAAA,CAAUA,CAAQ,EAAE;MACrBI,MAAM,GAAG,IAAI;MACbC,GAAG,GAAGL,CAAC;IACT,CAAC;IACDC,CAAC,EAAE,SAAAA,CAAA,EAAY;MACb,IAAI;QACF,IAAI,CAACE,gBAAgB,IAAKhB,EAAE,CAAiBsB,MAAM,IAAI,IAAI,EAAE;UAC1DtB,EAAE,CAAiBsB,MAAM,CAAE,CAAC;QAC/B;MACF,CAAC,SAAS;QAER,IAAIL,MAAM,EAAE,MAAMC,GAAG;MACvB;IACF;EACF,CAAC;AACH","ignoreList":[]}
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @fileoverview Common utils for directives.
|
||||
*
|
||||
* This file contains only shared items for directives.
|
||||
* If you make a utility for rules, please see `../rules/utils/ast-utils.js`.
|
||||
*
|
||||
* @author gfyoung <https://github.com/gfyoung>
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
const directivesPattern =
|
||||
/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u;
|
||||
|
||||
module.exports = {
|
||||
directivesPattern,
|
||||
};
|
||||
@@ -0,0 +1,40 @@
|
||||
import type { RouterManagedTag } from '@tanstack/router-core'
|
||||
|
||||
export function Asset({ tag, attrs, children }: RouterManagedTag): any {
|
||||
switch (tag) {
|
||||
case 'title':
|
||||
return (
|
||||
<title {...attrs} suppressHydrationWarning>
|
||||
{children}
|
||||
</title>
|
||||
)
|
||||
case 'meta':
|
||||
return <meta {...attrs} suppressHydrationWarning />
|
||||
case 'link':
|
||||
return <link {...attrs} suppressHydrationWarning />
|
||||
case 'style':
|
||||
return (
|
||||
<style
|
||||
{...attrs}
|
||||
dangerouslySetInnerHTML={{ __html: children as any }}
|
||||
/>
|
||||
)
|
||||
case 'script':
|
||||
if ((attrs as any) && (attrs as any).src) {
|
||||
return <script {...attrs} suppressHydrationWarning />
|
||||
}
|
||||
if (typeof children === 'string')
|
||||
return (
|
||||
<script
|
||||
{...attrs}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: children,
|
||||
}}
|
||||
suppressHydrationWarning
|
||||
/>
|
||||
)
|
||||
return null
|
||||
default:
|
||||
return null
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = clone
|
||||
|
||||
var getPrototypeOf = Object.getPrototypeOf || function (obj) {
|
||||
return obj.__proto__
|
||||
}
|
||||
|
||||
function clone (obj) {
|
||||
if (obj === null || typeof obj !== 'object')
|
||||
return obj
|
||||
|
||||
if (obj instanceof Object)
|
||||
var copy = { __proto__: getPrototypeOf(obj) }
|
||||
else
|
||||
var copy = Object.create(null)
|
||||
|
||||
Object.getOwnPropertyNames(obj).forEach(function (key) {
|
||||
Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
|
||||
})
|
||||
|
||||
return copy
|
||||
}
|
||||
Reference in New Issue
Block a user