docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped

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 @@
module.exports={C:{"4":0.0152,"52":0.00608,"78":0.00912,"88":0.00304,"109":0.00304,"113":0.00304,"115":0.10637,"118":0.00912,"120":0.01823,"121":0.03343,"122":0.00304,"123":0.00608,"124":0.00608,"125":0.00304,"127":0.00304,"128":0.00304,"130":0.00304,"133":0.00304,"135":0.00608,"136":0.00912,"138":0.00608,"139":0.00304,"140":0.04559,"142":0.00304,"143":0.00304,"144":0.00304,"145":0.00304,"146":0.00608,"147":0.00608,"148":0.00608,"149":0.00608,"150":0.03951,"151":0.0152,"152":0.02127,"153":0.03039,"154":0.15499,"155":0.48624,"156":0.51967,"157":0.01823,_:"2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 114 116 117 119 126 129 131 132 134 137 141 158 159 160 3.5 3.6"},D:{"49":0.00608,"79":0.00304,"80":0.00304,"81":0.00304,"87":0.00608,"88":0.00608,"96":0.00304,"97":0.00304,"101":0.00304,"103":0.03951,"104":0.02431,"105":0.02431,"106":0.02735,"107":0.02431,"108":0.02431,"109":0.63819,"110":0.02431,"111":0.03647,"112":0.02431,"113":0.00608,"114":0.00912,"115":0.00912,"116":0.09725,"117":0.02431,"118":0.10333,"119":0.04255,"120":0.0699,"121":0.0152,"122":0.06382,"123":0.0152,"124":0.03343,"125":0.00304,"126":0.01823,"127":0.00608,"128":0.04255,"129":0.00304,"130":0.00912,"131":0.06078,"132":0.00912,"133":0.07901,"134":0.03647,"135":0.05166,"136":0.04559,"137":0.04862,"138":0.11244,"139":0.0547,"140":0.0547,"141":0.0699,"142":0.15803,"143":0.02431,"144":0.03647,"145":0.03951,"146":0.04559,"147":0.05774,"148":0.34341,"149":0.12156,"150":0.37684,"151":1.09708,"152":6.12055,"153":7.01097,"154":1.50734,"155":0.02127,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 83 84 85 86 89 90 91 92 93 94 95 98 99 100 102 156 157"},F:{"46":0.00304,"95":0.05166,"100":0.00304,"101":0.02127,"102":0.00304,"105":0.00304,"106":0.00304,"107":0.00304,"114":0.00304,"122":0.00304,"133":0.00304,"134":0.09421,"135":0.68074,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 103 104 108 109 110 111 112 113 115 116 117 118 119 120 121 123 124 125 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00304,"109":0.01823,"119":0.0152,"120":0.01823,"121":0.00304,"122":0.00608,"131":0.00304,"132":0.00304,"133":0.00304,"134":0.00304,"135":0.00304,"136":0.00304,"137":0.00304,"138":0.00304,"139":0.00304,"140":0.00608,"141":0.00304,"142":0.00912,"143":0.00608,"144":0.00608,"145":0.00608,"146":0.00608,"147":0.00912,"148":0.01823,"149":0.01823,"150":0.05166,"151":0.10029,"152":0.9664,"153":1.45568,"154":0.40419,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 123 124 125 126 127 128 129 130"},E:{"14":0.00304,"27":0.09117,_:"4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 15.1 15.2-15.3 27.1 TP","12.1":0.00304,"13.1":0.01216,"14.1":0.00912,"15.4":0.00304,"15.5":0.00304,"15.6":0.0699,"16.0":0.00304,"16.1":0.00304,"16.2":0.00304,"16.3":0.00608,"16.4":0.00304,"16.5":0.00608,"16.6":0.09725,"17.0":0.00304,"17.1":0.07901,"17.2":0.00912,"17.3":0.00608,"17.4":0.01216,"17.5":0.01823,"17.6":0.07294,"18.0":0.01216,"18.1":0.01216,"18.2":0.0152,"18.3":0.02127,"18.4":0.00608,"18.5-18.7":0.02431,"26.0":0.01216,"26.1":0.00912,"26.2":0.03951,"26.3":0.04559,"26.4":0.03343,"26.5":0.19146,"26.6":0.78102,"27.2":0.00304},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00135,"5.0-5.1":0.00135,"6.0-6.1":0,"7.0-7.1":0.00269,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01346,"11.0-11.2":0.00135,"11.3-11.4":0.00269,"12.0-12.1":0,"12.2-12.5":0.035,"13.0-13.1":0,"13.2":0.00673,"13.3":0,"13.4-13.7":0.00135,"14.0-14.4":0.00539,"14.5-14.8":0.00808,"15.0-15.1":0.00808,"15.2-15.3":0.00539,"15.4":0.00673,"15.5":0.00808,"15.6-15.8":0.17501,"16.0":0.01346,"16.1":0.02423,"16.2":0.01346,"16.3":0.02962,"16.4":0.00673,"16.5":0.01077,"16.6-16.7":0.24367,"17.0":0.00942,"17.1":0.01346,"17.2":0.01346,"17.3":0.02019,"17.4":0.02827,"17.5":0.0552,"17.6-17.7":0.1427,"18.0":0.02962,"18.1":0.05924,"18.2":0.08078,"18.3":0.14001,"18.4":0.08751,"18.5-18.7":1.80802,"26.0":0.08751,"26.1":0.08885,"26.2":0.23156,"26.3":0.2504,"26.4":0.18309,"26.5":1.22644,"26.6":7.56731,"27.0":0.58024,"27.1":0,"27.2":0.01481},P:{"21":0.00934,"22":0.00934,"23":0.00934,"24":0.00934,"25":0.00934,"26":0.02803,"27":0.03737,"28":0.05606,"29":0.11212,"30":2.15825,_:"4 20 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0","7.2-7.4":0.00Line truncated
@@ -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 BellOff = createLucideIcon("BellOff", [
["path", { d: "M10.268 21a2 2 0 0 0 3.464 0", key: "vwvbt9" }],
[
"path",
{
d: "M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",
key: "178tsu"
}
],
["path", { d: "m2 2 20 20", key: "1ooewy" }],
["path", { d: "M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05", key: "1hqiys" }]
]);
export { BellOff as default };
//# sourceMappingURL=bell-off.js.map
@@ -0,0 +1 @@
{"version":3,"file":"streamableHttpWithSseFallbackClient.js","sourceRoot":"","sources":["../../../../src/examples/client/streamableHttpWithSseFallbackClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,M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C5B,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
{"version":3,"file":"handle-window.mjs","sources":["../../../src/resize/handle-window.ts"],"sourcesContent":["import { WindowResizeHandler } from \"./types\"\n\nconst windowCallbacks = new Set<WindowResizeHandler>()\n\nlet windowResizeHandler: VoidFunction | undefined\n\nfunction createWindowResizeHandler() {\n windowResizeHandler = () => {\n const info = {\n get width() {\n return window.innerWidth\n },\n get height() {\n return window.innerHeight\n },\n }\n\n windowCallbacks.forEach((callback) => callback(info))\n }\n\n window.addEventListener(\"resize\", windowResizeHandler)\n}\n\nexport function resizeWindow(callback: WindowResizeHandler) {\n windowCallbacks.add(callback)\n\n if (!windowResizeHandler) createWindowResizeHandler()\n\n return () => {\n windowCallbacks.delete(callback)\n\n if (\n !windowCallbacks.size &&\n typeof windowResizeHandler === \"function\"\n ) {\n window.removeEventListener(\"resize\", windowResizeHandler)\n windowResizeHandler = undefined\n }\n }\n}\n"],"names":[],"mappings":"AAEA,MAAM,eAAe,GAAG,IAAI,GAAG,EAAuB;AAEtD,IAAI,mBAA6C;AAEjD,SAAS,yBAAyB,GAAA;IAC9B,mBAAmB,GAAG,MAAK;AACvB,QAAA,MAAM,IAAI,GAAG;AACT,YAAA,IAAI,KAAK,GAAA;gBACL,OAAO,MAAM,CAAC,UAAU;YAC5B,CAAC;AACD,YAAA,IAAI,MAAM,GAAA;gBACN,OAAO,MAAM,CAAC,WAAW;YAC7B,CAAC;SACJ;AAED,QAAA,eAAe,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC;AACzD,IAAA,CAAC;AAED,IAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB,CAAC;AAC1D;AAEM,SAAU,YAAY,CAAC,QAA6B,EAAA;AACtD,IAAA,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC;AAE7B,IAAA,IAAI,CAAC,mBAAmB;AAAE,QAAA,yBAAyB,EAAE;AAErD,IAAA,OAAO,MAAK;AACR,QAAA,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC;QAEhC,IACI,CAAC,eAAe,CAAC,IAAI;AACrB,YAAA,OAAO,mBAAmB,KAAK,UAAU,EAC3C;AACE,YAAA,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,CAAC;YACzD,mBAAmB,GAAG,SAAS;QACnC;AACJ,IAAA,CAAC;AACL;;;;"}
@@ -0,0 +1,4 @@
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unsafeOfAnyTypeAssertion" | "unsafeToAnyTypeAssertion" | "unsafeToUnconstrainedTypeAssertion" | "unsafeTypeAssertion" | "unsafeTypeAssertionAssignableToConstraint", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,37 @@
import fs from "node:fs/promises";
import { describe, it, expect } from "vitest";
import { parseFeed } from "./index.js";
const documents = new URL("__fixtures__/Documents/", import.meta.url);
describe("parseFeed", () => {
it("(rssFeed)", async () =>
expect(
parseFeed(
await fs.readFile(
new URL("RSS_Example.xml", documents),
"utf8",
),
),
).toMatchSnapshot());
it("(atomFeed)", async () =>
expect(
parseFeed(
await fs.readFile(
new URL("Atom_Example.xml", documents),
"utf8",
),
),
).toMatchSnapshot());
it("(rdfFeed)", async () =>
expect(
parseFeed(
await fs.readFile(
new URL("RDF_Example.xml", documents),
"utf8",
),
),
).toMatchSnapshot());
});
@@ -0,0 +1,347 @@
import * as common from './common';
/**
* Represents an IPv4 address
* @param {string} address - An IPv4 address string
*/
export declare class Address4 {
address: string;
addressMinusSuffix: string;
groups: number;
parsedAddress: string[];
parsedSubnet: string;
subnet: string;
subnetMask: number;
v4: boolean;
private _binaryZeroPad?;
constructor(address: string);
/**
* Returns true if the given string is a valid IPv4 address (with optional
* CIDR subnet), false otherwise. Host bits in the subnet portion are
* allowed (e.g. `192.168.1.5/24` is valid); for strict network-address
* validation compare `correctForm()` to `startAddress().correctForm()`,
* or use `networkForm()`.
*/
static isValid(address: string): boolean;
/**
* Parses an IPv4 address string into its four octet groups and stores the
* result on `this.parsedAddress`. Called automatically by the constructor;
* you typically don't need to call it directly. Throws `AddressError` if
* the input is not a valid IPv4 address.
*/
parse(address: string): string[];
/**
* Returns the address in correct form: octets joined with `.` and any
* leading zeros stripped (e.g. `192.168.1.1`). For IPv4 this matches the
* canonical dotted-decimal representation.
*/
correctForm(): string;
/**
* Returns true if the address is correct, false otherwise
* @returns {Boolean}
*/
isCorrect: (this: Address4 | import("./ipv6").Address6) => boolean;
/**
* Construct an `Address4` from an address and a dotted-decimal subnet
* mask given as separate strings (e.g. as returned by Node's
* `os.networkInterfaces()`). Throws `AddressError` if the mask is
* non-contiguous (e.g. `255.0.255.0`).
* @example
* var address = Address4.fromAddressAndMask('192.168.1.1', '255.255.255.0');
* address.subnetMask; // 24
*/
static fromAddressAndMask(address: string, mask: string): Address4;
/**
* Construct an `Address4` from an address and a Cisco-style wildcard mask
* given as separate strings (e.g. `0.0.0.255` for a `/24`). The wildcard
* mask is the bitwise inverse of the subnet mask. Throws `AddressError`
* if the mask is non-contiguous (e.g. `0.255.0.255`).
* @example
* var address = Address4.fromAddressAndWildcardMask('10.0.0.1', '0.0.0.255');
* address.subnetMask; // 24
*/
static fromAddressAndWildcardMask(address: string, wildcardMask: string): Address4;
/**
* Construct an `Address4` from a wildcard pattern with trailing `*`
* octets. The number of trailing wildcards determines the prefix
* length: each `*` represents 8 bits.
*
* Only trailing whole-octet wildcards are supported. Partial-octet
* wildcards (e.g. `192.168.0.1*`) and interior wildcards (e.g.
* `192.*.0.1`) throw `AddressError`.
* @example
* Address4.fromWildcard('192.168.0.*').subnet; // '/24'
* Address4.fromWildcard('192.168.*.*').subnet; // '/16'
* Address4.fromWildcard('*.*.*.*').subnet; // '/0'
*/
static fromWildcard(input: string): Address4;
/**
* Converts a hex string to an IPv4 address object. Accepts 8 hex digits
* with optional `:` separators (e.g. `'7f000001'` or `'7f:00:00:01'`).
* Throws `AddressError` for any other length or for non-hex characters.
* @param {string} hex - a hex string to convert
* @returns {Address4}
*/
static fromHex(hex: string): Address4;
/**
* Converts an integer into a IPv4 address object. The integer must be a
* non-negative safe integer in the range `[0, 2**32 - 1]`; otherwise
* `AddressError` is thrown.
* @param {integer} integer - a number to convert
* @returns {Address4}
*/
static fromInteger(integer: number): Address4;
/**
* Return an address from in-addr.arpa form: the four octets reversed, with
* or without the `.in-addr.arpa` suffix and root dot, in any case. Throws
* `AddressError` unless the reversed labels form a valid IPv4 address, so
* `fromArpa(x.reverseForm())` round-trips {@link reverseForm}.
* @param {string} arpaFormAddress - an 'in-addr.arpa' form ipv4 address
* @returns {Adress4}
* @example
* var address = Address4.fromArpa('42.2.0.192.in-addr.arpa.')
* address.correctForm(); // '192.0.2.42'
*/
static fromArpa(arpaFormAddress: string): Address4;
/**
* Converts an IPv4 address object to a hex string
* @returns {String}
*/
toHex(): string;
/**
* Converts an IPv4 address object to an array of bytes.
*
* To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toArray())`.
* @returns {Array}
*/
toArray(): number[];
/**
* Converts an IPv4 address object to an IPv6 address group
* @returns {String}
*/
toGroup6(): string;
/**
* Returns the address as a `bigint`
* @returns {bigint}
*/
bigInt(): bigint;
/**
* Helper function getting start address.
* @returns {bigint}
*/
_startAddress(): bigint;
/**
* The first address in the range given by this address' subnet.
* Often referred to as the Network Address.
* @returns {Address4}
*/
startAddress(): Address4;
/**
* The first host address in the range given by this address's subnet ie
* the first address after the Network Address
* @returns {Address4}
*/
startAddressExclusive(): Address4;
/**
* Returns the address `n` addresses after this one (or before, when `n` is
* negative), keeping this address's subnet mask. Throws `AddressError` when
* the result would fall outside the IPv4 address space or `n` is not an
* integer.
* @param {number | bigint} n
* @returns {Address4}
* @example
* new Address4('10.0.0.0/24').offset(1).correctForm(); // '10.0.0.1'
*/
offset(n: number | bigint): Address4;
/**
* Returns the network that follows this address's network: the address after
* {@link endAddress}, with the same subnet mask. Throws `AddressError` when
* this network is the last one in the address space.
* @returns {Address4}
* @example
* new Address4('10.0.0.0/24').nextNetwork().networkForm(); // '10.0.1.0/24'
*/
nextNetwork(): Address4;
private withSubnetMask;
/**
* Helper function getting end address.
* @returns {bigint}
*/
_endAddress(): bigint;
/**
* The last address in the range given by this address' subnet
* Often referred to as the Broadcast
* @returns {Address4}
*/
endAddress(): Address4;
/**
* The last host address in the range given by this address's subnet ie
* the last address prior to the Broadcast Address
* @returns {Address4}
*/
endAddressExclusive(): Address4;
/**
* The dotted-decimal form of the subnet mask, e.g. `255.255.240.0` for
* a `/20`. Returns an `Address4`; call `.correctForm()` for the string.
* @returns {Address4}
*/
subnetMaskAddress(): Address4;
/**
* The Cisco-style wildcard mask, e.g. `0.0.0.255` for a `/24`. This is
* the bitwise inverse of `subnetMaskAddress()`. Returns an `Address4`;
* call `.correctForm()` for the string.
* @returns {Address4}
*/
wildcardMask(): Address4;
/**
* The network address in CIDR string form, e.g. `192.168.1.0/24` for
* `192.168.1.5/24`. For an address with no explicit subnet the prefix is
* `/32`, e.g. `networkForm()` on `192.168.1.5` returns `192.168.1.5/32`.
* @returns {string}
*/
networkForm(): string;
/**
* Converts a BigInt to a v4 address object. The value must be in the
* range `[0, 2**32 - 1]`; otherwise `AddressError` is thrown.
* @param {bigint} bigInt - a BigInt to convert
* @returns {Address4}
*/
static fromBigInt(bigInt: bigint): Address4;
/**
* Convert a byte array to an Address4 object. Throws `AddressError` unless
* given exactly 4 integers from 0 to 255. Signed bytes are rejected, so
* this differs from `Address6.fromByteArray`, which folds them; the two
* contracts converge on this stricter form in the next major version.
*
* To convert from a Node.js `Buffer`, spread it: `Address4.fromByteArray([...buf])`.
* @param {Array<number>} bytes - an array of 4 bytes (0-255)
* @returns {Address4}
*/
static fromByteArray(bytes: Array<number>): Address4;
/**
* Convert an unsigned byte array to an Address4 object. Throws
* `AddressError` unless given exactly 4 bytes, and rejects values outside
* 0 to 255 when parsing the resulting address.
*
* To convert from a Node.js `Buffer`, spread it:
* `Address4.fromUnsignedByteArray([...buf])`.
* @param {Array<number>} bytes - an array of 4 unsigned bytes (0-255)
* @returns {Address4}
*/
static fromUnsignedByteArray(bytes: Array<number>): Address4;
/**
* Returns the first n bits of the address, defaulting to the
* subnet mask
* @returns {String}
*/
mask(mask?: number): string;
/**
* Returns the bits in the given range as a base-2 string
* @returns {string}
*/
getBitsBase2(start: number, end: number): string;
/**
* Return the reversed in-addr.arpa form of the address, e.g.
* `42.2.0.192.in-addr.arpa.` for `192.0.2.42`.
* @param {Object} options
* @param {boolean} options.omitSuffix - omit the "in-addr.arpa" suffix
* @returns {String}
*/
reverseForm(options?: common.ReverseFormOptions): string;
/**
* Returns true if the given address is in the subnet of the current address.
* An `Address6` is never in the subnet of an `Address4`; convert with
* `to4()` or `Address6.fromAddress4()` to compare across families.
* @returns {boolean}
*/
isInSubnet: typeof common.isInSubnet;
/**
* Returns true if this address's host bits fall inside the given subnet,
* ignoring this address's own subnet mask. Prefer this over `isInSubnet`
* when classifying a single address, so the answer doesn't change with the
* CIDR suffix the caller happened to write — notably when the address came
* from untrusted input and the result backs a trust-boundary decision.
* An `Address6` is never in the subnet of an `Address4`; convert with
* `to4()` or `Address6.fromAddress4()` to compare across families.
* @returns {boolean}
*/
isHostInSubnet: typeof common.isHostInSubnet;
/**
* Returns true if the given address is a multicast address
* @returns {boolean}
*/
isMulticast(): boolean;
/**
* Returns true if the address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private address ranges (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`).
* @returns {boolean}
*/
isPrivate(): boolean;
/**
* Returns true if the address is in the loopback range `127.0.0.0/8` ([RFC 1122](https://datatracker.ietf.org/doc/html/rfc1122)).
* @returns {boolean}
*/
isLoopback(): boolean;
/**
* Returns true if the address is in the link-local range `169.254.0.0/16` ([RFC 3927](https://datatracker.ietf.org/doc/html/rfc3927)).
* @returns {boolean}
*/
isLinkLocal(): boolean;
/**
* Returns true if the address is the unspecified address `0.0.0.0`.
* @returns {boolean}
*/
isUnspecified(): boolean;
/**
* Returns true if the address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)).
* @returns {boolean}
*/
isBroadcast(): boolean;
/**
* Returns true if the address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)).
* @returns {boolean}
*/
isCGNAT(): boolean;
/**
* Returns true if the address is in one of the documentation ranges
* `192.0.2.0/24`, `198.51.100.0/24`, or `203.0.113.0/24` ([RFC 5737](https://datatracker.ietf.org/doc/html/rfc5737)).
* @returns {boolean}
*/
isDocumentation(): boolean;
/**
* Returns true if the address is in the benchmarking range `198.18.0.0/15` ([RFC 2544](https://datatracker.ietf.org/doc/html/rfc2544)).
* @returns {boolean}
*/
isBenchmarking(): boolean;
/**
* Returns true if the address is in the reserved range `240.0.0.0/4` ([RFC 1112](https://datatracker.ietf.org/doc/html/rfc1112)),
* which includes the limited broadcast address.
* @returns {boolean}
*/
isReserved(): boolean;
/**
* Returns true if the address is globally reachable: not multicast, and not
* in any block the [IANA IPv4 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv4-special-registry/)
* marks as not globally reachable. That covers everything the individual
* classifiers name (private, loopback, link-local, CGNAT, unspecified,
* broadcast, documentation, benchmarking, reserved) and the blocks they do
* not, such as `0.0.0.0/8` and the IETF protocol assignments in
* `192.0.0.0/24`. This is the single predicate to use where a request must
* not reach an internal or special-purpose destination; see SECURITY.md.
* @returns {boolean}
*/
isGlobal(): boolean;
/**
* Returns a zero-padded base-2 string representation of the address
* @returns {string}
*/
binaryZeroPad(): string;
/**
* Groups an IPv4 address for inclusion at the end of an IPv6 address.
*
* Returns an HTML fragment: each half of the address is wrapped in a
* `<span>` carrying the group classes an address-inspector UI hovers on.
* The address content is HTML-escaped; anything you concatenate around it
* is your responsibility.
* @returns {String}
*/
groupForV6(): string;
}
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/use-effect-event.tsx"],
"sourcesContent": ["/* eslint-disable react-hooks/rules-of-hooks */\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport * as React from 'react';\n\ntype AnyFunction = (...args: any[]) => any;\n\n// See https://github.com/webpack/webpack/issues/14814\nconst useReactEffectEvent = (React as any)[' useEffectEvent '.trim().toString()];\nconst useReactInsertionEffect = (React as any)[' useInsertionEffect '.trim().toString()];\n\n/**\n * Designed to approximate the behavior on `experimental_useEffectEvent` as best\n * as possible until its stable release, and back-fill it as a shim as needed.\n */\nexport function useEffectEvent<T extends AnyFunction>(callback?: T): T {\n if (typeof useReactEffectEvent === 'function') {\n return useReactEffectEvent(callback);\n }\n\n const ref = React.useRef<AnyFunction | undefined>(() => {\n throw new Error('Cannot call an event handler while rendering.');\n });\n // See https://github.com/webpack/webpack/issues/14814\n if (typeof useReactInsertionEffect === 'function') {\n useReactInsertionEffect(() => {\n ref.current = callback;\n });\n } else {\n useLayoutEffect(() => {\n ref.current = callback;\n });\n }\n\n // https://github.com/facebook/react/issues/19240\n return React.useMemo(() => ((...args) => ref.current?.(...args)) as T, []);\n}\n"],
"mappings": ";AACA,SAAS,uBAAuB;AAChC,YAAY,WAAW;AAKvB,IAAM,sBAAuB,MAAc,mBAAmB,KAAK,EAAE,SAAS,CAAC;AAC/E,IAAM,0BAA2B,MAAc,uBAAuB,KAAK,EAAE,SAAS,CAAC;AAMhF,SAAS,eAAsC,UAAiB;AACrE,MAAI,OAAO,wBAAwB,YAAY;AAC7C,WAAO,oBAAoB,QAAQ;AAAA,EACrC;AAEA,QAAM,MAAY,aAAgC,MAAM;AACtD,UAAM,IAAI,MAAM,+CAA+C;AAAA,EACjE,CAAC;AAED,MAAI,OAAO,4BAA4B,YAAY;AACjD,4BAAwB,MAAM;AAC5B,UAAI,UAAU;AAAA,IAChB,CAAC;AAAA,EACH,OAAO;AACL,oBAAgB,MAAM;AACpB,UAAI,UAAU;AAAA,IAChB,CAAC;AAAA,EACH;AAGA,SAAa,cAAQ,MAAO,IAAI,SAAS,IAAI,UAAU,GAAG,IAAI,GAAS,CAAC,CAAC;AAC3E;",
"names": []
}
@@ -0,0 +1 @@
{"version":3,"file":"receipt-cent.js","sources":["../../../src/icons/receipt-cent.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ReceiptCent\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAydjIwbDItMSAyIDEgMi0xIDIgMSAyLTEgMiAxIDItMSAyIDFWMmwtMiAxLTItMS0yIDEtMi0xLTIgMS0yLTEtMiAxWiIgLz4KICA8cGF0aCBkPSJNMTIgNi41djExIiAvPgogIDxwYXRoIGQ9Ik0xNSA5LjRhNCA0IDAgMSAwIDAgNS4yIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/receipt-cent\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 ReceiptCent = createLucideIcon('ReceiptCent', [\n [\n 'path',\n { d: 'M4 2v20l2-1 2 1 2-1 2 1 2-1 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,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC1D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,61 @@
//#region src/middleware/etag/digest.ts
const mergeBuffers = (buffer1, buffer2) => {
if (!buffer1) return buffer2;
const merged = new Uint8Array(new ArrayBuffer(buffer1.byteLength + buffer2.byteLength));
merged.set(new Uint8Array(buffer1), 0);
merged.set(buffer2, buffer1.byteLength);
return merged;
};
const CHUNK_SIZE = 262144;
const generateDigest = async (stream, generator) => {
if (!stream) return null;
let result = void 0;
let chunk;
let chunkLength = 0;
const digest = async (body) => {
result = await generator(mergeBuffers(result, body));
};
const reader = stream.getReader();
for (;;) {
const { value, done } = await reader.read();
if (done) break;
let offset = 0;
while (offset < value.byteLength) {
const remaining = value.byteLength - offset;
if (chunkLength === 0 && remaining >= CHUNK_SIZE) {
await digest(value.subarray(offset, offset + CHUNK_SIZE));
offset += CHUNK_SIZE;
continue;
}
const requiredLength = chunkLength + remaining;
if (requiredLength < CHUNK_SIZE) {
if (!chunk) chunk = value.slice(offset);
else {
if (chunk.byteLength < requiredLength) {
const nextChunk = new Uint8Array(new ArrayBuffer(Math.min(CHUNK_SIZE, Math.max(requiredLength, chunk.byteLength * 2))));
nextChunk.set(chunk.subarray(0, chunkLength));
chunk = nextChunk;
}
chunk.set(value.subarray(offset), chunkLength);
}
chunkLength = requiredLength;
break;
}
const length = CHUNK_SIZE - chunkLength;
if (chunk?.byteLength !== CHUNK_SIZE) {
const nextChunk = new Uint8Array(/* @__PURE__ */ new ArrayBuffer(CHUNK_SIZE));
if (chunk) nextChunk.set(chunk.subarray(0, chunkLength));
chunk = nextChunk;
}
chunk.set(value.subarray(offset, offset + length), chunkLength);
await digest(chunk);
chunkLength = 0;
offset += length;
}
}
if (chunk && chunkLength > 0) await digest(chunk.subarray(0, chunkLength));
if (!result) return null;
return Array.prototype.map.call(new Uint8Array(result), (x) => x.toString(16).padStart(2, "0")).join("");
};
//#endregion
export { generateDigest };
@@ -0,0 +1,179 @@
/**
* @fileoverview Rule to enforce consistent naming of "this" context variables
* @author Raphael Pigulla
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"Enforce consistent naming when capturing the current execution context",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/consistent-this",
},
schema: {
type: "array",
items: {
type: "string",
minLength: 1,
},
uniqueItems: true,
},
defaultOptions: ["that"],
messages: {
aliasNotAssignedToThis:
"Designated alias '{{name}}' is not assigned to 'this'.",
unexpectedAlias: "Unexpected alias '{{name}}' for 'this'.",
},
},
create(context) {
const aliases = context.options;
const sourceCode = context.sourceCode;
/**
* Reports that a variable declarator or assignment expression is assigning
* a non-'this' value to the specified alias.
* @param {ASTNode} node The assigning node.
* @param {string} name the name of the alias that was incorrectly used.
* @returns {void}
*/
function reportBadAssignment(node, name) {
context.report({
node,
messageId: "aliasNotAssignedToThis",
data: { name },
});
}
/**
* Checks that an assignment to an identifier only assigns 'this' to the
* appropriate alias, and the alias is only assigned to 'this'.
* @param {ASTNode} node The assigning node.
* @param {Identifier} name The name of the variable assigned to.
* @param {Expression} value The value of the assignment.
* @returns {void}
*/
function checkAssignment(node, name, value) {
const isThis = value.type === "ThisExpression";
if (aliases.includes(name)) {
if (!isThis || (node.operator && node.operator !== "=")) {
reportBadAssignment(node, name);
}
} else if (isThis) {
context.report({
node,
messageId: "unexpectedAlias",
data: { name },
});
}
}
/**
* Ensures that a variable declaration of the alias in a program or function
* is assigned to the correct value.
* @param {string} alias alias the check the assignment of.
* @param {Object} scope scope of the current code we are checking.
* @private
* @returns {void}
*/
function checkWasAssigned(alias, scope) {
const variable = scope.set.get(alias);
if (!variable) {
return;
}
if (
variable.defs.some(
def =>
def.node.type === "VariableDeclarator" &&
def.node.init !== null,
)
) {
return;
}
/*
* The alias has been declared and not assigned: check it was
* assigned later in the same scope.
*/
if (
!variable.references.some(reference => {
const write = reference.writeExpr;
return (
reference.from === scope &&
write &&
write.type === "ThisExpression" &&
write.parent.operator === "="
);
})
) {
variable.defs
.map(def => def.node)
.forEach(node => {
reportBadAssignment(node, alias);
});
}
}
/**
* Check each alias to ensure that is was assigned to the correct value.
* @param {ASTNode} node The node that represents the scope to check.
* @returns {void}
*/
function ensureWasAssigned(node) {
const scope = sourceCode.getScope(node);
// if this is program scope we also need to check module scope
const extraScope =
node.type === "Program" && node.sourceType === "module"
? scope.childScopes[0]
: null;
aliases.forEach(alias => {
checkWasAssigned(alias, scope);
if (extraScope) {
checkWasAssigned(alias, extraScope);
}
});
}
return {
"Program:exit": ensureWasAssigned,
"FunctionExpression:exit": ensureWasAssigned,
"FunctionDeclaration:exit": ensureWasAssigned,
VariableDeclarator(node) {
const id = node.id;
const isDestructuring =
id.type === "ArrayPattern" || id.type === "ObjectPattern";
if (node.init !== null && !isDestructuring) {
checkAssignment(node, id.name, node.init);
}
},
AssignmentExpression(node) {
if (node.left.type === "Identifier") {
checkAssignment(node, node.left.name, node.right);
}
},
};
},
};
@@ -0,0 +1,47 @@
'use strict'
let Container = require('./container')
let { my } = require('./symbols')
class Warning {
constructor(text, opts = {}) {
this.type = 'warning'
this.text = text
if (opts.node && opts.node.source) {
if (!opts.node[my]) {
// The node comes from another PostCSS copy in node_modules, so it does
// not have this copy’s methods. Container#normalize() rebuilds such
// nodes on insert, but a node passed straight to Result#warn() never
// goes through it.
Container.rebuild(opts.node)
}
let range = opts.node.rangeBy(opts)
this.line = range.start.line
this.column = range.start.column
this.endLine = range.end.line
this.endColumn = range.end.column
}
for (let opt in opts) this[opt] = opts[opt]
}
toString() {
if (this.node) {
return this.node.error(this.text, {
index: this.index,
plugin: this.plugin,
word: this.word
}).message
}
if (this.plugin) {
return this.plugin + ': ' + this.text
}
return this.text
}
}
module.exports = Warning
Warning.default = Warning
@@ -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 Ligature = createLucideIcon("Ligature", [
["path", { d: "M8 20V8c0-2.2 1.8-4 4-4 1.5 0 2.8.8 3.5 2", key: "1rtphz" }],
["path", { d: "M6 12h4", key: "a4o3ry" }],
["path", { d: "M14 12h2v8", key: "c1fccl" }],
["path", { d: "M6 20h4", key: "1i6q5t" }],
["path", { d: "M14 20h4", key: "lzx1xo" }]
]);
export { Ligature as default };
//# sourceMappingURL=ligature.js.map
@@ -0,0 +1,68 @@
import { checkSync } from "recheck";
import { expect, test } from "vitest";
import * as z from "zod/v4";
const { regexes } = z.core;
/** Every pattern `core/regexes.ts` ships, with the parameterized ones materialized across their argument space. */
function allPatterns(): [string, RegExp][] {
const patterns: [string, RegExp][] = [];
for (const [name, value] of Object.entries(regexes)) {
if (value instanceof RegExp) patterns.push([name, value]);
}
patterns.push(
["emoji()", regexes.emoji()],
["mac()", regexes.mac()],
["mac('-')", regexes.mac("-")],
["uuid()", regexes.uuid()],
["string()", regexes.string()],
["string({min,max})", regexes.string({ minimum: 1, maximum: 10 })]
);
for (const version of [1, 2, 3, 4, 5, 6, 7, 8]) patterns.push([`uuid(${version})`, regexes.uuid(version)]);
for (const precision of [null, -1, 0, 3, 6]) {
patterns.push([`time(${precision})`, regexes.time({ precision })]);
for (const local of [false, true]) {
for (const offset of [false, true]) {
patterns.push([`datetime(${precision},${local},${offset})`, regexes.datetime({ precision, local, offset })]);
}
}
}
return patterns;
}
test("no built-in pattern is ReDoS-vulnerable", () => {
const patterns = allPatterns();
// Guards against the reflection above silently going empty if the module layout changes.
expect(patterns.length).toBeGreaterThan(80);
const vulnerable: string[] = [];
for (const [name, pattern] of patterns) {
// Flags are load-bearing. Without "u" the checker reads `\p{...}` as a literal `p{...}` and reports an exponential pattern as safe.
const result = checkSync(pattern.source, pattern.flags);
// "unknown" means the checker gave up, not that the pattern is vulnerable.
if (result.status !== "vulnerable") continue;
// The fuzz checker derives "vulnerable" from how long an attack string runs, so CPU contention from parallel test files can flip a safe pattern. Confirm with a budget large enough that only real backtracking can exhaust it.
const confirmed = checkSync(pattern.source, pattern.flags, { attackTimeout: 10_000 });
if (confirmed.status === "vulnerable") vulnerable.push(`${name}: ${pattern.source}`);
}
expect(vulnerable).toEqual([]);
}, 60000);
test("emoji rejects a backtracking payload in linear time", () => {
// U+1F9B0-U+1F9B3 are the only code points in both \p{Extended_Pictographic} and \p{Emoji_Component}. A failing match over them used to backtrack exponentially: 26 of them took ~1.9s, and each additional character roughly doubled it.
const schema = z.emoji();
const payload = `${"🦰".repeat(26)} `;
// Warm up first, then take the best of three: a cold first call is dominated by JIT and can cost hundreds of times the steady-state match on a loaded machine.
expect(schema.safeParse(payload).success).toBe(false);
let best = Number.POSITIVE_INFINITY;
for (let i = 0; i < 3; i++) {
const start = performance.now();
schema.safeParse(payload);
best = Math.min(best, performance.now() - start);
}
// The linear pattern matches in well under a millisecond, so this budget leaves three orders of magnitude of headroom for CPU contention while still catching the exponential regression.
expect(best).toBeLessThan(500);
});
@@ -0,0 +1,22 @@
import * as React from 'react';
declare module 'react' {
interface ReactElement {
$$typeof?: symbol | string;
}
}
interface SlotProps extends React.HTMLAttributes<HTMLElement> {
children?: React.ReactNode;
}
declare function createSlot(ownerName: string): React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
interface SlottableProps {
children: React.ReactNode;
}
interface SlottableComponent extends React.FC<SlottableProps> {
__radixId: symbol;
}
declare function createSlottable(ownerName: string): SlottableComponent;
declare const Slottable: SlottableComponent;
export { Slot as Root, Slot, type SlotProps, Slottable, createSlot, createSlottable };
@@ -0,0 +1,21 @@
/**
* @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 Hexagon = createLucideIcon("Hexagon", [
[
"path",
{
d: "M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",
key: "yt0hxn"
}
]
]);
export { Hexagon as default };
//# sourceMappingURL=hexagon.js.map
@@ -0,0 +1 @@
{"version":3,"file":"file-x.js","sources":["../../../src/icons/file-x.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileX\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgMkg2YTIgMiAwIDAgMC0yIDJ2MTZhMiAyIDAgMCAwIDIgMmgxMmEyIDIgMCAwIDAgMi0yVjdaIiAvPgogIDxwYXRoIGQ9Ik0xNCAydjRhMiAyIDAgMCAwIDIgMmg0IiAvPgogIDxwYXRoIGQ9Im0xNC41IDEyLjUtNSA1IiAvPgogIDxwYXRoIGQ9Im05LjUgMTIuNSA1IDUiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/file-x\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 FileX = createLucideIcon('FileX', [\n ['path', { d: 'M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z', key: '1rqfz7' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n ['path', { d: 'm14.5 12.5-5 5', key: 'b62r18' }],\n ['path', { d: 'm9.5 12.5 5 5', key: '1rk7el' }],\n]);\n\nexport default FileX;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC3F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,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,CAC/C,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;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,7 @@
import type { Token } from "./parser/tokenizer";
export default class NameManager {
private readonly usedNames;
constructor(code: string, tokens: Array<Token>);
claimFreeName(name: string): string;
findFreeName(name: string): string;
}
@@ -0,0 +1,19 @@
"use strict";
/**
* Experimental task interfaces for MCP SDK.
* WARNING: These APIs are experimental and may change without notice.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.isTerminal = isTerminal;
/**
* Checks if a task status represents a terminal state.
* Terminal states are those where the task has finished and will not change.
*
* @param status - The task status to check
* @returns True if the status is terminal (completed, failed, or cancelled)
* @experimental
*/
function isTerminal(status) {
return status === 'completed' || status === 'failed' || status === 'cancelled';
}
//# sourceMappingURL=interfaces.js.map
@@ -0,0 +1,7 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_adapter_cloudflare_workers_conninfo = require("./conninfo.js");
const require_adapter_cloudflare_workers_serve_static_module = require("./serve-static-module.js");
const require_adapter_cloudflare_workers_websocket = require("./websocket.js");
exports.getConnInfo = require_adapter_cloudflare_workers_conninfo.getConnInfo;
exports.serveStatic = require_adapter_cloudflare_workers_serve_static_module.serveStatic;
exports.upgradeWebSocket = require_adapter_cloudflare_workers_websocket.upgradeWebSocket;
@@ -0,0 +1,92 @@
import { Plugin, PluginInfo, SerovalNode } from 'seroval';
import { RegisteredConfigType, RegisteredSsr, SSROption } from '../../router.cjs';
import { LooseReturnType } from '../../utils.cjs';
import { AnyRoute, ResolveAllSSR } from '../../route.cjs';
import { RawStream } from './RawStream.cjs';
declare const TSR_SERIALIZABLE: unique symbol;
export type TSR_SERIALIZABLE = typeof TSR_SERIALIZABLE;
export type TsrSerializable = {
[TSR_SERIALIZABLE]: true;
};
export interface DefaultSerializable {
number: number;
string: string;
boolean: boolean;
null: null;
undefined: undefined;
bigint: bigint;
Date: Date;
Uint8Array: Uint8Array;
RawStream: RawStream;
TsrSerializable: TsrSerializable;
void: void;
}
export interface SerializableExtensions extends DefaultSerializable {
}
export type Serializable = SerializableExtensions[keyof SerializableExtensions];
export type UnionizeSerializationAdaptersInput<TAdapters extends ReadonlyArray<AnySerializationAdapter>> = TAdapters[number]['~types']['input'];
/**
* Create a strongly-typed serialization adapter for SSR hydration.
* Use to register custom types with the router serializer.
*/
export declare function createSerializationAdapter<TInput = unknown, TOutput = unknown, const TExtendsAdapters extends ReadonlyArray<AnySerializationAdapter> | never = never>(opts: CreateSerializationAdapterOptions<TInput, TOutput, TExtendsAdapters>): SerializationAdapter<TInput, TOutput, TExtendsAdapters>;
export interface CreateSerializationAdapterOptions<TInput, TOutput, TExtendsAdapters extends ReadonlyArray<AnySerializationAdapter> | never> {
key: string;
extends?: TExtendsAdapters;
test: (value: unknown) => value is TInput;
toSerializable: (value: TInput) => ValidateSerializable<TOutput, Serializable | UnionizeSerializationAdaptersInput<TExtendsAdapters>>;
fromSerializable: (value: TOutput) => TInput;
}
export type ValidateSerializable<T, TSerializable> = T extends TSerializable ? T : T extends (...args: Array<any>) => any ? SerializationError<'Function may not be serializable'> : T extends RegisteredReadableStream ? SerializationError<'JSX is not be serializable'> : T extends ReadonlyArray<any> ? ValidateSerializableArray<T, TSerializable> : T extends Promise<any> ? ValidateSerializablePromise<T, TSerializable> : T extends ReadableStream<any> ? ValidateReadableStream<T, TSerializable> : T extends Set<any> ? ValidateSerializableSet<T, TSerializable> : T extends Map<any, any> ? ValidateSerializableMap<T, TSerializable> : T extends AsyncGenerator<any, any> ? ValidateSerializableAsyncGenerator<T, TSerializable> : T extends object ? ValidateSerializableMapped<T, TSerializable> : SerializationError<'Type may not be serializable'>;
export type ValidateSerializableAsyncGenerator<T, TSerializable> = T extends AsyncGenerator<infer T, infer TReturn, infer TNext> ? AsyncGenerator<ValidateSerializable<T, TSerializable>, ValidateSerializable<TReturn, TSerializable>, TNext> : never;
export type ValidateSerializablePromise<T, TSerializable> = T extends Promise<infer TAwaited> ? Promise<ValidateSerializable<TAwaited, TSerializable>> : never;
export type ValidateReadableStream<T, TSerializable> = T extends ReadableStream<infer TStreamed> ? ReadableStream<ValidateSerializable<TStreamed, TSerializable>> : never;
export type ValidateSerializableSet<T, TSerializable> = T extends Set<infer TItem> ? Set<ValidateSerializable<TItem, TSerializable>> : never;
export type ValidateSerializableMap<T, TSerializable> = T extends Map<infer TKey, infer TValue> ? Map<ValidateSerializable<TKey, TSerializable>, ValidateSerializable<TValue, TSerializable>> : never;
export type ValidateSerializableArray<T, TSerializable> = T extends readonly [
any,
...Array<any>
] ? ValidateSerializableMapped<T, TSerializable> : T extends Array<infer U> ? Array<ValidateSerializable<U, TSerializable>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<ValidateSerializable<U, TSerializable>> : never;
export type ValidateSerializableMapped<T, TSerializable> = {
[K in keyof T]: ValidateSerializable<T[K], TSerializable>;
};
declare const SERIALIZATION_ERROR: unique symbol;
export interface SerializationError<in out TMessage extends string> {
[SERIALIZATION_ERROR]: TMessage;
}
export interface SerializationAdapter<TInput, TOutput, TExtendsAdapters extends ReadonlyArray<AnySerializationAdapter>> {
'~types': SerializationAdapterTypes<TInput, TOutput, TExtendsAdapters>;
key: string;
extends?: TExtendsAdapters;
test: (value: unknown) => value is TInput;
toSerializable: (value: TInput) => TOutput;
fromSerializable: (value: TOutput) => TInput;
}
export interface SerializationAdapterTypes<TInput, TOutput, TExtendsAdapters extends ReadonlyArray<AnySerializationAdapter>> {
input: TInput | UnionizeSerializationAdaptersInput<TExtendsAdapters>;
output: TOutput;
extends: TExtendsAdapters;
}
export type AnySerializationAdapter = SerializationAdapter<any, any, any>;
export interface AdapterNode extends PluginInfo {
v: SerovalNode;
}
/** Create a Seroval plugin for server-side serialization only. */
export declare function makeSsrSerovalPlugin(serializationAdapter: AnySerializationAdapter, options: {
didRun: boolean;
}): Plugin<any, AdapterNode>;
/** Create a Seroval plugin for client/server symmetric (de)serialization. */
export declare function makeSerovalPlugin(serializationAdapter: AnySerializationAdapter): Plugin<any, AdapterNode>;
export type ValidateSerializableInput<TRegister, T> = ValidateSerializable<T, RegisteredSerializableInput<TRegister>>;
export type RegisteredSerializableInput<TRegister> = (unknown extends RegisteredSerializationAdapters<TRegister> ? never : RegisteredSerializationAdapters<TRegister> extends ReadonlyArray<AnySerializationAdapter> ? RegisteredSerializationAdapters<TRegister>[number]['~types']['input'] : never) | Serializable;
export type RegisteredSerializationAdapters<TRegister> = RegisteredConfigType<TRegister, 'serializationAdapters'>;
export type RegisteredSSROption<TRegister> = unknown extends RegisteredConfigType<TRegister, 'defaultSsr'> ? SSROption : RegisteredConfigType<TRegister, 'defaultSsr'>;
export type ValidateSerializableLifecycleResult<TRegister, TParentRoute extends AnyRoute, TSSR, TFn> = false extends RegisteredSsr<TRegister> ? any : ValidateSerializableLifecycleResultSSR<TRegister, TParentRoute, TSSR, TFn> extends infer TInput ? TInput : never;
export type ValidateSerializableLifecycleResultSSR<TRegister, TParentRoute extends AnyRoute, TSSR, TFn> = ResolveAllSSR<TParentRoute, TSSR> extends false ? any : RegisteredSSROption<TRegister> extends false ? any : ValidateSerializableInput<TRegister, LooseReturnType<TFn>>;
export type RegisteredReadableStream = unknown extends SerializerExtensions['ReadableStream'] ? never : SerializerExtensions['ReadableStream'];
export interface DefaultSerializerExtensions {
ReadableStream: unknown;
}
export interface SerializerExtensions extends DefaultSerializerExtensions {
}
export {};
@@ -0,0 +1,189 @@
import { K as isSingleLine, f as createRule } from "../utils.js";
const OPTIONS_SCHEMA = {
type: "object",
properties: {
code: {
type: "integer",
minimum: 0
},
comments: {
type: "integer",
minimum: 0
},
tabWidth: {
type: "integer",
minimum: 0
},
ignorePattern: { type: "string" },
ignoreComments: { type: "boolean" },
ignoreStrings: { type: "boolean" },
ignoreUrls: { type: "boolean" },
ignoreTemplateLiterals: { type: "boolean" },
ignoreRegExpLiterals: { type: "boolean" },
ignoreTrailingComments: { type: "boolean" }
},
additionalProperties: false
};
const OPTIONS_OR_INTEGER_SCHEMA = { anyOf: [OPTIONS_SCHEMA, {
type: "integer",
minimum: 0
}] };
var max_len_default = createRule({
name: "max-len",
meta: {
type: "layout",
docs: { description: "Enforce a maximum line length" },
schema: [
OPTIONS_OR_INTEGER_SCHEMA,
OPTIONS_OR_INTEGER_SCHEMA,
OPTIONS_SCHEMA
],
defaultOptions: [{
code: 80,
tabWidth: 4
}],
messages: {
max: "This line has a length of {{lineLength}}. Maximum allowed is {{maxLength}}.",
maxComment: "This line has a comment length of {{lineLength}}. Maximum allowed is {{maxCommentLength}}."
}
},
create(context) {
const URL_REGEXP = /[^:/?#]:\/\/[^?#]/u;
const sourceCode = context.sourceCode;
function computeLineLength(line, tabWidth) {
let extraCharacterCount = 0;
line.replace(/\t/gu, (_, offset) => {
const totalOffset = offset + extraCharacterCount;
const spaceCount = tabWidth - (tabWidth ? totalOffset % tabWidth : 0);
extraCharacterCount += spaceCount - 1;
return "";
});
return Array.from(line).length + extraCharacterCount;
}
const options = Object.assign({}, context.options[context.options.length - 1]);
if (typeof context.options[0] === "number") options.code = context.options[0];
if (typeof context.options[1] === "number") options.tabWidth = context.options[1];
const maxLength = typeof options.code === "number" ? options.code : 80;
const tabWidth = typeof options.tabWidth === "number" ? options.tabWidth : 4;
const ignoreComments = !!options.ignoreComments;
const ignoreStrings = !!options.ignoreStrings;
const ignoreTemplateLiterals = !!options.ignoreTemplateLiterals;
const ignoreRegExpLiterals = !!options.ignoreRegExpLiterals;
const ignoreTrailingComments = !!options.ignoreTrailingComments || !!options.ignoreComments;
const ignoreUrls = !!options.ignoreUrls;
const maxCommentLength = options.comments;
let ignorePattern = null;
if (options.ignorePattern) ignorePattern = new RegExp(options.ignorePattern, "u");
function isTrailingComment(line, lineNumber, comment) {
return comment && comment.loc.start.line === lineNumber && lineNumber <= comment.loc.end.line && (comment.loc.end.line > lineNumber || comment.loc.end.column === line.length);
}
function isFullLineComment(line, lineNumber, comment) {
const start = comment.loc.start;
const end = comment.loc.end;
const isFirstTokenOnLine = !line.slice(0, comment.loc.start.column).trim();
return comment && (start.line < lineNumber || start.line === lineNumber && isFirstTokenOnLine) && (end.line > lineNumber || end.line === lineNumber && end.column === line.length);
}
function isJSXEmptyExpressionInSingleLineContainer(node) {
if (!node || !node.parent || node.type !== "JSXEmptyExpression" || node.parent.type !== "JSXExpressionContainer") return false;
const parent = node.parent;
return isSingleLine(parent);
}
function stripTrailingComment(line, comment) {
return line.slice(0, comment.loc.start.column).replace(/\s+$/u, "");
}
function ensureArrayAndPush(object, key, value) {
if (!Array.isArray(object[key])) object[key] = [];
object[key].push(value);
}
function getAllStrings() {
return sourceCode.ast.tokens.filter((token) => token.type === "String" || token.type === "JSXText" && sourceCode.getNodeByRangeIndex(token.range[0] - 1).type === "JSXAttribute");
}
function getAllTemplateLiterals() {
return sourceCode.ast.tokens.filter((token) => token.type === "Template");
}
function getAllRegExpLiterals() {
return sourceCode.ast.tokens.filter((token) => token.type === "RegularExpression");
}
function groupArrayByLineNumber(arr) {
const obj = {};
for (let i = 0; i < arr.length; i++) {
const node = arr[i];
for (let j = node.loc.start.line; j <= node.loc.end.line; ++j) ensureArrayAndPush(obj, j, node);
}
return obj;
}
function getAllComments() {
const comments = [];
sourceCode.getAllComments().forEach((commentNode) => {
const containingNode = sourceCode.getNodeByRangeIndex(commentNode.range[0]);
if (isJSXEmptyExpressionInSingleLineContainer(containingNode)) {
if (comments[comments.length - 1] !== containingNode.parent) comments.push(containingNode.parent);
} else comments.push(commentNode);
});
return comments;
}
function checkProgramForMaxLength(node) {
const lines = sourceCode.lines;
const comments = ignoreComments || maxCommentLength || ignoreTrailingComments ? getAllComments() : [];
let commentsIndex = 0;
const stringsByLine = groupArrayByLineNumber(getAllStrings());
const templateLiteralsByLine = groupArrayByLineNumber(getAllTemplateLiterals());
const regExpLiteralsByLine = groupArrayByLineNumber(getAllRegExpLiterals());
lines.forEach((line, i) => {
const lineNumber = i + 1;
let lineIsComment = false;
let textToMeasure;
if (commentsIndex < comments.length) {
let comment = null;
do
comment = comments[++commentsIndex];
while (comment && comment.loc.start.line <= lineNumber);
comment = comments[--commentsIndex];
if (isFullLineComment(line, lineNumber, comment)) {
lineIsComment = true;
textToMeasure = line;
} else if (ignoreTrailingComments && isTrailingComment(line, lineNumber, comment)) {
textToMeasure = stripTrailingComment(line, comment);
let lastIndex = commentsIndex;
while (isTrailingComment(textToMeasure, lineNumber, comments[--lastIndex])) textToMeasure = stripTrailingComment(textToMeasure, comments[lastIndex]);
} else textToMeasure = line;
} else textToMeasure = line;
if (ignorePattern && ignorePattern.test(textToMeasure) || ignoreUrls && URL_REGEXP.test(textToMeasure) || ignoreStrings && stringsByLine[lineNumber] || ignoreTemplateLiterals && templateLiteralsByLine[lineNumber] || ignoreRegExpLiterals && regExpLiteralsByLine[lineNumber]) return;
const lineLength = computeLineLength(textToMeasure, tabWidth);
const commentLengthApplies = lineIsComment && maxCommentLength;
if (lineIsComment && ignoreComments) return;
const loc = {
start: {
line: lineNumber,
column: 0
},
end: {
line: lineNumber,
column: textToMeasure.length
}
};
if (commentLengthApplies) {
if (lineLength > maxCommentLength) context.report({
node,
loc,
messageId: "maxComment",
data: {
lineLength,
maxCommentLength
}
});
} else if (lineLength > maxLength) context.report({
node,
loc,
messageId: "max",
data: {
lineLength,
maxLength
}
});
});
}
return { Program: checkProgramForMaxLength };
}
});
export { max_len_default as t };
@@ -0,0 +1 @@
{"version":3,"file":"circle-arrow-out-up-right.js","sources":["../../../src/icons/circle-arrow-out-up-right.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CircleArrowOutUpRight\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjIgMTJBMTAgMTAgMCAxIDEgMTIgMiIgLz4KICA8cGF0aCBkPSJNMjIgMiAxMiAxMiIgLz4KICA8cGF0aCBkPSJNMTYgMmg2djYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/circle-arrow-out-up-right\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 CircleArrowOutUpRight = createLucideIcon('CircleArrowOutUpRight', [\n ['path', { d: 'M22 12A10 10 0 1 1 12 2', key: '1fm58d' }],\n ['path', { d: 'M22 2 12 12', key: 'yg2myt' }],\n ['path', { d: 'M16 2h6v6', key: 'zan5cs' }],\n]);\n\nexport default CircleArrowOutUpRight;\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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwB,iBAAiB,uBAAyB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5C,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,21 @@
/**
* @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 TrainTrack = createLucideIcon("TrainTrack", [
["path", { d: "M2 17 17 2", key: "18b09t" }],
["path", { d: "m2 14 8 8", key: "1gv9hu" }],
["path", { d: "m5 11 8 8", key: "189pqp" }],
["path", { d: "m8 8 8 8", key: "1imecy" }],
["path", { d: "m11 5 8 8", key: "ummqn6" }],
["path", { d: "m14 2 8 8", key: "1vk7dn" }],
["path", { d: "M7 22 22 7", key: "15mb1i" }]
]);
export { TrainTrack as default };
//# sourceMappingURL=train-track.js.map
@@ -0,0 +1,106 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const code_1 = require("../code");
const codegen_1 = require("../../compile/codegen");
const names_1 = require("../../compile/names");
const util_1 = require("../../compile/util");
const error = {
message: "must NOT have additional properties",
params: ({ params }) => (0, codegen_1._) `{additionalProperty: ${params.additionalProperty}}`,
};
const def = {
keyword: "additionalProperties",
type: ["object"],
schemaType: ["boolean", "object"],
allowUndefined: true,
trackErrors: true,
error,
code(cxt) {
const { gen, schema, parentSchema, data, errsCount, it } = cxt;
/* istanbul ignore if */
if (!errsCount)
throw new Error("ajv implementation error");
const { allErrors, opts } = it;
it.props = true;
if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema))
return;
const props = (0, code_1.allSchemaProperties)(parentSchema.properties);
const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);
checkAdditionalProperties();
cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);
function checkAdditionalProperties() {
gen.forIn("key", data, (key) => {
if (!props.length && !patProps.length)
additionalPropertyCode(key);
else
gen.if(isAdditional(key), () => additionalPropertyCode(key));
});
}
function isAdditional(key) {
let definedProp;
if (props.length > 8) {
// TODO maybe an option instead of hard-coded 8?
const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);
}
else if (props.length) {
definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._) `${key} === ${p}`));
}
else {
definedProp = codegen_1.nil;
}
if (patProps.length) {
definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._) `${(0, code_1.usePattern)(cxt, p)}.test(${key})`));
}
return (0, codegen_1.not)(definedProp);
}
function deleteAdditional(key) {
gen.code((0, codegen_1._) `delete ${data}[${key}]`);
}
function additionalPropertyCode(key) {
if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) {
deleteAdditional(key);
return;
}
if (schema === false) {
cxt.setParams({ additionalProperty: key });
cxt.error();
if (!allErrors)
gen.break();
return;
}
if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
const valid = gen.name("valid");
if (opts.removeAdditional === "failing") {
applyAdditionalSchema(key, valid, false);
gen.if((0, codegen_1.not)(valid), () => {
cxt.reset();
deleteAdditional(key);
});
}
else {
applyAdditionalSchema(key, valid);
if (!allErrors)
gen.if((0, codegen_1.not)(valid), () => gen.break());
}
}
}
function applyAdditionalSchema(key, valid, errors) {
const subschema = {
keyword: "additionalProperties",
dataProp: key,
dataPropType: util_1.Type.Str,
};
if (errors === false) {
Object.assign(subschema, {
compositeRule: true,
createErrors: false,
allErrors: false,
});
}
cxt.subschema(subschema, valid);
}
},
};
exports.default = def;
//# sourceMappingURL=additionalProperties.js.map
@@ -0,0 +1,10 @@
'use strict';
var bind = require('function-bind');
var $apply = require('./functionApply');
var actualApply = require('./actualApply');
/** @type {import('./applyBind')} */
module.exports = function applyBind() {
return actualApply(bind, $apply, arguments);
};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_CM","2":"_oL"},D:{"1":"_aE","2":"_Y _dG","129":"_WO _cG"},E:{"1":"_PC","2":"_3C"},F:{"1":"_BF","2":"_9G"},G:{"1":"_AB","2":"_XB"},H:{"2":"1D"},I:{"1":"I","2":"_wG","16":"7D"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:6,C:"ChaCha20-Poly1305 cipher suites for TLS",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"dog.js","sources":["../../../src/icons/dog.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Dog\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTEuMjUgMTYuMjVoMS41TDEyIDE3eiIgLz4KICA8cGF0aCBkPSJNMTYgMTR2LjUiIC8+CiAgPHBhdGggZD0iTTQuNDIgMTEuMjQ3QTEzLjE1MiAxMy4xNTIgMCAwIDAgNCAxNC41NTZDNCAxOC43MjggNy41ODIgMjEgMTIgMjFzOC0yLjI3MiA4LTYuNDQ0YTExLjcwMiAxMS43MDIgMCAwIDAtLjQ5My0zLjMwOSIgLz4KICA8cGF0aCBkPSJNOCAxNHYuNSIgLz4KICA8cGF0aCBkPSJNOC41IDguNWMtLjM4NCAxLjA1LTEuMDgzIDIuMDI4LTIuMzQ0IDIuNS0xLjkzMS43MjItMy41NzYtLjI5Ny0zLjY1Ni0xLS4xMTMtLjk5NCAxLjE3Ny02LjUzIDQtNyAxLjkyMy0uMzIxIDMuNjUxLjg0NSAzLjY1MSAyLjIzNUE3LjQ5NyA3LjQ5NyAwIDAgMSAxNCA1LjI3N2MwLTEuMzkgMS44NDQtMi41OTggMy43NjctMi4yNzcgMi44MjMuNDcgNC4xMTMgNi4wMDYgNCA3LS4wOC43MDMtMS43MjUgMS43MjItMy42NTYgMS0xLjI2MS0uNDcyLTEuODU1LTEuNDUtMi4yMzktMi41IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/dog\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 Dog = createLucideIcon('Dog', [\n ['path', { d: 'M11.25 16.25h1.5L12 17z', key: 'w7jh35' }],\n ['path', { d: 'M16 14v.5', key: '1lajdz' }],\n [\n 'path',\n {\n d: 'M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309',\n key: 'u7s9ue',\n },\n ],\n ['path', { d: 'M8 14v.5', key: '1nzgdb' }],\n [\n 'path',\n {\n d: 'M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5',\n key: 'v8hric',\n },\n ],\n]);\n\nexport default Dog;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,iBAAiB,KAAO,CAAA,CAAA,CAAA;AAAA,CAAA,CAClC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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A,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CALine truncated
@@ -0,0 +1,65 @@
import { AlwaysDelay } from "./always.delay";
import { IBackOffOptions, getSanitizedOptions } from "../../options";
describe(AlwaysDelay.name, () => {
let options: IBackOffOptions;
let delay: AlwaysDelay;
function initClass() {
delay = new AlwaysDelay(options);
}
beforeEach(() => {
options = getSanitizedOptions({});
initClass();
jest.useFakeTimers();
});
it(`when calling #apply, the delay is equal to the starting delay`, async () => {
const spy = jest.fn();
delay.apply().then(spy);
jest.runTimersToTime(options.startingDelay);
await Promise.resolve();
expect(spy).toHaveBeenCalledTimes(1);
});
it(`when the attempt number is 1, when calling #apply,
the delay is equal to the starting delay multiplied by the time multiple`, async () => {
delay.setAttemptNumber(1);
const spy = jest.fn();
delay.apply().then(spy);
jest.runTimersToTime(options.startingDelay * options.timeMultiple);
await Promise.resolve();
expect(spy).toHaveBeenCalledTimes(1);
});
it(`when the attempt number is 2, when calling #apply,
the delay is equal to the starting delay multiplied by the time multiple raised by the attempt number`, async () => {
const attemptNumber = 2;
delay.setAttemptNumber(attemptNumber);
const spy = jest.fn();
delay.apply().then(spy);
jest.runTimersToTime(
options.startingDelay * Math.pow(options.timeMultiple, attemptNumber)
);
await Promise.resolve();
expect(spy).toHaveBeenCalledTimes(1);
});
it(`when the #maxDelay is less than #startingDelay, when calling #apply,
the delay is equal to the #maxDelay`, async () => {
options.maxDelay = options.startingDelay - 1;
const spy = jest.fn();
delay.apply().then(spy);
jest.runTimersToTime(options.maxDelay);
await Promise.resolve();
expect(spy).toHaveBeenCalledTimes(1);
});
});
@@ -0,0 +1,8 @@
export { assignRef } from './assignRef';
export { useCallbackRef } from './useRef';
export { createCallbackRef } from './createRef';
export { mergeRefs } from './mergeRef';
export { useMergeRefs } from './useMergeRef';
export { useTransformRef } from './useTransformRef';
export { transformRef } from './transformRef';
export { refToCallback, useRefToCallback } from './refToCallback';
@@ -0,0 +1,272 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
var Group;
(function (Group) {
Group["conditional"] = "conditional";
Group["function"] = "function";
Group["import"] = "import";
Group["intersection"] = "intersection";
Group["keyword"] = "keyword";
Group["nullish"] = "nullish";
Group["literal"] = "literal";
Group["named"] = "named";
Group["object"] = "object";
Group["operator"] = "operator";
Group["tuple"] = "tuple";
Group["union"] = "union";
})(Group || (Group = {}));
function getGroup(node) {
switch (node.type) {
case utils_1.AST_NODE_TYPES.TSConditionalType:
return Group.conditional;
case utils_1.AST_NODE_TYPES.TSConstructorType:
case utils_1.AST_NODE_TYPES.TSFunctionType:
return Group.function;
case utils_1.AST_NODE_TYPES.TSImportType:
return Group.import;
case utils_1.AST_NODE_TYPES.TSIntersectionType:
return Group.intersection;
case utils_1.AST_NODE_TYPES.TSAnyKeyword:
case utils_1.AST_NODE_TYPES.TSBigIntKeyword:
case utils_1.AST_NODE_TYPES.TSBooleanKeyword:
case utils_1.AST_NODE_TYPES.TSNeverKeyword:
case utils_1.AST_NODE_TYPES.TSNumberKeyword:
case utils_1.AST_NODE_TYPES.TSObjectKeyword:
case utils_1.AST_NODE_TYPES.TSStringKeyword:
case utils_1.AST_NODE_TYPES.TSSymbolKeyword:
case utils_1.AST_NODE_TYPES.TSThisType:
case utils_1.AST_NODE_TYPES.TSUnknownKeyword:
case utils_1.AST_NODE_TYPES.TSIntrinsicKeyword:
return Group.keyword;
case utils_1.AST_NODE_TYPES.TSNullKeyword:
case utils_1.AST_NODE_TYPES.TSUndefinedKeyword:
case utils_1.AST_NODE_TYPES.TSVoidKeyword:
return Group.nullish;
case utils_1.AST_NODE_TYPES.TSLiteralType:
case utils_1.AST_NODE_TYPES.TSTemplateLiteralType:
return Group.literal;
case utils_1.AST_NODE_TYPES.TSArrayType:
case utils_1.AST_NODE_TYPES.TSIndexedAccessType:
case utils_1.AST_NODE_TYPES.TSInferType:
case utils_1.AST_NODE_TYPES.TSTypeReference:
case utils_1.AST_NODE_TYPES.TSQualifiedName:
return Group.named;
case utils_1.AST_NODE_TYPES.TSMappedType:
case utils_1.AST_NODE_TYPES.TSTypeLiteral:
return Group.object;
case utils_1.AST_NODE_TYPES.TSTypeOperator:
case utils_1.AST_NODE_TYPES.TSTypeQuery:
return Group.operator;
case utils_1.AST_NODE_TYPES.TSTupleType:
return Group.tuple;
case utils_1.AST_NODE_TYPES.TSUnionType:
return Group.union;
// These types should never occur as part of a union/intersection
case utils_1.AST_NODE_TYPES.TSAbstractKeyword:
case utils_1.AST_NODE_TYPES.TSAsyncKeyword:
case utils_1.AST_NODE_TYPES.TSDeclareKeyword:
case utils_1.AST_NODE_TYPES.TSExportKeyword:
case utils_1.AST_NODE_TYPES.TSNamedTupleMember:
case utils_1.AST_NODE_TYPES.TSOptionalType:
case utils_1.AST_NODE_TYPES.TSPrivateKeyword:
case utils_1.AST_NODE_TYPES.TSProtectedKeyword:
case utils_1.AST_NODE_TYPES.TSPublicKeyword:
case utils_1.AST_NODE_TYPES.TSReadonlyKeyword:
case utils_1.AST_NODE_TYPES.TSRestType:
case utils_1.AST_NODE_TYPES.TSStaticKeyword:
case utils_1.AST_NODE_TYPES.TSTypePredicate:
/* istanbul ignore next */
throw new Error(`Unexpected Type ${node.type}`);
}
}
function caseSensitiveSort(a, b) {
if (a < b) {
return -1;
}
if (a > b) {
return 1;
}
return 0;
}
exports.default = (0, util_1.createRule)({
name: 'sort-type-constituents',
meta: {
type: 'suggestion',
deprecated: {
deprecatedSince: '7.13.0',
replacedBy: [
{
plugin: {
name: 'eslint-plugin-perfectionist',
url: 'https://perfectionist.dev',
},
rule: {
name: 'perfectionist/sort-intersection-types',
url: 'https://perfectionist.dev/rules/sort-intersection-types',
},
},
{
plugin: {
name: 'eslint-plugin-perfectionist',
url: 'https://perfectionist.dev',
},
rule: {
name: 'perfectionist/sort-union-types',
url: 'https://perfectionist.dev/rules/sort-union-types',
},
},
],
url: 'https://github.com/typescript-eslint/typescript-eslint/pull/9253',
},
docs: {
description: 'Enforce constituents of a type union/intersection to be sorted alphabetically',
},
fixable: 'code',
hasSuggestions: true,
messages: {
notSorted: '{{type}} type constituents must be sorted.',
notSortedNamed: '{{type}} type {{name}} constituents must be sorted.',
suggestFix: 'Sort constituents of type (removes all comments).',
},
replacedBy: [
'perfectionist/sort-intersection-types',
'perfectionist/sort-union-types',
],
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
caseSensitive: {
type: 'boolean',
description: 'Whether to sort using case sensitive string comparisons.',
},
checkIntersections: {
type: 'boolean',
description: 'Whether to check intersection types (`&`).',
},
checkUnions: {
type: 'boolean',
description: 'Whether to check union types (`|`).',
},
groupOrder: {
type: 'array',
description: 'Ordering of the groups.',
items: {
type: 'string',
enum: (0, util_1.getEnumNames)(Group),
},
},
},
},
],
},
defaultOptions: [
{
caseSensitive: false,
checkIntersections: true,
checkUnions: true,
groupOrder: [
Group.named,
Group.keyword,
Group.operator,
Group.literal,
Group.function,
Group.import,
Group.conditional,
Group.object,
Group.tuple,
Group.intersection,
Group.union,
Group.nullish,
],
},
],
create(context, [{ caseSensitive, checkIntersections, checkUnions, groupOrder }]) {
const collator = new Intl.Collator('en', {
numeric: true,
sensitivity: 'base',
});
function checkSorting(node) {
const sourceOrder = node.types.map(type => {
const group = groupOrder?.indexOf(getGroup(type)) ?? -1;
return {
node: type,
group: group === -1 ? Number.MAX_SAFE_INTEGER : group,
text: context.sourceCode.getText(type),
};
});
const expectedOrder = [...sourceOrder].sort((a, b) => {
if (a.group !== b.group) {
return a.group - b.group;
}
if (caseSensitive) {
return caseSensitiveSort(a.text, b.text);
}
return (collator.compare(a.text, b.text) ||
(a.text < b.text ? -1 : a.text > b.text ? 1 : 0));
});
const hasComments = node.types.some(type => {
const count = context.sourceCode.getCommentsBefore(type).length +
context.sourceCode.getCommentsAfter(type).length;
return count > 0;
});
for (let i = 0; i < expectedOrder.length; i += 1) {
if (expectedOrder[i].node !== sourceOrder[i].node) {
let messageId = 'notSorted';
const data = {
name: '',
type: node.type === utils_1.AST_NODE_TYPES.TSIntersectionType
? 'Intersection'
: 'Union',
};
if (node.parent.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration) {
messageId = 'notSortedNamed';
data.name = node.parent.id.name;
}
const fix = fixer => {
const sorted = expectedOrder
.map(t => (0, util_1.typeNodeRequiresParentheses)(t.node, t.text) ||
(node.type === utils_1.AST_NODE_TYPES.TSIntersectionType &&
t.node.type === utils_1.AST_NODE_TYPES.TSUnionType)
? `(${t.text})`
: t.text)
.join(node.type === utils_1.AST_NODE_TYPES.TSIntersectionType ? ' & ' : ' | ');
return fixer.replaceText(node, sorted);
};
return context.report({
node,
messageId,
data,
// don't autofix if any of the types have leading/trailing comments
// the logic for preserving them correctly is a pain - we may implement this later
...(hasComments
? {
suggest: [
{
messageId: 'suggestFix',
fix,
},
],
}
: { fix }),
});
}
}
}
return {
...(checkIntersections && {
TSIntersectionType(node) {
checkSorting(node);
},
}),
...(checkUnions && {
TSUnionType(node) {
checkSorting(node);
},
}),
};
},
});
@@ -0,0 +1,2 @@
export * from './index.cjs';
export { HeadContent } from './HeadContent.dev';
@@ -0,0 +1,30 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.0.2](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.1...v1.0.2) - 2025-02-12
### Commits
- [types] improve inferred types [`e6f9586`](https://github.com/ljharb/call-bind-apply-helpers/commit/e6f95860a3c72879cb861a858cdfb8138fbedec1)
- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`e43d540`](https://github.com/ljharb/call-bind-apply-helpers/commit/e43d5409f97543bfbb11f345d47d8ce4e066d8c1)
## [v1.0.1](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.0...v1.0.1) - 2024-12-08
### Commits
- [types] `reflectApply`: fix types [`4efc396`](https://github.com/ljharb/call-bind-apply-helpers/commit/4efc3965351a4f02cc55e836fa391d3d11ef2ef8)
- [Fix] `reflectApply`: oops, Reflect is not a function [`83cc739`](https://github.com/ljharb/call-bind-apply-helpers/commit/83cc7395de6b79b7730bdf092f1436f0b1263c75)
- [Dev Deps] update `@arethetypeswrong/cli` [`80bd5d3`](https://github.com/ljharb/call-bind-apply-helpers/commit/80bd5d3ae58b4f6b6995ce439dd5a1bcb178a940)
## v1.0.0 - 2024-12-05
### Commits
- Initial implementation, tests, readme [`7879629`](https://github.com/ljharb/call-bind-apply-helpers/commit/78796290f9b7430c9934d6f33d94ae9bc89fce04)
- Initial commit [`3f1dc16`](https://github.com/ljharb/call-bind-apply-helpers/commit/3f1dc164afc43285631b114a5f9dd9137b2b952f)
- npm init [`081df04`](https://github.com/ljharb/call-bind-apply-helpers/commit/081df048c312fcee400922026f6e97281200a603)
- Only apps should have lockfiles [`5b9ca0f`](https://github.com/ljharb/call-bind-apply-helpers/commit/5b9ca0fe8101ebfaf309c549caac4e0a017ed930)
@@ -0,0 +1,5 @@
import km from "./km.js";
/** @deprecated Use `km` instead. */
export default function () {
return km();
}
@@ -0,0 +1,628 @@
export default `flf2a$ 6 5 16 0 14
Original font by Gordon Lee <93cmgl@eng.cam.ac.uk>
==================================================
Original figletization by Tony Nugent (T.Nugent@sct.gu.edu.au)
Version 1 - Needs refining with hardblanks and cleaning up of some of
the characters. The last 6 chars need to be done properly.
==================================================
Version 2 by Ian Chai <spectre@uiuc.edu> Added the hardblank fix and
the German characters.
==================================================
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
oo$ @
8888$@
8888$@
88$ @
oo$ @
@@
888 888$@
888 888$@
@
@
@
@@
ooo ooo$ @
o888ooo888o$@
888 888$ @
o888ooo888o$@
888 888$ @
@@
oo oo$ @
oo88o88o8$ @
88o88o88oo$ @
88 88 88$@
o8o88o88o8$ @
88 88$ @@
oo ooo$@
8 8 o88$ @
88 o88 oo$ @
o88 8 8$@
o88 88$ @
@@
oooooo$ @
888 888$ @
88o88 o88$@
888 88o8$ @
888o88 88o$@
@@
888$@
888$@
o88$ @
@
@
@@
o88$@
888$ @
888$ @
888$ @
888$ @
88o$@@
88o$ @
888$ @
888$@
888$@
888$ @
o88$ @@
oo oo$ @
88oo88$ @
o88888888o$@
oo88oo$ @
o88 88o$ @
@@
ooo$ @
888$ @
oooo888oooo$@
888$ @
888$ @
@@
@
@
@
ooo$@
888$@
o88$ @@
@
@
ooooooooo$@
@
@
@@
@
@
@
ooo$@
888$@
@@
o88$@
o88$ @
o88$ @
o88$ @
o88$ @
o88$ @@
ooooooo$ @
o888 o888o$@
888 8 888$@
888o8 o888$@
88ooo88$ @
@@
oo$ @
o888$ @
888$ @
888$ @
o888o$@
@@
ooooooo$ @
o88 888$@
o888$ @
o888 o$@
o8888oooo88$@
@@
ooooooo$ @
o88 888o$@
88888o$ @
88o o888$@
88ooo88$ @
@@
o88$ @
o8888$ @
o88 888$ @
o888oo888oo$@
o888o$ @
@@
oooooooooo$ @
888$ @
888888888o$ @
ooo o888$@
88ooo88$ @
@@
ooooooo$ @
o88$ @
888888888o$ @
88o o888$@
88ooo88$ @
@@
ooooooooooo$@
888 888$ @
888$ @
888$ @
888$ @
@@
ooooooo$ @
o888 888o$@
888888888$ @
888o o888$@
88ooo88$ @
@@
ooooooo$ @
888 88o$@
888oo8888$@
888$ @
o888$ @
@@
@
ooo$@
888$@
ooo$@
888$@
@@
ooo$@
888$@
ooo$@
888$@
o88$ @
@@
o88$@
o88$ @
o88$ @
88o$ @
88o$@
@@
@
ooooooooo$@
@
ooooooooo$@
@
@@
88o$ @
88o$ @
88o$@
o88$ @
o88$ @
@@
o8888888o$ @
888 888$@
o888$ @
888$ @
ooo$ @
@@
o8888888o$ @
888 oo 888$@
888 8 8 888$@
888 88o88$ @
888ooooo8$ @
@@
o$ @
888$ @
8 88$ @
8oooo88$ @
o88o o888o$@
@@
oooooooooo$ @
888 888$@
888oooo88$ @
888 888$@
o888ooo888$ @
@@
oooooooo8$@
o888 88$@
888$ @
888o oo$@
888oooo88$ @
@@
ooooooooo$ @
888 88o$@
888 888$@
888 888$@
o888ooo88$ @
@@
ooooooooooo$@
888 88$ @
888ooo8$ @
888 oo$ @
o888ooo8888$@
@@
ooooooooooo$@
888 88$ @
888ooo8$ @
888$ @
o888o$ @
@@
ooooooo8$ @
o888 88$ @
888 oooo$@
888o 88$ @
888ooo888$ @
@@
ooooo ooooo$@
888 888$ @
888ooo888$ @
888 888$ @
o888o o888o$@
@@
ooooo$@
888$ @
888$ @
888$ @
o888o$@
@@
ooooo$@
888$ @
888$ @
888$ @
888$ @
8o888$ @@
oooo oooo$@
888 o88$ @
888888$ @
888 88o$ @
o888o o888o$@
@@
ooooo$ @
888$ @
888$ @
888 o$@
o888ooooo88$@
@@
oooo oooo$@
8888o 888$ @
88 888o8 88$ @
88 888 88$ @
o88o 8 o88o$@
@@
oooo oooo$@
8888o 88$ @
88 888o88$ @
88 8888$ @
o88o 88$ @
@@
ooooooo$ @
o888 888o$@
888 888$@
888o o888$@
88ooo88$ @
@@
oooooooooo$ @
888 888$@
888oooo88$ @
888$ @
o888o$ @
@@
ooooooo$ @
o888 888o$@
888 888$@
888o 8o888$@
88ooo88$ @
88o8$@@
oooooooooo$ @
888 888$@
888oooo88$ @
888 88o$ @
o888o 88o8$@
@@
oooooooo8$ @
888$ @
888oooooo$ @
888$@
o88oooo888$ @
@@
ooooooooooo$@
88 888 88$@
888$ @
888$ @
o888o$ @
@@
ooooo oooo$@
888 88$ @
888 88$ @
888 88$ @
888oo88$ @
@@
ooooo oooo$@
888 88$ @
888 88$ @
88888$ @
888$ @
@@
oooo oooo$@
88 88 88$ @
88 888 88$ @
888 888$ @
8 8$ @
@@
ooooo oooo$@
888 88$ @
888$ @
88 888$ @
o88o o888o$@
@@
ooooo oooo$@
888 88$ @
888$ @
888$ @
o888o$ @
@@
ooooooooooo$@
88 888$ @
888$ @
888 oo$@
o888oooo888$@
@@
888888$@
888$ @
888$ @
888$ @
888$ @
888888$@@
88o$ @
88o$ @
88o$ @
88o$ @
88o$ @
88o$@@
888888$@
888$@
888$@
888$@
888$@
888888$@@
o$ @
o8o$ @
o888o$ @
o88o88o$ @
o8888888o$@
@@
@
@
@
@
@
oooooooooooo$@@
888$ @
888$ @
88o$@
@
@
@@
@
ooooooo$ @
ooooo888$ @
888 888$ @
88ooo88 8o$@
@@
oooo$ @
888ooooo$ @
888 888$@
888 888$@
o888ooo88$ @
@@
@
ooooooo$ @
888 888$@
888$ @
88ooo888$ @
@@
oooo$@
ooooo888$ @
888 888$ @
888 888$ @
88ooo888o$@
@@
@
ooooooooo8$@
888oooooo8$ @
888$ @
88oooo888$@
@@
o888o$@
o888oo$ @
888$ @
888$ @
o888o$ @
@@
@
oooooooo8$@
888 88o$ @
888oo888o$ @
888 888$@
888ooo888$ @@
oooo$ @
888ooooo$ @
888 888$ @
888 888$ @
o888o o888o$@
@@
o88$ @
oooo$ @
888$ @
888$ @
o888o$@
@@
o88$@
oooo$@
888$@
888$@
888$@
o88$ @@
oooo$ @
888 ooooo$@
888o888$ @
8888 88o$ @
o888o o888o$@
@@
o888$ @
888$ @
888$ @
888$ @
o888o$@
@@
@
oo ooo oooo$ @
888 888 888$ @
888 888 888$ @
o888o888o888o$@
@@
@
oo oooooo$ @
888 888$ @
888 888$ @
o888o o888o$@
@@
@
ooooooo$ @
888 888$@
888 888$@
88ooo88$ @
@@
@
ooooooooo$ @
888 888$@
888 888$@
888ooo88$ @
o888$ @@
@
ooooooooo$@
888 888$ @
888 888$ @
88ooo888$ @
888o$@@
@
oo oooooo$ @
888 888$@
888$ @
o888o$ @
@@
@
oooooooo8$ @
888ooooooo$ @
888$@
88oooooo88$ @
@@
o8$ @
o888oo$@
888$ @
888$ @
888o$@
@@
@
oooo oooo$ @
888 888$ @
888 888$ @
888o88 8o$@
@@
@
oooo oooo$@
888 888$ @
888 888$ @
888$ @
@@
@
oooo o oooo$@
888 888 888$ @
888888888$ @
88 88$ @
@@
@
oooo oooo$@
888o888$ @
o88 88o$ @
o88o o88o$@
@@
@
oooo oooo$@
888 888$ @
888 888$ @
8888$ @
o8o888$ @@
@
ooooooooooo$@
8888$ @
8888$ @
o888ooooooo$@
@@
o8888$@
888$ @
o888$ @
888o$ @
888$ @
8888o$@@
888$@
888$@
888$@
888$@
888$@
888$@@
8888o$ @
888$ @
888o$@
o888$@
888$ @
o8888$ @@
o888o o888$@
888 888888$ @
@
@
@
@@
88 o 88$ @
888$ @
8 88$ @
8oooo88$ @
o88o o888o$@
@@
88ooooo88$ @
o888 888o$@
888 888$@
888o o888$@
88ooo88$ @
@@
o88oo o88o$@
888 88$ @
888 88$ @
888 88$ @
888oo88$ @
@@
88 88$ @
ooooooo$ @
ooooo888$ @
888 888$ @
88ooo88 8o$@
@@
88 88$ @
ooooooo$ @
888 888$@
888 888$@
88ooo88$ @
@@
88 88 @
oooo oooo$ @
888 888$ @
888 888$ @
888o88 8o$@
@@
ooooooo$ @
o88 888$@
888oooo88$ @
888 888$@
888 oo888$ @
o88 @@
`
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/direction.tsx"],
"sourcesContent": ["import * as React from 'react';\n\ntype Direction = 'ltr' | 'rtl';\nconst DirectionContext = React.createContext<Direction | undefined>(undefined);\n\n/* -------------------------------------------------------------------------------------------------\n * Direction\n * -----------------------------------------------------------------------------------------------*/\n\ninterface DirectionProviderProps {\n children?: React.ReactNode;\n dir: Direction;\n}\nconst DirectionProvider: React.FC<DirectionProviderProps> = (props) => {\n const { dir, children } = props;\n return <DirectionContext.Provider value={dir}>{children}</DirectionContext.Provider>;\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || 'ltr';\n}\n\nconst Provider = DirectionProvider;\n\nexport {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n};\n"],
"mappings": ";;;AAAA,YAAY,WAAW;AAed;AAZT,IAAM,mBAAyB,oBAAqC,MAAS;AAU7E,IAAM,oBAAsD,CAAC,UAAU;AACrE,QAAM,EAAE,KAAK,SAAS,IAAI;AAC1B,SAAO,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,KAAM,UAAS;AAC1D;AAIA,SAAS,aAAa,UAAsB;AAC1C,QAAM,YAAkB,iBAAW,gBAAgB;AACnD,SAAO,YAAY,aAAa;AAClC;AAEA,IAAM,WAAW;",
"names": []
}
@@ -0,0 +1,59 @@
import { AnyNode } from "domhandler";
/**
* Given an array of nodes, remove any member that is contained by another
* member.
*
* @category Helpers
* @param nodes Nodes to filter.
* @returns Remaining nodes that aren't contained by other nodes.
*/
export declare function removeSubsets(nodes: AnyNode[]): AnyNode[];
/**
* @category Helpers
* @see {@link http://dom.spec.whatwg.org/#dom-node-comparedocumentposition}
*/
export declare const enum DocumentPosition {
DISCONNECTED = 1,
PRECEDING = 2,
FOLLOWING = 4,
CONTAINS = 8,
CONTAINED_BY = 16
}
/**
* Compare the position of one node against another node in any other document,
* returning a bitmask with the values from {@link DocumentPosition}.
*
* Document order:
* > There is an ordering, document order, defined on all the nodes in the
* > document corresponding to the order in which the first character of the
* > XML representation of each node occurs in the XML representation of the
* > document after expansion of general entities. Thus, the document element
* > node will be the first node. Element nodes occur before their children.
* > Thus, document order orders element nodes in order of the occurrence of
* > their start-tag in the XML (after expansion of entities). The attribute
* > nodes of an element occur after the element and before its children. The
* > relative order of attribute nodes is implementation-dependent.
*
* Source:
* http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order
*
* @category Helpers
* @param nodeA The first node to use in the comparison
* @param nodeB The second node to use in the comparison
* @returns A bitmask describing the input nodes' relative position.
*
* See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for
* a description of these values.
*/
export declare function compareDocumentPosition(nodeA: AnyNode, nodeB: AnyNode): number;
/**
* Sort an array of nodes based on their relative position in the document,
* removing any duplicate nodes. If the array contains nodes that do not belong
* to the same document, sort order is unspecified.
*
* @category Helpers
* @param nodes Array of DOM nodes.
* @returns Collection of unique nodes, sorted in document order.
*/
export declare function uniqueSort<T extends AnyNode>(nodes: T[]): T[];
//# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1,46 @@
{
"name": "date-manip",
"version": "2.0.6",
"description": "A lightweight JavaScript date utility library that provides modularity, high performance, and additional features. It supports various date operations, including date addition and subtraction, formatting, comparison, etc.",
"types": "dist/index.d.ts",
"module": "dist/index.mjs",
"main": "dist/index.js",
"unpkg": "dist/index.umd.js",
"jsdelivr": "dist/index.umd.js",
"keywords": [
"date",
"util",
"moment"
],
"devDependencies": {
"@vitest/coverage-v8": "^3.1.1",
"moment": "^2.30.1",
"vite": "^6.2.6",
"vite-plugin-build-chunk": "^6.0.0",
"vite-plugin-combine": "^6.2.1",
"vite-plugin-external": "^6.2.1",
"vite-plugin-separate-importer": "^6.0.4",
"vitest": "^3.1.1"
},
"files": [
"dist"
],
"directories": {
"test": "test"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/fengxinming/util.git"
},
"author": "Jesse Feng <fxm0016@126.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/fengxinming/util/issues"
},
"homepage": "https://fengxinming.github.io/util/modules/date-manip/",
"scripts": {
"build": "vite build",
"release": "pnpm publish --no-git-checks",
"test": "npm run build && vitest run --coverage"
}
}
@@ -0,0 +1,402 @@
import { expectTypeOf, test } from "vitest";
import * as z from "zod/v4";
import * as core from "zod/v4/core";
test("assignability", () => {
// $ZodString
z.string() satisfies z.core.$ZodString;
z.string() satisfies z.ZodString;
// $ZodNumber
z.number() satisfies z.core.$ZodNumber;
z.number() satisfies z.ZodNumber;
// $ZodBigInt
z.bigint() satisfies z.core.$ZodBigInt;
z.bigint() satisfies z.ZodBigInt;
// $ZodBoolean
z.boolean() satisfies z.core.$ZodBoolean;
z.boolean() satisfies z.ZodBoolean;
// $ZodDate
z.date() satisfies z.core.$ZodDate;
z.date() satisfies z.ZodDate;
// $ZodSymbol
z.symbol() satisfies z.core.$ZodSymbol;
z.symbol() satisfies z.ZodSymbol;
// $ZodUndefined
z.undefined() satisfies z.core.$ZodUndefined;
z.undefined() satisfies z.ZodUndefined;
// $ZodNullable
z.string().nullable() satisfies z.core.$ZodNullable;
z.string().nullable() satisfies z.ZodNullable;
// $ZodNull
z.null() satisfies z.core.$ZodNull;
z.null() satisfies z.ZodNull;
// $ZodAny
z.any() satisfies z.core.$ZodAny;
z.any() satisfies z.ZodAny;
// $ZodUnknown
z.unknown() satisfies z.core.$ZodUnknown;
z.unknown() satisfies z.ZodUnknown;
// $ZodNever
z.never() satisfies z.core.$ZodNever;
z.never() satisfies z.ZodNever;
// $ZodVoid
z.void() satisfies z.core.$ZodVoid;
z.void() satisfies z.ZodVoid;
// $ZodArray
z.array(z.string()) satisfies z.core.$ZodArray;
z.array(z.string()) satisfies z.ZodArray;
z.array(z.string()) satisfies z.ZodType<Array<unknown>>;
// $ZodObject
z.object({ key: z.string() }) satisfies z.core.$ZodObject;
z.object({ key: z.string() }) satisfies z.ZodObject<{ key: z.ZodType }>;
z.object({ key: z.string() }) satisfies z.ZodType<{ key: string }>;
// $ZodUnion
z.union([z.string(), z.number()]) satisfies z.core.$ZodUnion;
z.union([z.string(), z.number()]) satisfies z.ZodUnion;
z.union([z.string(), z.number()]) satisfies z.ZodType<string | number>;
// $ZodIntersection
z.intersection(z.string(), z.number()) satisfies z.core.$ZodIntersection;
z.intersection(z.string(), z.number()) satisfies z.ZodIntersection;
// $ZodTuple
z.tuple([z.string(), z.number()]) satisfies z.core.$ZodTuple;
z.tuple([z.string(), z.number()]) satisfies z.ZodTuple;
// $ZodRecord
z.record(z.string(), z.number()) satisfies z.core.$ZodRecord;
z.record(z.string(), z.number()) satisfies z.ZodRecord;
// $ZodMap
z.map(z.string(), z.number()) satisfies z.core.$ZodMap;
z.map(z.string(), z.number()) satisfies z.ZodMap;
// $ZodSet
z.set(z.string()) satisfies z.core.$ZodSet;
z.set(z.string()) satisfies z.ZodSet;
// $ZodLiteral
z.literal("example") satisfies z.core.$ZodLiteral;
z.literal("example") satisfies z.ZodLiteral;
// $ZodEnum
z.enum(["a", "b", "c"]) satisfies z.core.$ZodEnum;
z.enum(["a", "b", "c"]) satisfies z.ZodEnum;
// $ZodPromise
z.promise(z.string()) satisfies z.core.$ZodPromise;
z.promise(z.string()) satisfies z.ZodPromise;
// $ZodLazy
const lazySchema = z.lazy(() => z.string());
lazySchema satisfies z.core.$ZodLazy;
lazySchema satisfies z.ZodLazy;
// $ZodOptional
z.string().optional() satisfies z.core.$ZodOptional;
z.string().optional() satisfies z.ZodOptional;
// $ZodDefault
z.string().default("default") satisfies z.core.$ZodDefault;
z.string().default("default") satisfies z.ZodDefault;
// $ZodTemplateLiteral
z.templateLiteral([z.literal("a"), z.literal("b")]) satisfies z.core.$ZodTemplateLiteral;
z.templateLiteral([z.literal("a"), z.literal("b")]) satisfies z.ZodTemplateLiteral;
// $ZodCustom
z.custom<string>((val) => typeof val === "string") satisfies z.core.$ZodCustom;
z.custom<string>((val) => typeof val === "string") satisfies z.ZodCustom;
// $ZodTransform
z.transform((val) => val as string) satisfies z.core.$ZodTransform;
z.transform((val) => val as string) satisfies z.ZodTransform;
// $ZodNonOptional
z.string().optional().nonoptional() satisfies z.core.$ZodNonOptional;
z.string().optional().nonoptional() satisfies z.ZodNonOptional;
// $ZodReadonly
z.object({ key: z.string() }).readonly() satisfies z.core.$ZodReadonly;
z.object({ key: z.string() }).readonly() satisfies z.ZodReadonly;
// $ZodNaN
z.nan() satisfies z.core.$ZodNaN;
z.nan() satisfies z.ZodNaN;
// $ZodPipe
z.unknown().pipe(z.number()) satisfies z.core.$ZodPipe;
z.unknown().pipe(z.number()) satisfies z.ZodPipe;
// $ZodPreprocess
z.preprocess((v) => v, z.number()) satisfies z.core.$ZodPreprocess;
z.preprocess((v) => v, z.number()) satisfies z.ZodPreprocess;
z.preprocess((v) => v, z.number()) satisfies z.core.$ZodPipe<z.core.$ZodTransform, z.ZodNumber>;
z.preprocess((v) => v, z.number()) satisfies z.ZodPipe<z.core.$ZodTransform, z.ZodNumber>;
// $ZodSuccess
z.success(z.string()) satisfies z.core.$ZodSuccess;
z.success(z.string()) satisfies z.ZodSuccess;
// $ZodCatch
z.string().catch("fallback") satisfies z.core.$ZodCatch;
z.string().catch("fallback") satisfies z.ZodCatch;
// $ZodFile
z.file() satisfies z.core.$ZodFile;
z.file() satisfies z.ZodFile;
});
test("toZod", () => {
type Company = {
id: string;
name: string;
webAddress: string | null;
};
const CompanySchema = z.object({
id: z.string(),
name: z.string(),
webAddress: z.string().url().nullable(),
});
const Company = z.toZod<Company>()(CompanySchema);
Company.shape.id.min(1);
expectTypeOf<z.output<typeof Company>>().toEqualTypeOf<Company>();
const CoreCompany = core.toZod<Company>()(CompanySchema);
expectTypeOf<core.output<typeof CoreCompany>>().toEqualTypeOf<Company>();
const UtilCompany = z.core.util.toZod<Company>()(CompanySchema);
expectTypeOf<z.output<typeof UtilCompany>>().toEqualTypeOf<Company>();
type Complex = {
kind: "company";
nested: {
founded: Date;
tags: string[];
};
scores: Record<"a" | "b", number>;
tuple: [string, number];
status: "active" | "inactive";
};
const Complex = z.toZod<Complex>()(
z.object({
kind: z.literal("company"),
nested: z.object({
founded: z.date(),
tags: z.array(z.string()),
}),
scores: z.record(z.enum(["a", "b"]), z.number()),
tuple: z.tuple([z.string(), z.number()]),
status: z.union([z.literal("active"), z.literal("inactive")]),
})
);
expectTypeOf<z.output<typeof Complex>>().toEqualTypeOf<Complex>();
type Items = {
items: { value: string }[];
};
const Items = z.toZod<Items>()(
z.object({
items: z.array(z.object({ value: z.string() })),
})
);
expectTypeOf<z.output<typeof Items>>().toEqualTypeOf<Items>();
type ReadonlyItem = Readonly<{
id: string;
}>;
const ReadonlyItem = z.toZod<ReadonlyItem>()(z.object({ id: z.string() }).readonly());
expectTypeOf<z.output<typeof ReadonlyItem>>().toEqualTypeOf<ReadonlyItem>();
const Transformed = z.toZod<{ count: number }>()(
z.object({
count: z.string().transform((value) => value.length),
})
);
expectTypeOf<z.input<typeof Transformed>>().toEqualTypeOf<{ count: string }>();
expectTypeOf<z.output<typeof Transformed>>().toEqualTypeOf<{ count: number }>();
// An enum target matches z.enum(...) even though the enum reference is not identical to the union of its members (#6524)
enum SkillLevel {
Noob = "noob",
Pro = "pro",
}
enum Rank {
First = 1,
Second = 2,
}
z.toZod<SkillLevel>()(z.enum(SkillLevel));
const Enums = z.toZod<{
skill: SkillLevel;
members: SkillLevel.Noob | SkillLevel.Pro;
rank: Rank;
maybe: SkillLevel | null;
list: SkillLevel[];
nested: { skill: SkillLevel };
}>()(
z.object({
skill: z.enum(SkillLevel),
members: z.enum(SkillLevel),
rank: z.enum(Rank),
maybe: z.enum(SkillLevel).nullable(),
list: z.array(z.enum(SkillLevel)),
nested: z.object({ skill: z.enum(SkillLevel) }),
})
);
expectTypeOf<z.output<typeof Enums>["skill"]>().toEqualTypeOf<SkillLevel>();
// @ts-expect-error a member subset is not the enum
z.toZod<{ skill: SkillLevel }>()(z.object({ skill: z.literal(SkillLevel.Noob) }));
// @ts-expect-error plain literals do not match a nominal enum target
z.toZod<{ skill: SkillLevel }>()(z.object({ skill: z.enum(["noob", "pro"]) }));
// @ts-expect-error an enum schema does not match a plain literal-union target
z.toZod<{ skill: "noob" | "pro" }>()(z.object({ skill: z.enum(SkillLevel) }));
// @ts-expect-error plain numeric literals do not match a numeric enum target either
z.toZod<{ rank: Rank }>()(z.object({ rank: z.union([z.literal(1), z.literal(2)]) }));
z.toZod<Company>()(
// @ts-expect-error missing optional keys still fail exact output matching
z.object({
id: z.string(),
name: z.string(),
})
);
z.toZod<Company>()(
// @ts-expect-error extra keys fail exact output matching
z.object({
id: z.string(),
name: z.string(),
webAddress: z.string().url().nullable(),
extra: z.string(),
})
);
z.toZod<Company>()(
// @ts-expect-error wrong property output fails matching
z.object({
id: z.number(),
name: z.string(),
webAddress: z.string().url().nullable(),
})
);
z.toZod<ReadonlyItem>()(
// @ts-expect-error readonly output is required
z.object({
id: z.string(),
})
);
// @ts-expect-error any is only an exact match for any
z.toZod<string>()(z.any());
// @ts-expect-error toZod checks output, not input
z.toZod<string>()(z.string().transform((value) => value.length));
// Exact equality is deliberately the only mode. A bidirectional-assignability mode would accept both of the two cases above — `any` is assignable in both directions by construction, and `readonly` is not part of assignability — so it would silently drop the guarantees the rest of this test pins.
// An intersection and the flat object with the same keys are interchangeable as targets, since the normalizer flattens both.
type Intersected = { a: number } & { b: string };
const viaAnd = z.object({ a: z.number() }).and(z.object({ b: z.string() }));
const viaExtend = z.object({ a: z.number() }).safeExtend({ b: z.string() });
z.toZod<Intersected>()(viaAnd);
z.toZod<Intersected>()(viaExtend);
z.toZod<{ a: number; b: string }>()(viaAnd);
z.toZod<{ a: number; b: string }>()(viaExtend);
// @ts-expect-error a missing key is still a missing key
z.toZod<Intersected>()(z.object({ a: z.number() }));
// `keyof` a function is `never`, so the normalizer must not walk into one — mapping it would erase the signature and make every callable compare equal
z.toZod<() => string>()(z.custom<() => string>());
// @ts-expect-error an incompatible callable output is still rejected
z.toZod<() => string>()(z.custom<() => number>());
// @ts-expect-error and so is an incompatible function-valued property
z.toZod<{ cb: (x: number) => void }>()(z.object({ cb: z.custom<(x: string) => void>() }));
// @ts-expect-error a method-bearing generic keeps its type arguments
z.toZod<{ m: Map<string, number> }>()(z.object({ m: z.custom<Map<string, string>>() }));
});
test("checks", () => {
const _a: z.core.$ZodCheck = {} as any as z.core.$ZodChecks;
const _b: z.core.$ZodCheck = {} as any as z.core.$ZodStringFormatChecks;
const _c: z.core.$ZodType = {} as any as z.core.$ZodTypes;
const _d: z.core.$ZodType = {} as any as z.core.$ZodStringFormatTypes;
z.currencyCode() satisfies z.core.$ZodStringFormatTypes;
});
test("assignability to $ZodType", () => {
z.string() satisfies z.ZodType;
z.number() satisfies z.ZodType;
z.boolean() satisfies z.ZodType;
z.object({ key: z.string() }) satisfies z.ZodType;
z.object({ key: z.string() }) satisfies z.ZodType<{ key: string }>;
z.array(z.string()) satisfies z.ZodType;
z.union([z.string(), z.number()]) satisfies z.ZodType;
z.intersection(z.string(), z.number()) satisfies z.ZodType;
z.tuple([z.string(), z.number()]) satisfies z.ZodType;
z.record(z.string(), z.number()) satisfies z.ZodType;
z.map(z.string(), z.number()) satisfies z.ZodType;
z.set(z.string()) satisfies z.ZodType;
z.literal("example") satisfies z.ZodType;
expectTypeOf<z.ZodType extends z.core.$ZodType ? true : false>().toEqualTypeOf<true>();
});
test("assignability with narrowing", () => {
type _RefinedSchema<T extends z.ZodType<object> | z.ZodUnion> = T extends z.ZodUnion
? RefinedUnionSchema<T> // <-- Type instantiation is excessively deep and possibly infinite.
: T extends z.ZodType<object>
? RefinedTypeSchema<z.output<T>> // <-- Type instantiation is excessively deep and possibly infinite.
: never;
type RefinedTypeSchema<T extends object> = T;
type RefinedUnionSchema<T extends z.ZodUnion> = T;
});
test("generic assignability in objects", () => {
interface SortItem<T extends string> {
key: T;
order: string;
}
const createSortItemSchema = <T extends z.ZodType<string>>(sortKeySchema: T) =>
z.object({
key: sortKeySchema,
order: z.string(),
});
<T extends z.ZodType<string>>(sortKeySchema: T, defaultSortBy: SortItem<z.output<T>>[] = []) =>
createSortItemSchema(sortKeySchema).array().default(defaultSortBy);
});
@@ -0,0 +1,29 @@
/**
* @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 EggOff = createLucideIcon("EggOff", [
[
"path",
{
d: "M6.399 6.399C5.362 8.157 4.65 10.189 4.5 12c-.37 4.43 1.27 9.95 7.5 10 3.256-.026 5.259-1.547 6.375-3.625",
key: "6et380"
}
],
[
"path",
{
d: "M19.532 13.875A14.07 14.07 0 0 0 19.5 12c-.36-4.34-3.95-9.96-7.5-10-1.04.012-2.082.502-3.046 1.297",
key: "gcdc3f"
}
],
["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }]
]);
export { EggOff as default };
//# sourceMappingURL=egg-off.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_J"},C:{"1":"_fD","16":"GD"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_oB","16":"F"},G:{"1":"_M"},H:{"1":"1D"},I:{"1":"_P"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:7,C:"document.evaluate & XPath",D:true};
@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FunctionNameDefinition = void 0;
const DefinitionBase_1 = require("./DefinitionBase");
const DefinitionType_1 = require("./DefinitionType");
class FunctionNameDefinition extends DefinitionBase_1.DefinitionBase {
isTypeDefinition = false;
isVariableDefinition = true;
constructor(name, node) {
super(DefinitionType_1.DefinitionType.FunctionName, name, node, null);
}
}
exports.FunctionNameDefinition = FunctionNameDefinition;
@@ -0,0 +1,7 @@
'use strict'
const u = require('universalify').fromPromise
module.exports = {
move: u(require('./move')),
moveSync: require('./move-sync')
}
@@ -0,0 +1,10 @@
const clamp = (min, max, v) => {
if (v > max)
return max;
if (v < min)
return min;
return v;
};
export { clamp };
//# sourceMappingURL=clamp.mjs.map
@@ -0,0 +1,3 @@
"use strict";
/* eslint-disable @typescript-eslint/consistent-indexed-object-style, @typescript-eslint/no-namespace */
Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
{"version":3,"file":"circ.mjs","sources":["../../../src/easing/circ.ts"],"sourcesContent":["import { mirrorEasing } from \"./modifiers/mirror\"\nimport { reverseEasing } from \"./modifiers/reverse\"\nimport { EasingFunction } from \"./types\"\n\nexport const circIn: EasingFunction = (p) => 1 - Math.sin(Math.acos(p))\nexport const circOut = reverseEasing(circIn)\nexport const circInOut = mirrorEasing(circIn)\n"],"names":[],"mappings":";;;MAIa,MAAM,GAAmB,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;MACzD,OAAO,GAAG,aAAa,CAAC,MAAM;MAC9B,SAAS,GAAG,YAAY,CAAC,MAAM;;;;"}
@@ -0,0 +1 @@
{"version":3,"names":["_inheritTrailingComments","require","_inheritLeadingComments","_inheritInnerComments","inheritsComments","child","parent","inheritTrailingComments","inheritLeadingComments","inheritInnerComments"],"sources":["../../src/comments/inheritsComments.ts"],"sourcesContent":["import inheritTrailingComments from \"./inheritTrailingComments.ts\";\nimport inheritLeadingComments from \"./inheritLeadingComments.ts\";\nimport inheritInnerComments from \"./inheritInnerComments.ts\";\nimport type * as t from \"../index.ts\";\n\n/**\n * Inherit all unique comments from `parent` node to `child` node.\n */\nexport default function inheritsComments<T extends t.Node>(\n child: T,\n parent: t.Node,\n): T {\n inheritTrailingComments(child, parent);\n inheritLeadingComments(child, parent);\n inheritInnerComments(child, parent);\n\n return child;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AAMe,SAASG,gBAAgBA,CACtCC,KAAQ,EACRC,MAAc,EACX;EACH,IAAAC,gCAAuB,EAACF,KAAK,EAAEC,MAAM,CAAC;EACtC,IAAAE,+BAAsB,EAACH,KAAK,EAAEC,MAAM,CAAC;EACrC,IAAAG,6BAAoB,EAACJ,KAAK,EAAEC,MAAM,CAAC;EAEnC,OAAOD,KAAK;AACd","ignoreList":[]}
@@ -0,0 +1 @@
{"version":3,"file":"handle-element.mjs","sources":["../../../src/resize/handle-element.ts"],"sourcesContent":["import { isSVGElement } from \"../utils/is-svg-element\"\nimport { ElementOrSelector, resolveElements } from \"../utils/resolve-elements\"\nimport { ResizeHandler } from \"./types\"\n\nconst resizeHandlers = new WeakMap<Element, Set<ResizeHandler<Element>>>()\n\nlet observer: ResizeObserver | undefined\n\nconst getSize =\n (\n borderBoxAxis: \"inline\" | \"block\",\n svgAxis: \"width\" | \"height\",\n htmlAxis: \"offsetWidth\" | \"offsetHeight\"\n ) =>\n (target: Element, borderBoxSize?: ReadonlyArray<ResizeObserverSize>) => {\n if (borderBoxSize && borderBoxSize[0]) {\n return borderBoxSize[0][\n (borderBoxAxis + \"Size\") as keyof ResizeObserverSize\n ]\n } else if (isSVGElement(target) && \"getBBox\" in target) {\n return (target as SVGGraphicsElement).getBBox()[svgAxis]\n } else {\n return (target as HTMLElement)[htmlAxis]\n }\n }\n\nconst getWidth = /*@__PURE__*/ getSize(\"inline\", \"width\", \"offsetWidth\")\nconst getHeight = /*@__PURE__*/ getSize(\"block\", \"height\", \"offsetHeight\")\n\nfunction notifyTarget({ target, borderBoxSize }: ResizeObserverEntry) {\n resizeHandlers.get(target)?.forEach((handler) => {\n handler(target, {\n get width() {\n return getWidth(target, borderBoxSize)\n },\n get height() {\n return getHeight(target, borderBoxSize)\n },\n })\n })\n}\n\nfunction notifyAll(entries: ResizeObserverEntry[]) {\n entries.forEach(notifyTarget)\n}\n\nfunction createResizeObserver() {\n if (typeof ResizeObserver === \"undefined\") return\n\n observer = new ResizeObserver(notifyAll)\n}\n\nexport function resizeElement(\n target: ElementOrSelector,\n handler: ResizeHandler<Element>\n) {\n if (!observer) createResizeObserver()\n\n const elements = resolveElements(target)\n\n elements.forEach((element) => {\n let elementHandlers = resizeHandlers.get(element)\n\n if (!elementHandlers) {\n elementHandlers = new Set()\n resizeHandlers.set(element, elementHandlers)\n }\n\n elementHandlers.add(handler)\n observer?.observe(element)\n })\n\n return () => {\n elements.forEach((element) => {\n const elementHandlers = resizeHandlers.get(element)\n\n elementHandlers?.delete(handler)\n\n if (!elementHandlers?.size) {\n observer?.unobserve(element)\n }\n })\n }\n}\n"],"names":[],"mappings":";;;AAIA,MAAM,cAAc,GAAG,IAAI,OAAO,EAAwC;AAE1E,IAAI,QAAoC;AAExC,MAAM,OAAO,GACT,CACI,aAAiC,EACjC,OAA2B,EAC3B,QAAwC,KAE5C,CAAC,MAAe,EAAE,aAAiD,KAAI;AACnE,IAAA,IAAI,aAAa,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE;QACnC,OAAO,aAAa,CAAC,CAAC,CAAC,EAClB,aAAa,GAAG,MAAM,EAC1B;IACL;SAAO,IAAI,YAAY,CAAC,MAAM,CAAC,IAAI,SAAS,IAAI,MAAM,EAAE;AACpD,QAAA,OAAQ,MAA6B,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC;IAC5D;SAAO;AACH,QAAA,OAAQ,MAAsB,CAAC,QAAQ,CAAC;IAC5C;AACJ,CAAC;AAEL,MAAM,QAAQ,iBAAiB,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC;AACxE,MAAM,SAAS,iBAAiB,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,cAAc,CAAC;AAE1E,SAAS,YAAY,CAAC,EAAE,MAAM,EAAE,aAAa,EAAuB,EAAA;IAChE,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,KAAI;QAC5C,OAAO,CAAC,MAAM,EAAE;AACZ,YAAA,IAAI,KAAK,GAAA;AACL,gBAAA,OAAO,QAAQ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OAAO,CAAC;YAChC;AACJ,QAAA,CAAC,CAAC;AACN,IAAA,CAAC;AACL;;;;"}
@@ -0,0 +1,6 @@
export { RouterServer } from './RouterServer'
export { defaultRenderHandler } from './defaultRenderHandler'
export { defaultStreamHandler } from './defaultStreamHandler'
export { renderRouterToStream } from './renderRouterToStream'
export { renderRouterToString } from './renderRouterToString'
export * from '@tanstack/router-core/ssr/server'
@@ -0,0 +1,22 @@
/**
* @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 Headset = createLucideIcon("Headset", [
[
"path",
{
d: "M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z",
key: "12oyoe"
}
],
["path", { d: "M21 16v2a4 4 0 0 1-4 4h-5", key: "1x7m43" }]
]);
export { Headset as default };
//# sourceMappingURL=headset.js.map