docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run

This commit is contained in:
TanTan committed 2026-11-13 09:27:07 +08:00
1 parent fa9c73363d
commit 2a69b23b47
18210 files changed
+5101211 -16

No files matched your search

@@ -0,0 +1,122 @@
import { withAlg as invalidKeyInput } from './invalid_key_input.js';
import { isKeyLike } from './is_key_like.js';
import * as jwk from './type_checks.js';
const tag = (key) => key?.[Symbol.toStringTag];
const jwkMatchesOp = (alg, key, usage) => {
if (key.use !== undefined) {
let expected;
switch (usage) {
case 'sign':
case 'verify':
expected = 'sig';
break;
case 'encrypt':
case 'decrypt':
expected = 'enc';
break;
}
if (key.use !== expected) {
throw new TypeError(`Invalid key for this operation, its "use" must be "${expected}" when present`);
}
}
if (key.alg !== undefined && key.alg !== alg) {
throw new TypeError(`Invalid key for this operation, its "alg" must be "${alg}" when present`);
}
if (Array.isArray(key.key_ops)) {
let expectedKeyOp;
switch (true) {
case usage === 'sign' || usage === 'verify':
case alg === 'dir':
case alg.includes('CBC-HS'):
expectedKeyOp = usage;
break;
case alg.startsWith('PBES2'):
expectedKeyOp = 'deriveBits';
break;
case /^A\d{3}(?:GCM)?(?:KW)?$/.test(alg):
if (!alg.includes('GCM') && alg.endsWith('KW')) {
expectedKeyOp = usage === 'encrypt' ? 'wrapKey' : 'unwrapKey';
}
else {
expectedKeyOp = usage;
}
break;
case usage === 'encrypt' && alg.startsWith('RSA'):
expectedKeyOp = 'wrapKey';
break;
case usage === 'decrypt':
expectedKeyOp = alg.startsWith('RSA') ? 'unwrapKey' : 'deriveBits';
break;
}
if (expectedKeyOp && key.key_ops?.includes?.(expectedKeyOp) === false) {
throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${expectedKeyOp}" when present`);
}
}
return true;
};
const symmetricTypeCheck = (alg, key, usage) => {
if (key instanceof Uint8Array)
return;
if (jwk.isJWK(key)) {
if (jwk.isSecretJWK(key) && jwkMatchesOp(alg, key, usage))
return;
throw new TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`);
}
if (!isKeyLike(key)) {
throw new TypeError(invalidKeyInput(alg, key, 'CryptoKey', 'KeyObject', 'JSON Web Key', 'Uint8Array'));
}
if (key.type !== 'secret') {
throw new TypeError(`${tag(key)} instances for symmetric algorithms must be of type "secret"`);
}
};
const asymmetricTypeCheck = (alg, key, usage) => {
if (jwk.isJWK(key)) {
switch (usage) {
case 'decrypt':
case 'sign':
if (jwk.isPrivateJWK(key) && jwkMatchesOp(alg, key, usage))
return;
throw new TypeError(`JSON Web Key for this operation must be a private JWK`);
case 'encrypt':
case 'verify':
if (jwk.isPublicJWK(key) && jwkMatchesOp(alg, key, usage))
return;
throw new TypeError(`JSON Web Key for this operation must be a public JWK`);
}
}
if (!isKeyLike(key)) {
throw new TypeError(invalidKeyInput(alg, key, 'CryptoKey', 'KeyObject', 'JSON Web Key'));
}
if (key.type === 'secret') {
throw new TypeError(`${tag(key)} instances for asymmetric algorithms must not be of type "secret"`);
}
if (key.type === 'public') {
switch (usage) {
case 'sign':
throw new TypeError(`${tag(key)} instances for asymmetric algorithm signing must be of type "private"`);
case 'decrypt':
throw new TypeError(`${tag(key)} instances for asymmetric algorithm decryption must be of type "private"`);
}
}
if (key.type === 'private') {
switch (usage) {
case 'verify':
throw new TypeError(`${tag(key)} instances for asymmetric algorithm verifying must be of type "public"`);
case 'encrypt':
throw new TypeError(`${tag(key)} instances for asymmetric algorithm encryption must be of type "public"`);
}
}
};
export function checkKeyType(alg, key, usage) {
switch (alg.substring(0, 2)) {
case 'A1':
case 'A2':
case 'di':
case 'HS':
case 'PB':
symmetricTypeCheck(alg, key, usage);
break;
default:
asymmetricTypeCheck(alg, key, usage);
}
}
@@ -0,0 +1,15 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Space = createLucideIcon("Space", [
["path", { d: "M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1", key: "lt2kga" }]
]);
export { Space as default };
//# sourceMappingURL=space.js.map
@@ -0,0 +1,474 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.cloneNode = exports.hasChildren = exports.isDocument = exports.isDirective = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = exports.Element = exports.Document = exports.CDATA = exports.NodeWithChildren = exports.ProcessingInstruction = exports.Comment = exports.Text = exports.DataNode = exports.Node = void 0;
var domelementtype_1 = require("domelementtype");
/**
* This object will be used as the prototype for Nodes when creating a
* DOM-Level-1-compliant structure.
*/
var Node = /** @class */ (function () {
function Node() {
/** Parent of the node */
this.parent = null;
/** Previous sibling */
this.prev = null;
/** Next sibling */
this.next = null;
/** The start index of the node. Requires `withStartIndices` on the handler to be `true. */
this.startIndex = null;
/** The end index of the node. Requires `withEndIndices` on the handler to be `true. */
this.endIndex = null;
}
Object.defineProperty(Node.prototype, "parentNode", {
// Read-write aliases for properties
/**
* Same as {@link parent}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get: function () {
return this.parent;
},
set: function (parent) {
this.parent = parent;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Node.prototype, "previousSibling", {
/**
* Same as {@link prev}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get: function () {
return this.prev;
},
set: function (prev) {
this.prev = prev;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Node.prototype, "nextSibling", {
/**
* Same as {@link next}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get: function () {
return this.next;
},
set: function (next) {
this.next = next;
},
enumerable: false,
configurable: true
});
/**
* Clone this node, and optionally its children.
*
* @param recursive Clone child nodes as well.
* @returns A clone of the node.
*/
Node.prototype.cloneNode = function (recursive) {
if (recursive === void 0) { recursive = false; }
return cloneNode(this, recursive);
};
return Node;
}());
exports.Node = Node;
/**
* A node that contains some data.
*/
var DataNode = /** @class */ (function (_super) {
__extends(DataNode, _super);
/**
* @param data The content of the data node
*/
function DataNode(data) {
var _this = _super.call(this) || this;
_this.data = data;
return _this;
}
Object.defineProperty(DataNode.prototype, "nodeValue", {
/**
* Same as {@link data}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get: function () {
return this.data;
},
set: function (data) {
this.data = data;
},
enumerable: false,
configurable: true
});
return DataNode;
}(Node));
exports.DataNode = DataNode;
/**
* Text within the document.
*/
var Text = /** @class */ (function (_super) {
__extends(Text, _super);
function Text() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = domelementtype_1.ElementType.Text;
return _this;
}
Object.defineProperty(Text.prototype, "nodeType", {
get: function () {
return 3;
},
enumerable: false,
configurable: true
});
return Text;
}(DataNode));
exports.Text = Text;
/**
* Comments within the document.
*/
var Comment = /** @class */ (function (_super) {
__extends(Comment, _super);
function Comment() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = domelementtype_1.ElementType.Comment;
return _this;
}
Object.defineProperty(Comment.prototype, "nodeType", {
get: function () {
return 8;
},
enumerable: false,
configurable: true
});
return Comment;
}(DataNode));
exports.Comment = Comment;
/**
* Processing instructions, including doc types.
*/
var ProcessingInstruction = /** @class */ (function (_super) {
__extends(ProcessingInstruction, _super);
function ProcessingInstruction(name, data) {
var _this = _super.call(this, data) || this;
_this.name = name;
_this.type = domelementtype_1.ElementType.Directive;
return _this;
}
Object.defineProperty(ProcessingInstruction.prototype, "nodeType", {
get: function () {
return 1;
},
enumerable: false,
configurable: true
});
return ProcessingInstruction;
}(DataNode));
exports.ProcessingInstruction = ProcessingInstruction;
/**
* A `Node` that can have children.
*/
var NodeWithChildren = /** @class */ (function (_super) {
__extends(NodeWithChildren, _super);
/**
* @param children Children of the node. Only certain node types can have children.
*/
function NodeWithChildren(children) {
var _this = _super.call(this) || this;
_this.children = children;
return _this;
}
Object.defineProperty(NodeWithChildren.prototype, "firstChild", {
// Aliases
/** First child of the node. */
get: function () {
var _a;
return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NodeWithChildren.prototype, "lastChild", {
/** Last child of the node. */
get: function () {
return this.children.length > 0
? this.children[this.children.length - 1]
: null;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NodeWithChildren.prototype, "childNodes", {
/**
* Same as {@link children}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get: function () {
return this.children;
},
set: function (children) {
this.children = children;
},
enumerable: false,
configurable: true
});
return NodeWithChildren;
}(Node));
exports.NodeWithChildren = NodeWithChildren;
var CDATA = /** @class */ (function (_super) {
__extends(CDATA, _super);
function CDATA() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = domelementtype_1.ElementType.CDATA;
return _this;
}
Object.defineProperty(CDATA.prototype, "nodeType", {
get: function () {
return 4;
},
enumerable: false,
configurable: true
});
return CDATA;
}(NodeWithChildren));
exports.CDATA = CDATA;
/**
* The root node of the document.
*/
var Document = /** @class */ (function (_super) {
__extends(Document, _super);
function Document() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = domelementtype_1.ElementType.Root;
return _this;
}
Object.defineProperty(Document.prototype, "nodeType", {
get: function () {
return 9;
},
enumerable: false,
configurable: true
});
return Document;
}(NodeWithChildren));
exports.Document = Document;
/**
* An element within the DOM.
*/
var Element = /** @class */ (function (_super) {
__extends(Element, _super);
/**
* @param name Name of the tag, eg. `div`, `span`.
* @param attribs Object mapping attribute names to attribute values.
* @param children Children of the node.
*/
function Element(name, attribs, children, type) {
if (children === void 0) { children = []; }
if (type === void 0) { type = name === "script"
? domelementtype_1.ElementType.Script
: name === "style"
? domelementtype_1.ElementType.Style
: domelementtype_1.ElementType.Tag; }
var _this = _super.call(this, children) || this;
_this.name = name;
_this.attribs = attribs;
_this.type = type;
return _this;
}
Object.defineProperty(Element.prototype, "nodeType", {
get: function () {
return 1;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Element.prototype, "tagName", {
// DOM Level 1 aliases
/**
* Same as {@link name}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get: function () {
return this.name;
},
set: function (name) {
this.name = name;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Element.prototype, "attributes", {
get: function () {
var _this = this;
return Object.keys(this.attribs).map(function (name) {
var _a, _b;
return ({
name: name,
value: _this.attribs[name],
namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name],
prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name],
});
});
},
enumerable: false,
configurable: true
});
return Element;
}(NodeWithChildren));
exports.Element = Element;
/**
* @param node Node to check.
* @returns `true` if the node is a `Element`, `false` otherwise.
*/
function isTag(node) {
return (0, domelementtype_1.isTag)(node);
}
exports.isTag = isTag;
/**
* @param node Node to check.
* @returns `true` if the node has the type `CDATA`, `false` otherwise.
*/
function isCDATA(node) {
return node.type === domelementtype_1.ElementType.CDATA;
}
exports.isCDATA = isCDATA;
/**
* @param node Node to check.
* @returns `true` if the node has the type `Text`, `false` otherwise.
*/
function isText(node) {
return node.type === domelementtype_1.ElementType.Text;
}
exports.isText = isText;
/**
* @param node Node to check.
* @returns `true` if the node has the type `Comment`, `false` otherwise.
*/
function isComment(node) {
return node.type === domelementtype_1.ElementType.Comment;
}
exports.isComment = isComment;
/**
* @param node Node to check.
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
*/
function isDirective(node) {
return node.type === domelementtype_1.ElementType.Directive;
}
exports.isDirective = isDirective;
/**
* @param node Node to check.
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
*/
function isDocument(node) {
return node.type === domelementtype_1.ElementType.Root;
}
exports.isDocument = isDocument;
/**
* @param node Node to check.
* @returns `true` if the node has children, `false` otherwise.
*/
function hasChildren(node) {
return Object.prototype.hasOwnProperty.call(node, "children");
}
exports.hasChildren = hasChildren;
/**
* Clone a node, and optionally its children.
*
* @param recursive Clone child nodes as well.
* @returns A clone of the node.
*/
function cloneNode(node, recursive) {
if (recursive === void 0) { recursive = false; }
var result;
if (isText(node)) {
result = new Text(node.data);
}
else if (isComment(node)) {
result = new Comment(node.data);
}
else if (isTag(node)) {
var children = recursive ? cloneChildren(node.children) : [];
var clone_1 = new Element(node.name, __assign({}, node.attribs), children);
children.forEach(function (child) { return (child.parent = clone_1); });
if (node.namespace != null) {
clone_1.namespace = node.namespace;
}
if (node["x-attribsNamespace"]) {
clone_1["x-attribsNamespace"] = __assign({}, node["x-attribsNamespace"]);
}
if (node["x-attribsPrefix"]) {
clone_1["x-attribsPrefix"] = __assign({}, node["x-attribsPrefix"]);
}
result = clone_1;
}
else if (isCDATA(node)) {
var children = recursive ? cloneChildren(node.children) : [];
var clone_2 = new CDATA(children);
children.forEach(function (child) { return (child.parent = clone_2); });
result = clone_2;
}
else if (isDocument(node)) {
var children = recursive ? cloneChildren(node.children) : [];
var clone_3 = new Document(children);
children.forEach(function (child) { return (child.parent = clone_3); });
if (node["x-mode"]) {
clone_3["x-mode"] = node["x-mode"];
}
result = clone_3;
}
else if (isDirective(node)) {
var instruction = new ProcessingInstruction(node.name, node.data);
if (node["x-name"] != null) {
instruction["x-name"] = node["x-name"];
instruction["x-publicId"] = node["x-publicId"];
instruction["x-systemId"] = node["x-systemId"];
}
result = instruction;
}
else {
throw new Error("Not implemented yet: ".concat(node.type));
}
result.startIndex = node.startIndex;
result.endIndex = node.endIndex;
if (node.sourceCodeLocation != null) {
result.sourceCodeLocation = node.sourceCodeLocation;
}
return result;
}
exports.cloneNode = cloneNode;
function cloneChildren(childs) {
var children = childs.map(function (child) { return cloneNode(child, true); });
for (var i = 1; i < children.length; i++) {
children[i].prev = children[i - 1];
children[i - 1].next = children[i];
}
return children;
}
@@ -0,0 +1,14 @@
export default function decompress(encodedString: string) {
const decompressedArray = encodedString.split(/([A-Z])/g)
const decompressedData = []
let last = ''
let i
for (i = 1; i < decompressedArray.length; i += 2) {
last =
last.slice(0, decompressedArray[i].charCodeAt(0) - 65) +
decompressedArray[i + 1]
decompressedData.push(last)
}
return decompressedData
}
@@ -0,0 +1 @@
{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../src/sort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,QAAQ,EAAE,gBAAgB,EAAE,EAAE,EAC9B,KAAK,EAAE,OAAO,GACb,gBAAgB,EAAE,EAAE,CAYtB;AAuBD,wBAAgB,cAAc,CAAC,CAAC,SAAS,gBAAgB,GAAG,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,CAE9F"}
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
function isNil(value) {
return value == null;
}
exports.isNil = isNil;
@@ -0,0 +1,67 @@
import { isMotionValue } from 'motion-dom';
import { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs';
let shouldForward = (key) => !isValidMotionProp(key);
function loadExternalIsValidProp(isValidProp) {
if (typeof isValidProp !== "function")
return;
// Explicitly filter our events
shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key);
}
/**
* Emotion and Styled Components both allow users to pass through arbitrary props to their components
* to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which
* of these should be passed to the underlying DOM node.
*
* However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props
* as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props
* passed through the `custom` prop so it doesn't *need* the payload or computational overhead of
* `@emotion/is-prop-valid`, however to fix this problem we need to use it.
*
* By making it an optionalDependency we can offer this functionality only in the situations where it's
* actually required.
*/
try {
/**
* We attempt to import this package but require won't be defined in esm environments, in that case
* isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed
* in favour of explicit injection.
*
* String concatenation prevents bundlers like webpack (e.g. Storybook)
* from statically resolving this optional dependency at build time.
*/
const emotionPkg = "@emotion/is-prop-" + "valid";
loadExternalIsValidProp(require(emotionPkg).default);
}
catch {
// We don't need to actually do anything here - the fallback is the existing `isPropValid`.
}
function filterProps(props, isDom, forwardMotionProps) {
const filteredProps = {};
for (const key in props) {
/**
* values is considered a valid prop by Emotion, so if it's present
* this will be rendered out to the DOM unless explicitly filtered.
*
* We check the type as it could be used with the `feColorMatrix`
* element, which we support.
*/
if (key === "values" && typeof props.values === "object")
continue;
if (isMotionValue(props[key]))
continue;
if (shouldForward(key) ||
(forwardMotionProps === true && isValidMotionProp(key)) ||
(!isDom && !isValidMotionProp(key)) ||
// If trying to use native HTML drag events, forward drag listeners
(props["draggable"] &&
key.startsWith("onDrag"))) {
filteredProps[key] =
props[key];
}
}
return filteredProps;
}
export { filterProps, loadExternalIsValidProp };
//# sourceMappingURL=filter-props.mjs.map
@@ -0,0 +1,5 @@
import type { TSESLint } from '@typescript-eslint/utils';
declare const _default: TSESLint.RuleModule<"noNonNullAssertedNullishCoalescing" | "suggestRemovingNonNull", [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,34 @@
import * as core from "../core/index.js";
import * as schemas from "./schemas.js";
export const ZodMiniISODateTime = /*@__PURE__*/ core.$constructor("ZodMiniISODateTime", (inst, def) => {
core.$ZodISODateTime.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
});
// @__NO_SIDE_EFFECTS__
export function datetime(params) {
return core._isoDateTime(ZodMiniISODateTime, params);
}
export const ZodMiniISODate = /*@__PURE__*/ core.$constructor("ZodMiniISODate", (inst, def) => {
core.$ZodISODate.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
});
// @__NO_SIDE_EFFECTS__
export function date(params) {
return core._isoDate(ZodMiniISODate, params);
}
export const ZodMiniISOTime = /*@__PURE__*/ core.$constructor("ZodMiniISOTime", (inst, def) => {
core.$ZodISOTime.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
});
// @__NO_SIDE_EFFECTS__
export function time(params) {
return core._isoTime(ZodMiniISOTime, params);
}
export const ZodMiniISODuration = /*@__PURE__*/ core.$constructor("ZodMiniISODuration", (inst, def) => {
core.$ZodISODuration.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
});
// @__NO_SIDE_EFFECTS__
export function duration(params) {
return core._isoDuration(ZodMiniISODuration, params);
}
@@ -0,0 +1,22 @@
import * as React from 'react';
import { stylesheetSingleton } from './singleton';
/**
* creates a hook to control style singleton
* @see {@link styleSingleton} for a safer component version
* @example
* ```tsx
* const useStyle = styleHookSingleton();
* ///
* useStyle('body { overflow: hidden}');
*/
export const styleHookSingleton = () => {
const sheet = stylesheetSingleton();
return (styles, isDynamic) => {
React.useEffect(() => {
sheet.add(styles);
return () => {
sheet.remove();
};
}, [styles && isDynamic]);
};
};
@@ -0,0 +1 @@
{"version":3,"file":"strikethrough.js","sources":["../../../src/icons/strikethrough.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Strikethrough\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYgNEg5YTMgMyAwIDAgMC0yLjgzIDQiIC8+CiAgPHBhdGggZD0iTTE0IDEyYTQgNCAwIDAgMSAwIDhINiIgLz4KICA8bGluZSB4MT0iNCIgeDI9IjIwIiB5MT0iMTIiIHkyPSIxMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/strikethrough\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Strikethrough = createLucideIcon('Strikethrough', [\n ['path', { d: 'M16 4H9a3 3 0 0 0-2.83 4', key: '43sutm' }],\n ['path', { d: 'M14 12a4 4 0 0 1 0 8H6', key: 'nlfj13' }],\n ['line', { x1: '4', x2: '20', y1: '12', y2: '12', key: '1e0a9i' }],\n]);\n\nexport default Strikethrough;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACvD,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACnE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,63 @@
{
"name": "@floating-ui/core",
"version": "1.7.5",
"description": "Positioning library for floating elements: tooltips, popovers, dropdowns, and more",
"publishConfig": {
"access": "public"
},
"main": "./dist/floating-ui.core.umd.js",
"module": "./dist/floating-ui.core.esm.js",
"unpkg": "./dist/floating-ui.core.umd.min.js",
"types": "./dist/floating-ui.core.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/floating-ui.core.d.mts",
"default": "./dist/floating-ui.core.mjs"
},
"types": "./dist/floating-ui.core.d.ts",
"module": "./dist/floating-ui.core.esm.js",
"default": "./dist/floating-ui.core.umd.js"
}
},
"sideEffects": false,
"files": [
"dist"
],
"author": "atomiks",
"license": "MIT",
"bugs": "https://github.com/floating-ui/floating-ui",
"repository": {
"type": "git",
"url": "https://github.com/floating-ui/floating-ui.git",
"directory": "packages/core"
},
"homepage": "https://floating-ui.com",
"keywords": [
"tooltip",
"popover",
"dropdown",
"menu",
"popup",
"positioning"
],
"dependencies": {
"@floating-ui/utils": "^0.2.11"
},
"devDependencies": {
"config": "0.0.0"
},
"scripts": {
"test": "vitest run",
"test:watch": "vitest watch",
"lint": "eslint .",
"format": "prettier --write .",
"clean": "rimraf dist out-tsc",
"dev": "rollup -c -w",
"build": "rollup -c",
"build:api": "build-api --tsc tsconfig.lib.json",
"publint": "publint",
"typecheck": "tsc -b"
}
}
@@ -0,0 +1,17 @@
'use strict'
const fs = require('graceful-fs')
const u = require('universalify').fromCallback
function remove (path, callback) {
fs.rm(path, { recursive: true, force: true }, callback)
}
function removeSync (path) {
fs.rmSync(path, { recursive: true, force: true })
}
module.exports = {
remove: u(remove),
removeSync
}
@@ -0,0 +1,347 @@
declare const _default: {
inherit: string;
current: string;
transparent: string;
black: string;
white: string;
slate: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
gray: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
zinc: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
neutral: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
stone: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
mauve: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
olive: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
mist: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
taupe: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
red: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
orange: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
amber: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
yellow: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
lime: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
green: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
emerald: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
teal: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
cyan: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
sky: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
blue: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
indigo: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
violet: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
purple: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
fuchsia: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
pink: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
rose: {
'50': string;
'100': string;
'200': string;
'300': string;
'400': string;
'500': string;
'600': string;
'700': string;
'800': string;
'900': string;
'950': string;
};
};
export { _default as default };
@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useCallbackRef = void 0;
var react_1 = require("react");
/**
* creates a MutableRef with ref change callback
* @param initialValue - initial ref value
* @param {Function} callback - a callback to run when value changes
*
* @example
* const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);
* ref.current = 1;
* // prints 0 -> 1
*
* @see https://reactjs.org/docs/hooks-reference.html#useref
* @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref
* @returns {MutableRefObject}
*/
function useCallbackRef(initialValue, callback) {
var ref = (0, react_1.useState)(function () { return ({
// value
value: initialValue,
// last callback
callback: callback,
// "memoized" public interface
facade: {
get current() {
return ref.value;
},
set current(value) {
var last = ref.value;
if (last !== value) {
ref.value = value;
ref.callback(value, last);
}
},
},
}); })[0];
// update callback
ref.callback = callback;
return ref.facade;
}
exports.useCallbackRef = useCallbackRef;
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Text = createLucideIcon("Text", [
["path", { d: "M17 6.1H3", key: "wptmhv" }],
["path", { d: "M21 12.1H3", key: "1j38uz" }],
["path", { d: "M15.1 18H3", key: "1nb16a" }]
]);
export { Text as default };
//# sourceMappingURL=text.js.map
@@ -0,0 +1,114 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const tsutils = __importStar(require("ts-api-utils"));
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'prefer-reduce-type-parameter',
meta: {
type: 'problem',
docs: {
description: 'Enforce using type parameter when calling `Array#reduce` instead of using a type assertion',
recommended: 'strict',
requiresTypeChecking: true,
},
fixable: 'code',
messages: {
preferTypeParameter: 'Unnecessary assertion: Array#reduce accepts a type parameter for the default value.',
},
schema: [],
},
defaultOptions: [],
create(context) {
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
function isArrayType(type) {
return tsutils
.unionConstituents(type)
.every(unionPart => tsutils
.intersectionConstituents(unionPart)
.every(t => checker.isArrayType(t) || checker.isTupleType(t)));
}
return {
'CallExpression > MemberExpression.callee'(callee) {
if (!(0, util_1.isStaticMemberAccessOfValue)(callee, context, 'reduce')) {
return;
}
const [, secondArg] = callee.parent.arguments;
if (callee.parent.arguments.length < 2) {
return;
}
if ((0, util_1.isTypeAssertion)(secondArg)) {
const initializerType = services.getTypeAtLocation(secondArg.expression);
const assertedType = services.getTypeAtLocation(secondArg.typeAnnotation);
const isAssertionNecessary = !checker.isTypeAssignableTo(initializerType, assertedType);
// don't report this if the resulting fix will be a type error
if (isAssertionNecessary) {
return;
}
}
else {
return;
}
// Get the symbol of the `reduce` method.
const calleeObjType = (0, util_1.getConstrainedTypeAtLocation)(services, callee.object);
// Check the owner type of the `reduce` method.
if (isArrayType(calleeObjType)) {
context.report({
node: secondArg,
messageId: 'preferTypeParameter',
fix: fixer => {
const fixes = [
fixer.removeRange([
secondArg.range[0],
secondArg.expression.range[0],
]),
fixer.removeRange([
secondArg.expression.range[1],
secondArg.range[1],
]),
];
if (!callee.parent.typeArguments) {
fixes.push(fixer.insertTextAfter(callee, `<${context.sourceCode.getText(secondArg.typeAnnotation)}>`));
}
return fixes;
},
});
return;
}
},
};
},
});
@@ -0,0 +1,155 @@
"use strict";
const Level = require("./Level.js");
const normalizeLevel = require("./normalizeLevel.js");
class Logger {
/**
* Create a logger instance (创建日志实例)
* @param name Logger name (日志名称)
* @param options Logging options (日志选项)
*/
constructor(name, { level, appenders = [] } = {}) {
this.name = name;
this.appenders = /* @__PURE__ */ new Map();
this.context = {};
this._level = Level.INFO;
if (level == null) {
this.level = Level.INFO;
}
if (appenders) {
appenders.forEach((appender) => {
appender.setup(this);
this.appenders.set(appender.name, appender);
});
}
}
/**
* Log level name (日志级别名称)
*/
get levelName() {
return Level[this._level];
}
/**
* Log level (日志级别)
*/
get level() {
return this._level;
}
/**
* Set log level (设置日志级别)
* @param level Log level (日志级别)
*/
set level(level) {
const normalizedLevel = normalizeLevel(level);
if (normalizedLevel !== void 0) {
this._level = normalizedLevel;
}
}
/**
* Add context (添加上下文)
* @param key Context key (上下文键)
* @param value Context value (上下文值)
*/
addContext(key, value) {
this.context[key] = value;
}
/**
* Remove context (移除上下文)
* @param key Context key (上下文键)
*/
removeContext(key) {
delete this.context[key];
}
/**
* Clear context (清除上下文)
*/
clearContext() {
this.context = {};
}
/**
* Dispose all appenders (关闭所有appenders)
*/
dispose() {
const promises = [];
this.appenders.forEach((appender) => {
promises.push(appender.close());
});
return Promise.allSettled(promises);
}
/**
* Log a message of level TRACE (记录TRACE级别的日志)
* @param args Message arguments (消息参数)
*/
trace(...args) {
this.log(Level.TRACE, args);
}
/**
* Log a message of level DEBUG (记录DEBUG级别的日志)
* @param args Message arguments (消息参数)
*/
debug(...args) {
this.log(Level.DEBUG, args);
}
/**
* Log a message of level INFO (记录INFO级别的日志)
* @param args Message arguments (消息参数)
*/
info(...args) {
this.log(Level.INFO, args);
}
/**
* Log a message of level WARN (记录WARN级别的日志)
* @param args Message arguments (消息参数)
*/
warn(...args) {
this.log(Level.WARN, args);
}
/**
* Log a message of level ERROR (记录ERROR级别的日志)
* @param args Message arguments (消息参数)
*/
error(...args) {
this.log(Level.ERROR, args);
}
/**
* Log a message of level FATAL (记录FATAL级别的日志)
* @param args Message arguments (消息参数)
*/
fatal(...args) {
this.log(Level.FATAL, args);
}
/**
* Create a log event (创建日志事件)
* @param level Log level (日志级别)
* @param message Message (消息)
* @returns Log event (日志事件)
*/
createEvent(level, message) {
return {
level,
levelName: Level[level],
message,
timestamp: /* @__PURE__ */ new Date(),
loggerName: this.name,
context: this.context
};
}
/**
* Log a message (记录日志)
* @param level Log level (日志级别)
* @param message Content (内容)
*/
log(level, message) {
if (level > this._level) {
return;
}
const event = this.createEvent(level, message);
this.appenders.forEach((appender) => {
try {
appender.write(event);
} catch (err) {
console.error("Appender error:", err);
}
});
}
}
module.exports = Logger;
@@ -0,0 +1,3 @@
declare function decompress(encodedString: string): string[];
export { decompress as default };
@@ -0,0 +1,19 @@
/**
* Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.
*/
export declare const fromCodePoint: (...codePoints: number[]) => string;
/**
* Replace the given code point with a replacement character if it is a
* surrogate or is outside the valid range. Otherwise return the code
* point unchanged.
*/
export declare function replaceCodePoint(codePoint: number): number;
/**
* Replace the code point if relevant, then convert it to a string.
*
* @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.
* @param codePoint The code point to decode.
* @returns The decoded code point.
*/
export declare function decodeCodePoint(codePoint: number): string;
//# sourceMappingURL=decode-codepoint.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"arrow-right-circle.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,16 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2021 = void 0;
const es2020_1 = require("./es2020");
const es2021_intl_1 = require("./es2021.intl");
const es2021_promise_1 = require("./es2021.promise");
const es2021_string_1 = require("./es2021.string");
const es2021_weakref_1 = require("./es2021.weakref");
exports.es2021 = {
libs: [es2020_1.es2020, es2021_promise_1.es2021_promise, es2021_string_1.es2021_string, es2021_weakref_1.es2021_weakref, es2021_intl_1.es2021_intl],
variables: [],
};
@@ -0,0 +1 @@
{"version":3,"file":"languages.js","sources":["../../../src/icons/languages.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Languages\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNSA4IDYgNiIgLz4KICA8cGF0aCBkPSJtNCAxNCA2LTYgMi0zIiAvPgogIDxwYXRoIGQ9Ik0yIDVoMTIiIC8+CiAgPHBhdGggZD0iTTcgMmgxIiAvPgogIDxwYXRoIGQ9Im0yMiAyMi01LTEwLTUgMTAiIC8+CiAgPHBhdGggZD0iTTE0IDE4aDYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/languages\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Languages = createLucideIcon('Languages', [\n ['path', { d: 'm5 8 6 6', key: '1wu5hv' }],\n ['path', { d: 'm4 14 6-6 2-3', key: '1k1g8d' }],\n ['path', { d: 'M2 5h12', key: 'or177f' }],\n ['path', { d: 'M7 2h1', key: '1t2jsx' }],\n ['path', { d: 'm22 22-5-10-5 10', key: 'don7ne' }],\n ['path', { d: 'M14 18h6', key: '1m8k6r' }],\n]);\n\nexport default Languages;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACjD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,130 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
'use strict';
import type {ESNode, Program, Comment} from 'hermes-estree';
import type {VisitorKeysType} from '../traverse/getVisitorKeys';
import {SimpleTransform} from '../transform/SimpleTransform';
// https://github.com/prettier/prettier/blob/d962466a828f8ef51435e3e8840178d90b7ec6cd/src/language-js/parse/postprocess/index.js#L161-L182
function transformChainExpression(
node: ESNode,
comments: ?$ReadOnlyArray<Comment>,
): ESNode {
if (comments != null) {
// $FlowExpectedError[prop-missing]
const joinedComments = comments.concat(node.comments ?? []);
// $FlowExpectedError[prop-missing]
// $FlowFixMe[cannot-write]
node.comments = joinedComments;
}
switch (node.type) {
case 'CallExpression':
// $FlowExpectedError[cannot-spread-interface]
return {
...node,
type: 'OptionalCallExpression',
callee: transformChainExpression(node.callee),
};
case 'MemberExpression':
// $FlowExpectedError[cannot-spread-interface]
return {
...node,
type: 'OptionalMemberExpression',
object: transformChainExpression(node.object),
};
// No default
}
return node;
}
export default function mutate(
rootNode: Program,
visitorKeys: ?VisitorKeysType,
): void {
// Since we don't return the result of `transform` we need to be careful not to replace the Program root node.
SimpleTransform.transform(rootNode, {
transform(node): ESNode | null {
// prettier fully expects the parent pointers are NOT set and
// certain cases can crash due to prettier infinite-looping
// whilst naively traversing the parent property
// https://github.com/prettier/prettier/issues/11793
// Note: Only needed for prettier V2, this is supported in V3
if (node.parent) {
// $FlowExpectedError[cannot-write]
delete node.parent;
}
// prettier currently relies on the AST being in the old-school, deprecated AST format for optional chaining
// so we have to apply their transform to our AST so it can actually format it.
// Note: Only needed for prettier V2, this is supported in V3
if (node.type === 'ChainExpression') {
// $FlowFixMe[prop-missing]
return transformChainExpression(node.expression, node?.comments);
}
// Prettier currently relies on comparing the `node` vs `node.value` start positions to know if an
// `ObjectTypeProperty` is a method or not (instead of using the `node.method` boolean). To correctly print
// the node when its not a method we need the start position to be different from the `node.value`s start
// position.
if (node.type === 'ObjectTypeProperty') {
if (
node.method === false &&
node.kind === 'init' &&
node.range[0] === 1 &&
node.value.range[0] === 1
) {
// $FlowExpectedError[cannot-write]
// $FlowExpectedError[cannot-spread-interface]
node.value = {
...node.value,
range: [2, node.value.range[1]],
};
}
return node;
}
// Prettier currently relies on comparing the the start positions to know if the import/export specifier should have a
// rename (eg `Name` vs `Name as Name`) when the name is exactly the same
// So we need to ensure that the range is always the same to avoid the useless code printing
if (node.type === 'ImportSpecifier') {
if (node.local.name === node.imported.name) {
if (node.local.range == null) {
// for our TS-ast printing which has no locs
// $FlowExpectedError[cannot-write]
node.local.range = [0, 0];
}
// $FlowExpectedError[cannot-write]
node.imported.range = [...node.local.range];
}
return node;
}
if (node.type === 'ExportSpecifier') {
if (node.local.name === node.exported.name) {
if (node.local.range == null) {
// for our TS-ast printing which has no locs
// $FlowExpectedError[cannot-write]
node.local.range = [0, 0];
}
// $FlowExpectedError[cannot-write]
node.exported.range = [...node.local.range];
}
return node;
}
return node;
},
visitorKeys,
});
}
@@ -0,0 +1,718 @@
export default `flf2a$ 7 7 16 -1 2
Relief2 by Merlin Greywolf merlin@brahms.udel.edu
August 1994
\\\\\\\\\\#
\\\\\\\\\\#
\\\\\\\\\\#
\\\\\\\\\\#
\\\\\\\\\\#
\\\\\\\\\\#
\\\\\\\\\\##
\\\\\\\\\\#
/// \\#
/// \\#
/// \\#
\\\\\\\\\\#
/// \\#
\\\\\\\\\\##
\\\\\\\\\\\\\\\\#
// \\// \\#
// \\// \\#
\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\\\#
\\\\// \\// \\\\\\#
////////// \\#
\\\\// \\// \\\\\\#
////////// \\#
\\\\// \\// \\\\\\#
\\\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\#
\\\\\\///// \\#
\\\\/// \\\\\\\\#
////// \\\\\\#
\\\\/// \\\\\\\\#
//////// \\#
\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\#
// \\/// \\#
\\\\\\/// \\\\#
\\\\/// \\\\\\#
\\/// \\\\\\\\#
/// \\// \\#
\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\#
\\////// \\\\#
/// \\\\\\\\\\\\#
\\//////// #
/// /// \\\\#
\\////// \\\\#
\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\#
// \\#
/ \\\\#
\\\\\\\\#
\\\\\\\\#
\\\\\\\\#
\\\\\\\\##
\\\\\\\\\\\\#
\\/// \\#
/// \\\\#
/// \\\\#
/// \\\\#
\\/// \\#
\\\\\\\\\\\\##
\\\\\\\\\\\\#
/// \\\\#
\\/// \\#
\\/// \\#
\\/// \\#
/// \\\\#
\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\#
\\\\\\/// \\\\\\#
// /// // #
\\/////// \\#
// /// // #
\\\\\\/// \\\\\\#
\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\\\\\/// \\\\\\\\#
\\\\\\/// \\\\\\\\#
///////// \\#
\\\\\\/// \\\\\\\\#
\\\\\\/// \\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\#
\\\\\\\\\\#
\\\\\\\\\\#
\\\\\\\\\\#
\\\\\\\\\\#
/// \\#
// \\\\##
\\\\\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\#
//////// \\#
\\\\\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\#
\\\\\\\\\\#
\\\\\\\\\\#
\\\\\\\\\\#
\\\\\\\\\\#
/// \\#
\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\#
\\\\\\\\/// \\#
\\\\\\/// \\\\#
\\\\/// \\\\\\#
\\/// \\\\\\\\#
/// \\\\\\\\\\#
\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\\\#
\\\\////// \\\\\\#
\\/// \\/// \\\\#
/// \\\\\\/// \\#
\\/// \\/// \\\\#
\\\\////// \\\\\\#
\\\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\#
\\\\/// \\\\\\#
\\//// \\\\\\#
\\\\/// \\\\\\#
\\\\/// \\\\\\#
/////// \\#
\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\#
\\/////// \\#
/// \\/// \\#
\\\\\\/// \\\\\\#
\\/// \\\\\\\\\\#
//////// \\#
\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\#
\\/////// \\#
/// \\/// \\#
\\\\\\//// \\\\#
/// \\/// \\#
\\/////// \\#
\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\\\////// \\\\#
\\/// /// \\\\#
/// \\/// \\\\#
///////// \\#
\\\\\\\\\\/// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\#
/////// \\#
/// \\\\\\\\\\#
////// \\\\#
\\\\\\\\/// \\#
////// \\\\#
\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\#
\\\\\\/// \\\\\\#
\\\\/// \\\\\\\\#
\\////// \\\\#
/// \\/// \\#
\\////// \\\\#
\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\#
/////// \\#
\\\\\\/// \\\\#
\\\\/// \\\\\\#
\\/// \\\\\\\\#
/// \\\\\\\\\\#
\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\#
\\////// \\\\#
/// \\/// \\#
\\////// \\\\#
/// \\/// \\#
\\////// \\\\#
\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\#
\\////// \\\\#
/// \\/// \\#
\\////// \\\\#
\\\\\\/// \\\\\\#
\\\\/// \\\\\\\\#
\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\#
\\\\\\\\\\#
\\\\\\\\\\#
\\/// #
\\\\\\\\\\#
\\/// #
\\\\\\\\\\##
\\\\\\\\\\#
\\\\\\\\\\#
\\\\\\\\\\#
\\/// #
\\\\\\\\\\#
\\/// #
\\// \\##
\\\\\\\\\\\\\\#
\\\\/// \\#
\\/// \\\\#
/// \\\\\\#
\\/// \\\\#
\\\\/// \\#
\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\#
//////// \\#
\\\\\\\\\\\\\\\\\\\\#
//////// \\#
\\\\\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\#
\\/// \\\\#
\\\\/// \\#
\\\\/// \\#
\\/// \\\\#
/// \\\\\\#
\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\#
\\///// \\\\#
\\\\\\\\/// \\#
\\\\\\/// \\\\#
\\\\\\\\\\\\\\\\\\#
\\\\\\/// \\\\#
\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
/// ///// \\#
/// \\\\\\\\\\\\\\#
\\/////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
///////// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
//////// \\\\#
/// \\\\/// \\#
//////// \\\\#
/// \\\\/// \\#
//////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
/// \\\\\\\\\\\\\\#
/// \\\\/// \\#
\\/////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
//////// \\\\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
//////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
///////// \\#
/// \\\\\\\\\\\\\\#
/////// \\\\\\#
/// \\\\\\\\\\\\\\#
///////// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
///////// \\#
/// \\\\\\\\\\\\\\#
/////// \\\\\\#
/// \\\\\\\\\\\\\\#
/// \\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
/// \\\\\\\\\\\\\\#
/// \\\\/// \\#
\\//////// \\#
\\\\\\\\\\\\/// \\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
/// \\\\/// \\#
///////// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\#
///// \\#
\\/// \\\\#
\\/// \\\\#
\\/// \\\\#
///// \\#
\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\#
\\\\///// \\#
\\\\\\/// \\\\#
\\\\\\/// \\\\#
\\\\\\/// \\\\#
///// \\\\\\#
\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
/// \\/// \\\\#
////// \\\\\\\\#
/// \\/// \\\\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\\\\\\\\\\\#
/// \\\\\\\\\\\\\\#
/// \\\\\\\\\\\\\\#
/// \\\\\\\\\\\\\\#
///////// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
//// //// \\#
/// / /// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
///// /// \\#
///////// \\#
/// ///// \\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\/////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
//////// \\\\#
/// \\\\/// \\#
//////// \\\\#
/// \\\\\\\\\\\\\\#
/// \\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\/// \\\\#
\\//// /// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
//////// \\\\#
/// \\\\/// \\#
//////// \\\\#
/// \\\\/// \\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\\\\\\\\\\\#
\\/////// \\\\#
\\\\\\\\\\\\/// \\#
\\/////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
///////// \\#
\\\\\\/// \\\\\\\\#
\\\\\\/// \\\\\\\\#
\\\\\\/// \\\\\\\\#
\\\\\\/// \\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\/////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\/// /// \\\\#
\\\\///// \\\\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\\\\\#
/// /// /// \\#
/// /// /// \\#
/// /// /// \\#
/// /// /// \\#
\\///////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
\\/// /// \\\\#
\\\\///// \\\\\\#
\\/// /// \\\\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
\\/// /// \\\\#
\\\\///// \\\\\\#
\\\\\\/// \\\\\\\\#
\\\\\\/// \\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
///////// \\#
\\\\\\\\\\/// \\\\#
\\\\\\/// \\\\\\\\#
\\/// \\\\\\\\\\\\#
///////// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\#
///// \\#
/// \\\\\\#
/// \\\\\\#
/// \\\\\\#
///// \\#
\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\#
/// \\\\\\\\\\#
\\/// \\\\\\\\#
\\\\/// \\\\\\#
\\\\\\/// \\\\#
\\\\\\\\/// \\#
\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\#
///// \\#
\\\\/// \\#
\\\\/// \\#
\\\\/// \\#
///// \\#
\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\\\\\\\/ \\\\\\\\\\#
\\\\///// \\\\\\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\#
///////// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\#
// \\#
\\/ \\#
\\\\\\\\#
\\\\\\\\#
\\\\\\\\#
\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
///////// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
//////// \\\\#
/// \\\\/// \\#
//////// \\\\#
/// \\\\/// \\#
//////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
/// \\\\\\\\\\\\\\#
/// \\\\/// \\#
\\/////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
//////// \\\\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
//////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
///////// \\#
/// \\\\\\\\\\\\\\#
/////// \\\\\\#
/// \\\\\\\\\\\\\\#
///////// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
///////// \\#
/// \\\\\\\\\\\\\\#
/////// \\\\\\#
/// \\\\\\\\\\\\\\#
/// \\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
/// \\\\\\\\\\\\\\#
/// \\\\/// \\#
\\//////// \\#
\\\\\\\\\\\\/// \\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
/// \\\\/// \\#
///////// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\#
///// \\#
\\/// \\\\#
\\/// \\\\#
\\/// \\\\#
///// \\#
\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\#
\\\\///// \\#
\\\\\\/// \\\\#
\\\\\\/// \\\\#
\\\\\\/// \\\\#
\\//// \\\\\\#
\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
/// \\/// \\\\#
////// \\\\\\\\#
/// \\/// \\\\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\\\\\\\\\\\#
/// \\\\\\\\\\\\\\#
/// \\\\\\\\\\\\\\#
/// \\\\\\\\\\\\\\#
///////// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
//// //// \\#
/// / /// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
///// /// \\#
///////// \\#
/// ///// \\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\/////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
//////// \\\\#
/// \\\\/// \\#
//////// \\\\#
/// \\\\\\\\\\\\\\#
/// \\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\/// \\\\#
\\//// /// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
//////// \\\\#
/// \\\\/// \\#
//////// \\\\#
/// \\\\/// \\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\\\\\\\\\\\#
\\/////// \\\\#
\\\\\\\\\\\\/// \\#
\\/////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
///////// \\#
\\\\\\/// \\\\\\\\#
\\\\\\/// \\\\\\\\#
\\\\\\/// \\\\\\\\#
\\\\\\/// \\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\/////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\/// /// \\\\#
\\\\///// \\\\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\\\\\#
/// /// /// \\#
/// /// /// \\#
/// /// /// \\#
/// /// /// \\#
\\///////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
\\/// /// \\\\#
\\\\///// \\\\\\#
\\/// /// \\\\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
\\/// /// \\\\#
\\\\///// \\\\\\#
\\\\\\/// \\\\\\\\#
\\\\\\/// \\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
///////// \\#
\\\\\\\\\\/// \\\\#
\\\\\\/// \\\\\\\\#
\\/// \\\\\\\\\\\\#
///////// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\#
\\\\///// \\#
\\\\/// \\\\\\#
///// \\\\\\#
\\\\/// \\\\\\#
\\\\///// \\#
\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\#
/// \\#
/// \\#
/// \\#
/// \\#
/// \\#
\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\#
///// \\\\\\#
\\\\/// \\\\\\#
\\\\///// \\#
\\\\/// \\\\\\#
///// \\\\\\#
\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\\\\\\\#
\\\\//// \\\\/// \\#
\\////////// \\\\#
/// \\\\//// \\\\\\#
\\\\\\\\\\\\\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
///////// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\/////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\/////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
///////// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\/////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
/// \\\\/// \\#
\\/////// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
\\\\\\\\\\\\\\\\\\\\\\#
\\/////// \\\\#
/// \\\\/// \\#
/// \\/// \\\\#
/// \\\\/// \\#
/// \\/// \\\\#
\\\\\\\\\\\\\\\\\\\\\\##
`
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_V","2":"_IB","129":"E"},B:{"1":"_J"},C:{"1":"_tC","2":"_g"},D:{"1":"_Q"},E:{"1":"_DB","2":"_e"},F:{"1":"_dD","2":"_fB"},G:{"1":"_eB","2":"lC"},H:{"1":"1D"},I:{"1":"_P"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:6,C:"JSON parsing",D:true};
@@ -0,0 +1,59 @@
var test = require('tape');
var stringify = require('../');
test('space parameter', function (t) {
t.plan(1);
var obj = { one: 1, two: 2 };
t.equal(stringify(obj, {space: ' '}), ''
+ '{\n'
+ ' "one": 1,\n'
+ ' "two": 2\n'
+ '}'
);
});
test('space parameter (with tabs)', function (t) {
t.plan(1);
var obj = { one: 1, two: 2 };
t.equal(stringify(obj, {space: '\t'}), ''
+ '{\n'
+ '\t"one": 1,\n'
+ '\t"two": 2\n'
+ '}'
);
});
test('space parameter (with a number)', function (t) {
t.plan(1);
var obj = { one: 1, two: 2 };
t.equal(stringify(obj, {space: 3}), ''
+ '{\n'
+ ' "one": 1,\n'
+ ' "two": 2\n'
+ '}'
);
});
test('space parameter (nested objects)', function (t) {
t.plan(1);
var obj = { one: 1, two: { b: 4, a: [2,3] } };
t.equal(stringify(obj, {space: ' '}), ''
+ '{\n'
+ ' "one": 1,\n'
+ ' "two": {\n'
+ ' "a": [\n'
+ ' 2,\n'
+ ' 3\n'
+ ' ],\n'
+ ' "b": 4\n'
+ ' }\n'
+ '}'
);
});
test('space parameter (same as native)', function (t) {
t.plan(1);
// for this test, properties need to be in alphabetical order
var obj = { one: 1, two: { a: [2,3], b: 4 } };
t.equal(stringify(obj, {space: ' '}), JSON.stringify(obj, null, ' '));
});
@@ -0,0 +1,416 @@
flf2a$ 4 1 10 -1 7
madrid.flf by Juan Car (jc@juguete.quim.ucm.es)
version 1.0 -- 23/Nov/93
Uses spanish character set with -D option:
_ _
[ = a' \ = e' ] = i' { = o' | = u' } = n ~ = N
$$@
$$@
$$@
$$@@
|$@
|$@
=$@
$@@
||$@
$@
$@
$@@
||$@
==$@
||$@
$@@
/|\$@
\ $@
\|/$@
$@@
= /$@
/ $@
/ =$@
$@@
|)$@
/=/$@
\/\$@
$@@
/$@
$@
$@
$@@
/$@
| $@
\$@
$@@
\ $@
|$@
/ $@
$@@
\|/$@
-=-$@
/|\$@
$@@
| $@
-=-$@
| $@
$@@
$@
$@
/$@
$@@
$@
-=-$@
$@
$@@
$@
$@
=$@
$@@
/$@
= $@
/ $@
$@@
/=\$@
|/|$@
\=/$@
$@@
/|$@
=$@
|$@
$@@
/=\$@
/ $@
/=/$@
$@@
/=\$@
=<$@
\=/$@
$@@
/|$@
<=|$@
|$@
$@@
|=\$@
"-\$@
\=/$@
$@@
/=\$@
|=\$@
\=/$@
$@@
/=|$@
/"$@
/ $@
$@@
/=\$@
>=<$@
\=/$@
$@@
/=\$@
\=|$@
|$@
$@@
$@
=$@
=$@
$@@
$@
=$@
/$@
$@@
/$@
<=$@
\$@
$@@
__$@
==$@
$@
$@@
\ $@
=>$@
/ $@
$@@
/=\$@
=/$@
| $@
$@@
/=\$@
|"/$@
\=/$@
$@@
/=\$@
|=|$@
\ /$@
$@@
/=)$@
|< $@
\=)$@
$@@
/=\$@
| $@
\=/$@
$@@
=\ $@
| |$@
=/ $@
$@@
/=\$@
|= $@
\=/$@
$@@
/=\$@
|= $@
| $@
$@@
/=\$@
| _$@
\=/$@
$@@
/ \$@
|=|$@
\ /$@
$@@
|$@
=$@
|$@
$@@
/=\$@
_ |$@
\=/$@
$@@
| /$@
|= $@
| \$@
$@@
/ $@
| $@
\=/$@
$@@
/\/\$@
|==|$@
\ /$@
$@@
/ \$@
|\|$@
\ /$@
$@@
/=\$@
| |$@
\=/$@
$@@
/=\$@
|=/$@
| $@
$@@
/=\$@
| |$@
\=\$@
$@@
/=\$@
|=/$@
| \$@
$@@
/=\$@
\ $@
\=/$@
$@@
/=\$@
| $@
| $@
$@@
/ \$@
| |$@
\=/$@
$@@
/ \$@
|==|$@
\/ $@
$@@
/ \$@
| =|= |$@
\/ \/ $@
$@@
\ /$@
= $@
/ \$@
$@@
\ /$@
= $@
| $@
$@@
/=/$@
/ $@
/=/$@
$@@
|=$@
| $@
|=$@
$@@
\ $@
= $@
\$@
$@@
=|$@
|$@
=|$@
$@@
/=\$@
$@
$@
$@@
$@
$@
$@
===$@@
\$@
$@
$@
$@@
$@
/=|$@
\=|$@
$@@
| $@
|=\$@
|=/$@
$@@
$@
/=:$@
\=:$@
$@@
|$@
/=|$@
\=|$@
$@@
$@
/=\$@
\= $@
$@@
/=$@
|=$@
| $@
$@@
$@
/=|$@
\=|$@
\=|$@@
| $@
|=\$@
| |$@
$@@
$@
=$@
|$@
$@@
$@
=$@
|$@
\=|$@@
| $@
=/$@
|\$@
$@@
| $@
| $@
\=$@
$@@
$@
/=\=\$@
| | |$@
$@@
$@
/=\$@
| |$@
$@@
$@
/=\$@
\=/$@
$@@
$@
|=\$@
|=/$@
| $@@
$@
/=|$@
\=|$@
|$@@
$@
/=$@
| $@
$@@
$@
/==$@
==/$@
$@@
|-$@
| $@
\=$@
$@@
$@
| |$@
\=/$@
$@@
$@
| |$@
\\/$@
$@@
$@
| |$@
\/\/$@
$@@
$@
\./$@
/"\$@
$@@
$@
| |$@
\=|$@
\=|$@@
$@
/=/$@
/=/$@
$@@
/$@
=|$@
\$@
$@@
|$@
|$@
|$@
$@@
\ $@
|=$@
/ $@
$@@
/=/$@
$@
$@
$@@
/$@
/=|$@
\=|$@
$@@
/$@
/=\$@
\= $@
$@@
/$@
= $@
| $@
$@@
/$@
/=\$@
\=/$@
$@@
/$@
|=|$@
\=/$@
$@@
---$@
/=\$@
| |$@
$@@
/=\$@
|\|$@
\ /$@
$@@
@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createParserServices = createParserServices;
function createParserServices(astMaps, program) {
if (!program) {
return {
emitDecoratorMetadata: undefined,
experimentalDecorators: undefined,
isolatedDeclarations: undefined,
program,
// we always return the node maps because
// (a) they don't require type info and
// (b) they can be useful when using some of TS's internal non-type-aware AST utils
...astMaps,
};
}
const checker = program.getTypeChecker();
const compilerOptions = program.getCompilerOptions();
return {
program,
// not set in the config is the same as off
emitDecoratorMetadata: compilerOptions.emitDecoratorMetadata ?? false,
experimentalDecorators: compilerOptions.experimentalDecorators ?? false,
isolatedDeclarations: compilerOptions.isolatedDeclarations ?? false,
...astMaps,
getContextualType: node => checker.getContextualType(astMaps.esTreeNodeToTSNodeMap.get(node)),
getResolvedSignature: node => checker.getResolvedSignature(astMaps.esTreeNodeToTSNodeMap.get(node)),
getSymbolAtLocation: node => checker.getSymbolAtLocation(astMaps.esTreeNodeToTSNodeMap.get(node)),
getTypeAtLocation: node => checker.getTypeAtLocation(astMaps.esTreeNodeToTSNodeMap.get(node)),
getTypeFromTypeNode: node => checker.getTypeFromTypeNode(astMaps.esTreeNodeToTSNodeMap.get(node)),
getTypeOfSymbolAtLocation: (symbol, node) => checker.getTypeOfSymbolAtLocation(symbol, astMaps.esTreeNodeToTSNodeMap.get(node)),
};
}
@@ -0,0 +1,128 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "სიმბოლო", verb: "უნდა შეიცავდეს" },
file: { unit: "ბაიტი", verb: "უნდა შეიცავდეს" },
array: { unit: "ელემენტი", verb: "უნდა შეიცავდეს" },
set: { unit: "ელემენტი", verb: "უნდა შეიცავდეს" },
map: { unit: "ელემენტი", verb: "უნდა შეიცავდეს" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const FormatDictionary: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "შეყვანა",
email: "ელ-ფოსტის მისამართი",
url: "URL",
emoji: "ემოჯი",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "თარიღი-დრო",
date: "თარიღი",
time: "დრო",
duration: "ხანგრძლივობა",
ipv4: "IPv4 მისამართი",
ipv6: "IPv6 მისამართი",
mac: "MAC მისამართი",
cidrv4: "IPv4 დიაპაზონი",
cidrv6: "IPv6 დიაპაზონი",
base64: "base64-კოდირებული ველი",
base64url: "base64url-კოდირებული ველი",
json_string: "JSON ველი",
e164: "E.164 ნომერი",
credit_card: "საკრედიტო ბარათის ნომერი",
currency_code: "ვალუტის კოდი",
iban: "IBAN",
jwt: "JWT",
template_literal: "შეყვანა",
};
const TypeDictionary: {
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
} = {
nan: "NaN",
number: "რიცხვი",
string: "ველი",
boolean: "ბულეანი",
function: "ფუნქცია",
array: "მასივი",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `არასწორი შეყვანა: მოსალოდნელი instanceof ${issue.expected}, მიღებული ${received}`;
}
return `არასწორი შეყვანა: მოსალოდნელი ${expected}, მიღებული ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `არასწორი შეყვანა: მოსალოდნელი ${util.stringifyPrimitive(issue.values[0])}`;
return `არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${util.joinValues(issue.values, "|")}-დან`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `ზედმეტად დიდი: მოსალოდნელი ${issue.origin ?? "მნიშვნელობა"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit}`;
return `ზედმეტად დიდი: მოსალოდნელი ${issue.origin ?? "მნიშვნელობა"} იყოს ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `ზედმეტად პატარა: მოსალოდნელი ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `ზედმეტად პატარა: მოსალოდნელი ${issue.origin} იყოს ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") {
return `არასწორი ველი: უნდა იწყებოდეს "${_issue.prefix}"-ით`;
}
if (_issue.format === "ends_with") return `არასწორი ველი: უნდა მთავრდებოდეს "${_issue.suffix}"-ით`;
if (_issue.format === "includes") return `არასწორი ველი: უნდა შეიცავდეს "${_issue.includes}"-ს`;
if (_issue.format === "regex") return `არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${_issue.pattern}`;
return `არასწორი ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `არასწორი რიცხვი: უნდა იყოს ${issue.divisor}-ის ჯერადი`;
case "unrecognized_keys":
return `უცნობი გასაღებ${issue.keys.length > 1 ? "ები" : "ი"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `არასწორი გასაღები ${issue.origin}-ში`;
case "invalid_union":
return "არასწორი შეყვანა";
case "invalid_element":
return `არასწორი მნიშვნელობა ${issue.origin}-ში`;
default:
return `არასწორი შეყვანა`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const MonitorX = createLucideIcon("MonitorX", [
["path", { d: "m14.5 12.5-5-5", key: "1jahn5" }],
["path", { d: "m9.5 12.5 5-5", key: "1k2t7b" }],
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
["path", { d: "M12 17v4", key: "1riwvh" }],
["path", { d: "M8 21h8", key: "1ev6f3" }]
]);
export { MonitorX as default };
//# sourceMappingURL=monitor-x.js.map
@@ -0,0 +1,38 @@
/**
* @fileoverview Handle logging for ESLint
* @author Gyandeep Singh
*/
"use strict";
/* eslint no-console: "off" -- Logging util */
/* c8 ignore next */
module.exports = {
/**
* Cover for console.info
* @param {...any} args The elements to log.
* @returns {void}
*/
info(...args) {
console.log(...args);
},
/**
* Cover for console.warn
* @param {...any} args The elements to log.
* @returns {void}
*/
warn(...args) {
console.warn(...args);
},
/**
* Cover for console.error
* @param {...any} args The elements to log.
* @returns {void}
*/
error(...args) {
console.error(...args);
},
};
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const BaggageClaim = createLucideIcon("BaggageClaim", [
["path", { d: "M22 18H6a2 2 0 0 1-2-2V7a2 2 0 0 0-2-2", key: "4irg2o" }],
["path", { d: "M17 14V4a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v10", key: "14fcyx" }],
["rect", { width: "13", height: "8", x: "8", y: "6", rx: "1", key: "o6oiis" }],
["circle", { cx: "18", cy: "20", r: "2", key: "t9985n" }],
["circle", { cx: "9", cy: "20", r: "2", key: "e5v82j" }]
]);
export { BaggageClaim as default };
//# sourceMappingURL=baggage-claim.js.map
@@ -0,0 +1,151 @@
import { f as createRule, g as import_ast_utils, m as AST_NODE_TYPES } from "../utils.js";
const ClassMemberTypes = {
"*": { test: () => true },
"field": { test: (node) => node.type === "PropertyDefinition" },
"method": { test: (node) => node.type === "MethodDefinition" }
};
var lines_between_class_members_default = createRule({
name: "lines-between-class-members",
meta: {
type: "layout",
docs: { description: "Require or disallow an empty line between class members" },
fixable: "whitespace",
schema: [{ anyOf: [{
type: "object",
properties: { enforce: {
type: "array",
items: {
type: "object",
properties: {
blankLine: {
type: "string",
enum: ["always", "never"]
},
prev: {
type: "string",
enum: [
"method",
"field",
"*"
]
},
next: {
type: "string",
enum: [
"method",
"field",
"*"
]
}
},
additionalProperties: false,
required: [
"blankLine",
"prev",
"next"
]
},
minItems: 1
} },
additionalProperties: false,
required: ["enforce"]
}, {
type: "string",
enum: ["always", "never"]
}] }, {
type: "object",
properties: {
exceptAfterSingleLine: { type: "boolean" },
exceptAfterOverload: { type: "boolean" }
},
additionalProperties: false
}],
defaultOptions: ["always", {
exceptAfterOverload: true,
exceptAfterSingleLine: false
}],
messages: {
never: "Unexpected blank line between class members.",
always: "Expected blank line between class members."
}
},
create(context, [firstOption, secondOption]) {
const configureList = typeof firstOption === "object" ? firstOption.enforce : [{
blankLine: firstOption,
prev: "*",
next: "*"
}];
const { exceptAfterSingleLine } = secondOption;
const exceptAfterOverload = secondOption?.exceptAfterOverload && (firstOption === "always" || typeof firstOption !== "string" && firstOption?.enforce.some(({ blankLine, prev, next }) => blankLine === "always" && prev !== "field" && next !== "field"));
const sourceCode = context.sourceCode;
function getBoundaryTokens(curNode, nextNode) {
const lastToken = sourceCode.getLastToken(curNode);
const prevToken = sourceCode.getTokenBefore(lastToken);
const nextToken = sourceCode.getFirstToken(nextNode);
return (0, import_ast_utils.isSemicolonToken)(lastToken) && !(0, import_ast_utils.isTokenOnSameLine)(prevToken, lastToken) && (0, import_ast_utils.isTokenOnSameLine)(lastToken, nextToken) ? {
curLast: prevToken,
nextFirst: lastToken
} : {
curLast: lastToken,
nextFirst: nextToken
};
}
function findLastConsecutiveTokenAfter(prevLastToken, nextFirstToken, maxLine) {
const after = sourceCode.getTokenAfter(prevLastToken, { includeComments: true });
if (after !== nextFirstToken && after.loc.start.line - prevLastToken.loc.end.line <= maxLine) return findLastConsecutiveTokenAfter(after, nextFirstToken, maxLine);
return prevLastToken;
}
function findFirstConsecutiveTokenBefore(nextFirstToken, prevLastToken, maxLine) {
const before = sourceCode.getTokenBefore(nextFirstToken, { includeComments: true });
if (before !== prevLastToken && nextFirstToken.loc.start.line - before.loc.end.line <= maxLine) return findFirstConsecutiveTokenBefore(before, prevLastToken, maxLine);
return nextFirstToken;
}
function hasTokenOrCommentBetween(before, after) {
return sourceCode.getTokensBetween(before, after, { includeComments: true }).length !== 0;
}
function match(node, type) {
return ClassMemberTypes[type].test(node);
}
function getPaddingType(prevNode, nextNode) {
for (let i = configureList.length - 1; i >= 0; --i) {
const configure = configureList[i];
if (match(prevNode, configure.prev) && match(nextNode, configure.next)) return configure.blankLine;
}
return null;
}
function isOverload(node) {
return (node.type === AST_NODE_TYPES.TSAbstractMethodDefinition || node.type === AST_NODE_TYPES.MethodDefinition) && node.value.type === AST_NODE_TYPES.TSEmptyBodyFunctionExpression;
}
return { ClassBody(node) {
const body = exceptAfterOverload ? node.body.filter((node) => !isOverload(node)) : node.body;
for (let i = 0; i < body.length - 1; i++) {
const curFirst = sourceCode.getFirstToken(body[i]);
const { curLast, nextFirst } = getBoundaryTokens(body[i], body[i + 1]);
const skip = !!(0, import_ast_utils.isTokenOnSameLine)(curFirst, curLast) && exceptAfterSingleLine;
const beforePadding = findLastConsecutiveTokenAfter(curLast, nextFirst, 1);
const afterPadding = findFirstConsecutiveTokenBefore(nextFirst, curLast, 1);
const isPadded = afterPadding.loc.start.line - beforePadding.loc.end.line > 1;
const hasTokenInPadding = hasTokenOrCommentBetween(beforePadding, afterPadding);
const curLineLastToken = findLastConsecutiveTokenAfter(curLast, nextFirst, 0);
const paddingType = getPaddingType(body[i], body[i + 1]);
if (paddingType === "never" && isPadded) context.report({
node: body[i + 1],
messageId: "never",
fix(fixer) {
if (hasTokenInPadding) return null;
return fixer.replaceTextRange([beforePadding.range[1], afterPadding.range[0]], "\n");
}
});
else if (paddingType === "always" && !skip && !isPadded) context.report({
node: body[i + 1],
messageId: "always",
fix(fixer) {
if (hasTokenInPadding) return null;
return fixer.insertTextAfter(curLineLastToken, "\n");
}
});
}
} };
}
});
export { lines_between_class_members_default as t };
@@ -0,0 +1,13 @@
"use strict";
/**
* This is a compatibility ruleset that:
* - disables rules from eslint:recommended which are already handled by TypeScript.
* - enables rules that make sense due to TS's typechecking / transpilation.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
const eslint_recommended_raw_1 = __importDefault(require("../eslint-recommended-raw"));
module.exports = {
overrides: [(0, eslint_recommended_raw_1.default)('glob')],
};
@@ -0,0 +1,238 @@
(function () {
'use strict';
var assign = require('object-assign');
var vary = require('vary');
var defaults = {
origin: '*',
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
preflightContinue: false,
optionsSuccessStatus: 204
};
function isString(s) {
return typeof s === 'string' || s instanceof String;
}
function isOriginAllowed(origin, allowedOrigin) {
if (Array.isArray(allowedOrigin)) {
for (var i = 0; i < allowedOrigin.length; ++i) {
if (isOriginAllowed(origin, allowedOrigin[i])) {
return true;
}
}
return false;
} else if (isString(allowedOrigin)) {
return origin === allowedOrigin;
} else if (allowedOrigin instanceof RegExp) {
return allowedOrigin.test(origin);
} else {
return !!allowedOrigin;
}
}
function configureOrigin(options, req) {
var requestOrigin = req.headers.origin,
headers = [],
isAllowed;
if (!options.origin || options.origin === '*') {
// allow any origin
headers.push([{
key: 'Access-Control-Allow-Origin',
value: '*'
}]);
} else if (isString(options.origin)) {
// fixed origin
headers.push([{
key: 'Access-Control-Allow-Origin',
value: options.origin
}]);
headers.push([{
key: 'Vary',
value: 'Origin'
}]);
} else {
isAllowed = isOriginAllowed(requestOrigin, options.origin);
// reflect origin
headers.push([{
key: 'Access-Control-Allow-Origin',
value: isAllowed ? requestOrigin : false
}]);
headers.push([{
key: 'Vary',
value: 'Origin'
}]);
}
return headers;
}
function configureMethods(options) {
var methods = options.methods;
if (methods.join) {
methods = options.methods.join(','); // .methods is an array, so turn it into a string
}
return {
key: 'Access-Control-Allow-Methods',
value: methods
};
}
function configureCredentials(options) {
if (options.credentials === true) {
return {
key: 'Access-Control-Allow-Credentials',
value: 'true'
};
}
return null;
}
function configureAllowedHeaders(options, req) {
var allowedHeaders = options.allowedHeaders || options.headers;
var headers = [];
if (!allowedHeaders) {
allowedHeaders = req.headers['access-control-request-headers']; // .headers wasn't specified, so reflect the request headers
headers.push([{
key: 'Vary',
value: 'Access-Control-Request-Headers'
}]);
} else if (allowedHeaders.join) {
allowedHeaders = allowedHeaders.join(','); // .headers is an array, so turn it into a string
}
if (allowedHeaders && allowedHeaders.length) {
headers.push([{
key: 'Access-Control-Allow-Headers',
value: allowedHeaders
}]);
}
return headers;
}
function configureExposedHeaders(options) {
var headers = options.exposedHeaders;
if (!headers) {
return null;
} else if (headers.join) {
headers = headers.join(','); // .headers is an array, so turn it into a string
}
if (headers && headers.length) {
return {
key: 'Access-Control-Expose-Headers',
value: headers
};
}
return null;
}
function configureMaxAge(options) {
var maxAge = (typeof options.maxAge === 'number' || options.maxAge) && options.maxAge.toString()
if (maxAge && maxAge.length) {
return {
key: 'Access-Control-Max-Age',
value: maxAge
};
}
return null;
}
function applyHeaders(headers, res) {
for (var i = 0, n = headers.length; i < n; i++) {
var header = headers[i];
if (header) {
if (Array.isArray(header)) {
applyHeaders(header, res);
} else if (header.key === 'Vary' && header.value) {
vary(res, header.value);
} else if (header.value) {
res.setHeader(header.key, header.value);
}
}
}
}
function cors(options, req, res, next) {
var headers = [],
method = req.method && req.method.toUpperCase && req.method.toUpperCase();
if (method === 'OPTIONS') {
// preflight
headers.push(configureOrigin(options, req));
headers.push(configureCredentials(options))
headers.push(configureMethods(options))
headers.push(configureAllowedHeaders(options, req));
headers.push(configureMaxAge(options))
headers.push(configureExposedHeaders(options))
applyHeaders(headers, res);
if (options.preflightContinue) {
next();
} else {
// Safari (and potentially other browsers) need content-length 0,
// for 204 or they just hang waiting for a body
res.statusCode = options.optionsSuccessStatus;
res.setHeader('Content-Length', '0');
res.end();
}
} else {
// actual response
headers.push(configureOrigin(options, req));
headers.push(configureCredentials(options))
headers.push(configureExposedHeaders(options))
applyHeaders(headers, res);
next();
}
}
function middlewareWrapper(o) {
// if options are static (either via defaults or custom options passed in), wrap in a function
var optionsCallback = null;
if (typeof o === 'function') {
optionsCallback = o;
} else {
optionsCallback = function (req, cb) {
cb(null, o);
};
}
return function corsMiddleware(req, res, next) {
optionsCallback(req, function (err, options) {
if (err) {
next(err);
} else {
var corsOptions = assign({}, defaults, options);
var originCallback = null;
if (corsOptions.origin && typeof corsOptions.origin === 'function') {
originCallback = corsOptions.origin;
} else if (corsOptions.origin) {
originCallback = function (origin, cb) {
cb(null, corsOptions.origin);
};
}
if (originCallback) {
originCallback(req.headers.origin, function (err2, origin) {
if (err2 || !origin) {
next(err2);
} else {
corsOptions.origin = origin;
cors(corsOptions, req, res, next);
}
});
} else {
next();
}
}
});
};
}
// can pass either an options hash, an options delegate, or nothing
module.exports = middlewareWrapper;
}());
@@ -0,0 +1 @@
{"version":3,"file":"rat.js","sources":["../../../src/icons/rat.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Rat\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTcgNWMwLTEuNy0xLjMtMy0zLTNzLTMgMS4zLTMgM2MwIC44LjMgMS41LjggMkgxMWMtMy45IDAtNyAzLjEtNyA3YzAgMi4yIDEuOCA0IDQgNCIgLz4KICA8cGF0aCBkPSJNMTYuOCAzLjljLjMtLjMuNi0uNSAxLS43IDEuNS0uNiAzLjMuMSAzLjkgMS42LjYgMS41LS4xIDMuMy0xLjYgMy45bDEuNiAyLjhjLjIuMy4yLjcuMiAxLS4yLjgtLjkgMS4yLTEuNyAxLjEgMCAwLTEuNi0uMy0yLjctLjZIMTdjLTEuNyAwLTMgMS4zLTMgMyIgLz4KICA8cGF0aCBkPSJNMTMuMiAxOGEzIDMgMCAwIDAtMi4yLTUiIC8+CiAgPHBhdGggZD0iTTEzIDIySDRhMiAyIDAgMCAxIDAtNGgxMiIgLz4KICA8cGF0aCBkPSJNMTYgOWguMDEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/rat\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Rat = createLucideIcon('Rat', [\n [\n 'path',\n {\n d: 'M17 5c0-1.7-1.3-3-3-3s-3 1.3-3 3c0 .8.3 1.5.8 2H11c-3.9 0-7 3.1-7 7c0 2.2 1.8 4 4 4',\n key: '1wq71c',\n },\n ],\n [\n 'path',\n {\n d: 'M16.8 3.9c.3-.3.6-.5 1-.7 1.5-.6 3.3.1 3.9 1.6.6 1.5-.1 3.3-1.6 3.9l1.6 2.8c.2.3.2.7.2 1-.2.8-.9 1.2-1.7 1.1 0 0-1.6-.3-2.7-.6H17c-1.7 0-3 1.3-3 3',\n key: '1crdmb',\n },\n ],\n ['path', { d: 'M13.2 18a3 3 0 0 0-2.2-5', key: '1ol3lk' }],\n ['path', { d: 'M13 22H4a2 2 0 0 1 0-4h12', key: 'bt3f23' }],\n ['path', { d: 'M16 9h.01', key: '1bdo4e' }],\n]);\n\nexport default Rat;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,iBAAiB,KAAO,CAAA,CAAA,CAAA;AAAA,CAClC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,9 @@
import isAfter from "./isAfter.mjs";
import isBefore from "./isBefore.mjs";
function isBetween(date, from, to, unit, inclusivity) {
inclusivity = inclusivity || "()";
return (inclusivity.startsWith("(") ? isAfter(date, from, unit) : !isBefore(date, from, unit)) && (inclusivity.charAt(1) === ")" ? isBefore(date, to, unit) : !isAfter(date, to, unit));
}
export {
isBetween as default
};
@@ -0,0 +1,18 @@
type Values = 'always' | 'in-intersections' | 'in-unions' | 'in-unions-and-intersections' | 'never';
export type Options = [
{
allowAliases?: Values;
allowCallbacks?: 'always' | 'never';
allowConditionalTypes?: 'always' | 'never';
allowConstructors?: 'always' | 'never';
allowGenerics?: 'always' | 'never';
allowLiterals?: Values;
allowMappedTypes?: Values;
allowTupleTypes?: Values;
}
];
export type MessageIds = 'noCompositionAlias' | 'noTypeAlias';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,53 @@
{
"name": "supports-color",
"version": "7.2.0",
"description": "Detect whether a terminal supports color",
"license": "MIT",
"repository": "chalk/supports-color",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js",
"browser.js"
],
"keywords": [
"color",
"colour",
"colors",
"terminal",
"console",
"cli",
"ansi",
"styles",
"tty",
"rgb",
"256",
"shell",
"xterm",
"command-line",
"support",
"supports",
"capability",
"detect",
"truecolor",
"16m"
],
"dependencies": {
"has-flag": "^4.0.0"
},
"devDependencies": {
"ava": "^1.4.1",
"import-fresh": "^3.0.0",
"xo": "^0.24.0"
},
"browser": "browser.js"
}
@@ -0,0 +1,24 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Gift = createLucideIcon("Gift", [
["rect", { x: "3", y: "8", width: "18", height: "4", rx: "1", key: "bkv52" }],
["path", { d: "M12 8v13", key: "1c76mn" }],
["path", { d: "M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7", key: "6wjy6b" }],
[
"path",
{
d: "M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",
key: "1ihvrl"
}
]
]);
export { Gift as default };
//# sourceMappingURL=gift.js.map
@@ -0,0 +1 @@
{"version":3,"file":"pocket-knife.js","sources":["../../../src/icons/pocket-knife.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PocketKnife\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyAydjFjMCAxIDIgMSAyIDJTMyA2IDMgN3MyIDEgMiAyLTIgMS0yIDIgMiAxIDIgMiIgLz4KICA8cGF0aCBkPSJNMTggNmguMDEiIC8+CiAgPHBhdGggZD0iTTYgMThoLjAxIiAvPgogIDxwYXRoIGQ9Ik0yMC44MyA4LjgzYTQgNCAwIDAgMC01LjY2LTUuNjZsLTEyIDEyYTQgNCAwIDEgMCA1LjY2IDUuNjZaIiAvPgogIDxwYXRoIGQ9Ik0xOCAxMS42NlYyMmE0IDQgMCAwIDAgNC00VjYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/pocket-knife\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst PocketKnife = createLucideIcon('PocketKnife', [\n ['path', { d: 'M3 2v1c0 1 2 1 2 2S3 6 3 7s2 1 2 2-2 1-2 2 2 1 2 2', key: '19w3oe' }],\n ['path', { d: 'M18 6h.01', key: '1v4wsw' }],\n ['path', { d: 'M6 18h.01', key: 'uhywen' }],\n ['path', { d: 'M20.83 8.83a4 4 0 0 0-5.66-5.66l-12 12a4 4 0 1 0 5.66 5.66Z', key: '6fykxj' }],\n ['path', { d: 'M18 11.66V22a4 4 0 0 0 4-4V6', key: '1utzek' }],\n]);\n\nexport default PocketKnife;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACnF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC/D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,38 @@
import { Env, MiddlewareHandler } from "../../types.js";
import { Context } from "../../context.js";
//#region src/middleware/context-storage/index.d.ts
/**
* Context Storage Middleware for Hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/context-storage}
*
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* type Env = {
* Variables: {
* message: string
* }
* }
*
* const app = new Hono<Env>()
*
* app.use(contextStorage())
*
* app.use(async (c, next) => {
* c.set('message', 'Hono is hot!!')
* await next()
* })
*
* app.get('/', async (c) => c.text(getMessage()))
*
* const getMessage = () => {
* return getContext<Env>().var.message
* }
* ```
*/
export declare const contextStorage: () => MiddlewareHandler;
export declare const tryGetContext: <E extends Env = Env>() => Context<E> | undefined;
export declare const getContext: <E extends Env = Env>() => Context<E>;
//#endregion
@@ -0,0 +1,9 @@
var dateMatcher = options => {
return {
warning: options.translations.warnings.dates,
suggestions: [options.translations.suggestions.dates]
};
};
export { dateMatcher as default };
//# sourceMappingURL=feedback.mjs.map
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Ilya Kantor
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,6 @@
import * as ts from 'typescript';
/**
* @deprecated
* Gets the source file for a given node
*/
export declare function getSourceFileOfNode(node: ts.Node): ts.SourceFile;
@@ -0,0 +1 @@
{"version":3,"file":"use-force-update.mjs","sources":["../../../src/utils/use-force-update.ts"],"sourcesContent":["\"use client\"\n\nimport { frame } from \"motion-dom\"\nimport { useCallback, useState } from \"react\"\nimport { useIsMounted } from \"./use-is-mounted\"\n\nexport function useForceUpdate(): [VoidFunction, number] {\n const isMounted = useIsMounted()\n const [forcedRenderCount, setForcedRenderCount] = useState(0)\n\n const forceRender = useCallback(() => {\n isMounted.current && setForcedRenderCount(forcedRenderCount + 1)\n }, [forcedRenderCount])\n\n /**\n * Defer this to the end of the next animation frame in case there are multiple\n * synchronous calls.\n */\n const deferredForceRender = useCallback(\n () => frame.postRender(forceRender),\n [forceRender]\n )\n\n return [deferredForceRender, forcedRenderCount]\n}\n"],"names":[],"mappings":";;;;;;AAOI;;AAGA;;AAEA;AAEA;;;AAGG;AACH;AAKA;AACJ;;"}
@@ -0,0 +1,37 @@
function getValueState(visualElement) {
const state = [{}, {}];
visualElement?.values.forEach((value, key) => {
state[0][key] = value.get();
state[1][key] = value.getVelocity();
});
return state;
}
function resolveVariantFromProps(props, definition, custom, visualElement) {
/**
* If the variant definition is a function, resolve.
*/
if (typeof definition === "function") {
const [current, velocity] = getValueState(visualElement);
definition = definition(custom !== undefined ? custom : props.custom, current, velocity);
}
/**
* If the variant definition is a variant label, or
* the function returned a variant label, resolve.
*/
if (typeof definition === "string") {
definition = props.variants && props.variants[definition];
}
/**
* At this point we've resolved both functions and variant labels,
* but the resolved variant label might itself have been a function.
* If so, resolve. This can only have returned a valid target object.
*/
if (typeof definition === "function") {
const [current, velocity] = getValueState(visualElement);
definition = definition(custom !== undefined ? custom : props.custom, current, velocity);
}
return definition;
}
export { resolveVariantFromProps };
//# sourceMappingURL=resolve-variants.mjs.map
@@ -0,0 +1,306 @@
/**
* @fileoverview Translates tokens between Acorn format and Esprima format.
* @author Nicholas C. Zakas
*/
/**
* @import * as acorn from "acorn";
* @import { EnhancedTokTypes } from "./espree.js"
* @import { NormalizedEcmaVersion } from "./options.js";
* @import { EspreeToken as EsprimaToken } from "../espree.js";
*/
/**
* Based on the `acorn.Token` class, but without a fixed `type` (since we need
* it to be a string). Avoiding `type` lets us make one extending interface
* more strict and another more lax.
*
* We could make `value` more strict to `string` even though the original is
* `any`.
*
* `start` and `end` are required in `acorn.Token`
*
* `loc` and `range` are from `acorn.Token`
*
* Adds `regex`.
*/
/**
* @typedef {{
* jsxAttrValueToken: boolean;
* ecmaVersion: NormalizedEcmaVersion;
* }} ExtraNoTokens
* @typedef {{
* tokens: EsprimaToken[]
* } & ExtraNoTokens} Extra
*/
//------------------------------------------------------------------------------
// Private
//------------------------------------------------------------------------------
// Esprima Token Types
const Token = {
Boolean: "Boolean",
EOF: "<end>",
Identifier: "Identifier",
PrivateIdentifier: "PrivateIdentifier",
Keyword: "Keyword",
Null: "Null",
Numeric: "Numeric",
Punctuator: "Punctuator",
String: "String",
RegularExpression: "RegularExpression",
Template: "Template",
JSXIdentifier: "JSXIdentifier",
JSXText: "JSXText",
};
/**
* Converts part of a template into an Esprima token.
* @param {acorn.Token[]} tokens The Acorn tokens representing the template.
* @param {string} code The source code.
* @returns {EsprimaToken} The Esprima equivalent of the template token.
* @private
*/
function convertTemplatePart(tokens, code) {
const firstToken = tokens[0],
lastTemplateToken =
/** @type {acorn.Token & { loc: acorn.SourceLocation, range: [number, number] }} */ (
tokens.at(-1)
);
/** @type {EsprimaToken} */
const token = {
type: Token.Template,
value: code.slice(firstToken.start, lastTemplateToken.end),
};
if (firstToken.loc) {
token.loc = {
start: firstToken.loc.start,
end: lastTemplateToken.loc.end,
};
}
if (firstToken.range) {
token.start = firstToken.range[0];
token.end = lastTemplateToken.range[1];
token.range = [token.start, token.end];
}
return token;
}
/* eslint-disable jsdoc/check-types -- The API allows either */
/**
* Contains logic to translate Acorn tokens into Esprima tokens.
*/
class TokenTranslator {
/**
* Contains logic to translate Acorn tokens into Esprima tokens.
* @param {EnhancedTokTypes} acornTokTypes The Acorn token types.
* @param {string|String} code The source code Acorn is parsing. This is necessary
* to correct the "value" property of some tokens.
*/
constructor(acornTokTypes, code) {
/* eslint-enable jsdoc/check-types -- The API allows either */
// token types
this._acornTokTypes = acornTokTypes;
// token buffer for templates
/** @type {acorn.Token[]} */
this._tokens = [];
// track the last curly brace
this._curlyBrace = null;
// the source code
this._code = code;
}
/**
* Translates a single Esprima token to a single Acorn token. This may be
* inaccurate due to how templates are handled differently in Esprima and
* Acorn, but should be accurate for all other tokens.
* @param {acorn.Token} token The Acorn token to translate.
* @param {ExtraNoTokens} extra Espree extra object.
* @returns {EsprimaToken} The Esprima version of the token.
*/
translate(token, extra) {
const type = token.type,
tt = this._acornTokTypes,
// We use an unknown type because `acorn.Token` is a class whose
// `type` property we cannot override to our desired `string`;
// this also allows us to define a stricter `EsprimaToken` with
// a string-only `type` property
unknownTokenType = /** @type {unknown} */ (token),
newToken = /** @type {EsprimaToken} */ (unknownTokenType);
if (type === tt.name) {
newToken.type = Token.Identifier;
// TODO: See if this is an Acorn bug
if ("value" in token && token.value === "static") {
newToken.type = Token.Keyword;
}
if (
extra.ecmaVersion > 5 &&
"value" in token &&
(token.value === "yield" || token.value === "let")
) {
newToken.type = Token.Keyword;
}
} else if (type === tt.privateId) {
newToken.type = Token.PrivateIdentifier;
} else if (
type === tt.semi ||
type === tt.comma ||
type === tt.parenL ||
type === tt.parenR ||
type === tt.braceL ||
type === tt.braceR ||
type === tt.dot ||
type === tt.bracketL ||
type === tt.colon ||
type === tt.question ||
type === tt.bracketR ||
type === tt.ellipsis ||
type === tt.arrow ||
type === tt.jsxTagStart ||
type === tt.incDec ||
type === tt.starstar ||
type === tt.jsxTagEnd ||
type === tt.prefix ||
type === tt.questionDot ||
("binop" in type && type.binop && !type.keyword) ||
("isAssign" in type && type.isAssign)
) {
newToken.type = Token.Punctuator;
newToken.value = this._code.slice(token.start, token.end);
} else if (type === tt.jsxName) {
newToken.type = Token.JSXIdentifier;
} else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) {
newToken.type = Token.JSXText;
} else if (type.keyword) {
if (type.keyword === "true" || type.keyword === "false") {
newToken.type = Token.Boolean;
} else if (type.keyword === "null") {
newToken.type = Token.Null;
} else {
newToken.type = Token.Keyword;
}
} else if (type === tt.num) {
newToken.type = Token.Numeric;
newToken.value = this._code.slice(token.start, token.end);
} else if (type === tt.string) {
if (extra.jsxAttrValueToken) {
extra.jsxAttrValueToken = false;
newToken.type = Token.JSXText;
} else {
newToken.type = Token.String;
}
newToken.value = this._code.slice(token.start, token.end);
} else if (type === tt.regexp) {
newToken.type = Token.RegularExpression;
const value = /** @type {{flags: string, pattern: string}} */ (
"value" in token && token.value
);
newToken.regex = {
flags: value.flags,
pattern: value.pattern,
};
newToken.value = `/${value.pattern}/${value.flags}`;
}
return newToken;
}
/**
* Function to call during Acorn's onToken handler.
* @param {acorn.Token} token The Acorn token.
* @param {Extra} extra The Espree extra object.
* @returns {void}
*/
onToken(token, extra) {
const tt = this._acornTokTypes,
tokens = extra.tokens,
templateTokens = this._tokens;
/**
* Flushes the buffered template tokens and resets the template
* tracking.
* @returns {void}
* @private
*/
const translateTemplateTokens = () => {
tokens.push(convertTemplatePart(this._tokens, this._code));
this._tokens = [];
};
if (token.type === tt.eof) {
// might be one last curlyBrace
if (this._curlyBrace) {
tokens.push(this.translate(this._curlyBrace, extra));
}
return;
}
if (token.type === tt.backQuote) {
// if there's already a curly, it's not part of the template
if (this._curlyBrace) {
tokens.push(this.translate(this._curlyBrace, extra));
this._curlyBrace = null;
}
templateTokens.push(token);
// it's the end
if (templateTokens.length > 1) {
translateTemplateTokens();
}
return;
}
if (token.type === tt.dollarBraceL) {
templateTokens.push(token);
translateTemplateTokens();
return;
}
if (token.type === tt.braceR) {
// if there's already a curly, it's not part of the template
if (this._curlyBrace) {
tokens.push(this.translate(this._curlyBrace, extra));
}
// store new curly for later
this._curlyBrace = token;
return;
}
if (token.type === tt.template || token.type === tt.invalidTemplate) {
if (this._curlyBrace) {
templateTokens.push(this._curlyBrace);
this._curlyBrace = null;
}
templateTokens.push(token);
return;
}
if (this._curlyBrace) {
tokens.push(this.translate(this._curlyBrace, extra));
this._curlyBrace = null;
}
tokens.push(this.translate(token, extra));
}
}
//------------------------------------------------------------------------------
// Public
//------------------------------------------------------------------------------
export default TokenTranslator;
@@ -0,0 +1,139 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "aksara", verb: "mempunyai" },
file: { unit: "bait", verb: "mempunyai" },
array: { unit: "elemen", verb: "mempunyai" },
set: { unit: "elemen", verb: "mempunyai" },
map: { unit: "elemen", verb: "mempunyai" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "input",
email: "alamat e-mel",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "tarikh masa ISO",
date: "tarikh ISO",
time: "masa ISO",
duration: "tempoh ISO",
ipv4: "alamat IPv4",
ipv6: "alamat IPv6",
mac: "alamat MAC",
cidrv4: "julat IPv4",
cidrv6: "julat IPv6",
base64: "string dikodkan base64",
base64url: "string dikodkan base64url",
json_string: "string JSON",
e164: "nombor E.164",
credit_card: "nombor kad kredit",
currency_code: "kod mata wang",
iban: "IBAN",
jwt: "JWT",
template_literal: "input",
};
const TypeDictionary = {
nan: "NaN",
number: "nombor",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Input tidak sah: dijangka instanceof ${issue.expected}, diterima ${received}`;
}
return `Input tidak sah: dijangka ${expected}, diterima ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Input tidak sah: dijangka ${util.stringifyPrimitive(issue.values[0])}`;
return `Pilihan tidak sah: dijangka salah satu daripada ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Terlalu besar: dijangka ${issue.origin ?? "nilai"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemen"}`;
return `Terlalu besar: dijangka ${issue.origin ?? "nilai"} adalah ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Terlalu kecil: dijangka ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Terlalu kecil: dijangka ${issue.origin} adalah ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `String tidak sah: mesti bermula dengan "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `String tidak sah: mesti berakhir dengan "${_issue.suffix}"`;
if (_issue.format === "includes")
return `String tidak sah: mesti mengandungi "${_issue.includes}"`;
if (_issue.format === "regex")
return `String tidak sah: mesti sepadan dengan corak ${_issue.pattern}`;
return `${FormatDictionary[_issue.format] ?? issue.format} tidak sah`;
}
case "not_multiple_of":
return `Nombor tidak sah: perlu gandaan ${issue.divisor}`;
case "unrecognized_keys":
return `Kunci tidak dikenali: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Kunci tidak sah dalam ${issue.origin}`;
case "invalid_union":
return "Input tidak sah";
case "invalid_element":
return `Nilai tidak sah dalam ${issue.origin}`;
default:
return `Input tidak sah`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
module.exports = exports.default;
@@ -0,0 +1,51 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Hook = require("./Hook");
const HookCodeFactory = require("./HookCodeFactory");
class SyncBailHookCodeFactory extends HookCodeFactory {
content({ onError, onResult, resultReturns, onDone, rethrowIfPossible }) {
return this.callTapsSeries({
onError: (i, err) => onError(err),
onResult: (i, result, next) =>
`if(${result} !== undefined) {\n${onResult(
result
)};\n} else {\n${next()}}\n`,
resultReturns,
onDone,
rethrowIfPossible
});
}
}
const factory = new SyncBailHookCodeFactory();
const TAP_ASYNC = () => {
throw new Error("tapAsync is not supported on a SyncBailHook");
};
const TAP_PROMISE = () => {
throw new Error("tapPromise is not supported on a SyncBailHook");
};
function COMPILE(options) {
factory.setup(this, options);
return factory.create(options);
}
function SyncBailHook(args = [], name = undefined) {
const hook = new Hook(args, name);
hook.constructor = SyncBailHook;
hook.tapAsync = TAP_ASYNC;
hook.tapPromise = TAP_PROMISE;
hook.compile = COMPILE;
return hook;
}
SyncBailHook.prototype = null;
module.exports = SyncBailHook;
@@ -0,0 +1,15 @@
import {TokenType as tt} from "../parser/tokenizer/types";
/**
* Get all identifier names in the code, in order, including duplicates.
*/
export default function getIdentifierNames(code, tokens) {
const names = [];
for (const token of tokens) {
if (token.type === tt.name) {
names.push(code.slice(token.start, token.end));
}
}
return names;
}