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 @@
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../mod.ts"],"names":[],"mappings":"AAiHA,QAAA,MAAM,QAAQ,MAAO,MAAM,KAAK,MAAM,KAAG,MAaxC,CAAC;AAEF,QAAA,MAAM,OAAO,QAAS,MAAM,OAAO,SAAS,MAAM,EAAE,KAAG,MAWtD,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1 @@
{"version":3,"file":"user-round-cog.js","sources":["../../../src/icons/user-round-cog.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name UserRoundCog\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAyMWE4IDggMCAwIDEgMTAuNDM0LTcuNjIiIC8+CiAgPGNpcmNsZSBjeD0iMTAiIGN5PSI4IiByPSI1IiAvPgogIDxjaXJjbGUgY3g9IjE4IiBjeT0iMTgiIHI9IjMiIC8+CiAgPHBhdGggZD0ibTE5LjUgMTQuMy0uNC45IiAvPgogIDxwYXRoIGQ9Im0xNi45IDIwLjgtLjQuOSIgLz4KICA8cGF0aCBkPSJtMjEuNyAxOS41LS45LS40IiAvPgogIDxwYXRoIGQ9Im0xNS4yIDE2LjktLjktLjQiIC8+CiAgPHBhdGggZD0ibTIxLjcgMTYuNS0uOS40IiAvPgogIDxwYXRoIGQ9Im0xNS4yIDE5LjEtLjkuNCIgLz4KICA8cGF0aCBkPSJtMTkuNSAyMS43LS40LS45IiAvPgogIDxwYXRoIGQ9Im0xNi45IDE1LjItLjQtLjkiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/user-round-cog\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 UserRoundCog = createLucideIcon('UserRoundCog', [\n ['path', { d: 'M2 21a8 8 0 0 1 10.434-7.62', key: '1yezr2' }],\n ['circle', { cx: '10', cy: '8', r: '5', key: 'o932ke' }],\n ['circle', { cx: '18', cy: '18', r: '3', key: '1xkwt0' }],\n ['path', { d: 'm19.5 14.3-.4.9', key: '1eb35c' }],\n ['path', { d: 'm16.9 20.8-.4.9', key: 'dfjc4z' }],\n ['path', { d: 'm21.7 19.5-.9-.4', key: 'q4dx6b' }],\n ['path', { d: 'm15.2 16.9-.9-.4', key: '1r0w5f' }],\n ['path', { d: 'm21.7 16.5-.9.4', key: '1knoei' }],\n ['path', { d: 'm15.2 19.1-.9.4', key: 'j188fs' }],\n ['path', { d: 'm19.5 21.7-.4-.9', key: '1tonu5' }],\n ['path', { d: 'm16.9 15.2-.4-.9', key: '699xu' }],\n]);\n\nexport default UserRoundCog;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC5D,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACvD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmB,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,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmB,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,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACjD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACjD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmB,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,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmB,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,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACjD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,SAAS,CAAA;AAClD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,18 @@
/**
* @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 TableCellsSplit = createLucideIcon("TableCellsSplit", [
["path", { d: "M12 15V9", key: "8c7uyn" }],
["path", { d: "M3 15h18", key: "5xshup" }],
["path", { d: "M3 9h18", key: "1pudct" }],
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
]);
export { TableCellsSplit as default };
//# sourceMappingURL=table-cells-split.js.map
@@ -0,0 +1,624 @@
export default `flf2a. 6 5 15 0 10
slide.flf (C) 1994 by Victor Parada (vparada@inf.utfsm.cl) 94/08/18.
Looks nice in some kind of screens and paper.
Feel free to replace "#", "H" and "|" to some other chars.
Try option "-m -1" to disable smush and get clear fonts.
Latin fonts a' e' i' o' u' n~ and N~ replaces A" O" U" a" o" u" and B.
. $
.. $
.. $
.. $
. $
. $$
#| $
#| $
#| $
.. $
#| $
$$
#|#| $
#|#| $
# #. $
.. $
$
$$
#H H| $
##HHH|| $
#H H| $
##HHH|| $
#H H| $
$$
#| $
#HH|| $
##H|. $
.#H|| $
##HH| $
#| $$
## || $
## H| $
.#|. $
#H || $
## || $
$$
#|. $
#| . $
##H || $
## || $
##H || $
$$
#| $
#| $
#. $
. $
$
$$
#|| $
##| $
##. $
##| $
#|| $
$$
##| $
#|| $
.|| $
#|| $
##| $
$$
## || $
#H| $
##HHH|| $
#H| $
## || $
$$
.. $
.#|. $
##HH|| $
.#|. $
.. $
$$
$
$
. $
#| $
#| $
#. $$
$
.. $
#H|| $
.. $
$
$$
$
$
. $
#| $
#| $
$$
.H| $
#| $
#| $
#| $
#H. $
$$
#HH| $
## || $
## H|| $
##H || $
#HH| $
$$
#| $
##| $
#| $
#| $
#| $
$$
##HH| $
. || $
#HH| $
## . $
##HH|| $
$$
##HH| $
. || $
#HH| $
. || $
##HH| $
$$
#|| $
#H|| $
## || $
##H||| $
.|| $
$$
##HH|| $
## . $
##HH| $
. || $
##HH| $
$$
#HH| $
## . $
##HH| $
## || $
#HH| $
$$
##HH|| $
. #| $
#| $
#| $
##. $
$$
#HH| $
## || $
#HH| $
## || $
#HH| $
$$
#HH| $
## || $
#HH|| $
. || $
#HH| $
$$
#| $
#| $
.. $
#| $
#| $
$$
#| $
#| $
.. $
#| $
#| $
#. $$
.H| $
#| $
##. $
#| $
.H| $
$$
.. $
#H|| $
.. $
#H|| $
.. $
$$
##. $
#| $
.|| $
#| $
##. $
$$
##HH| $
. || $
#H| $
.. $
#| $
$$
#HH| $
## H|| $
## H|| $
## . $
#HH| $
$$
#| $
#HH| $
## || $
##HH|| $
## || $
$$
##HH| $
## || $
##HH| $
## || $
##HH| $
$$
#HH|| $
## . $
## . $
## . $
#HH|| $
$$
##HH| $
## || $
## || $
## || $
##HH| $
$$
##HH|| $
# . $
##HH| $
## . $
##HH|| $
$$
##HH|| $
## . $
##HH| $
## . $
## . $
$$
#HH|| $
## . $
## H|| $
## || $
#HH|| $
$$
## || $
## || $
##HH|| $
## || $
## || $
$$
#HH| $
#| $
#| $
#| $
#HH| $
$$
. || $
. || $
. || $
## || $
#HH| $
$$
## || $
## H| $
##H| $
## H| $
## || $
$$
##. $
##. $
##. $
## . $
##HH| $
$$
## || $
### H|| $
###HH|| $
## H || $
## || $
$$
## || $
##H || $
##HH|| $
## H|| $
## || $
$$
#HH| $
## || $
## || $
## || $
#HH| $
$$
##HH| $
## || $
##HH| $
## . $
##. $
$$
#HH| $
## || $
## || $
## H| $
#HHH| $
$$
##HH| $
## || $
##HH| $
## H| $
## || $
$$
#HH|| $
## . $
#HH| $
. || $
##HH| $
$$
##HH|| $
.#|. $
#| $
#| $
#| $
$$
## || $
## || $
## || $
## || $
#HH| $
$$
## || $
## || $
## || $
#HH| $
#| $
$$
## || $
## H || $
###HH|| $
### H|| $
## || $
$$
## || $
#HH| $
#| $
#HH| $
## || $
$$
## || $
## || $
#HH| $
#| $
#| $
$$
##HH|| $
. #| $
#| $
#H . $
##HH|| $
$$
##H| $
##. $
##. $
##. $
##H| $
$$
#H. $
#| $
#| $
#| $
.H| $
$$
##H| $
.H| $
.H| $
.H| $
##H| $
$$
#| $
##|| $
# | $
$
$
$$
$
$
.. $
.. $
.... $
##HH|| $$
#| $
#| $
.| $
$
$
$$
$
##| $
.H| $
##H| $
##HH| $
$$
##. $
##. $
##H| $
## H| $
##H| $
$$
.. $
#HH| $
## . $
## . $
#HH| $
$$
.H| $
.H| $
#HH| $
## H| $
#HH| $
$$
$
#H| $
##HH| $
## . $
#HH| $
$$
#H| $
##. $
##|. $
##. $
##. $
$$
$
#HH| $
## H| $
#HH| $
. H| $
##H| $$
##. $
##. $
##H| $
## H| $
## H| $
$$
#| $
... $
#| $
#| $
#H| $
$$
.H| $
. . $
.H| $
.H| $
.H| $
##| $$
## . $
## H| $
##H| $
##H| $
## H| $
$$
#| $
#|. $
#| $
#| $
#H| $
$$
$
##H H| $
### HH| $
## H H| $
## H| $
$$
$
##H| $
## H| $
## H| $
## H| $
$$
$
#H| $
## H| $
## H| $
#H| $
$$
$
##H| $
## H| $
##H| $
##. $
##. $$
$
#HH| $
## H| $
#HH| $
.H| $
.H| $$
$
## H| $
##H| $
##. $
##. $
$$
$
#HH| $
##H| $
. H| $
##H| $
$$
#|. $
##HH| $
#|. $
#| $
#H| $
$$
$
## H| $
## H| $
## H| $
#HH| $
$$
$
## H| $
## H| $
#H| $
#. $
$$
$
## H| $
## H H| $
###HHH| $
## H| $
$$
$
## H| $
#H| $
#H| $
## H| $
$$
$
## H| $
## H| $
#HH| $
. H| $
##H| $$
$
##HH| $
.#| $
#|. $
##HH| $
$$
#HH| $
#|. $
##. $
#|. $
#HH| $
$$
#| $
#| $
#| $
#| $
#| $
#| $$
##H| $
.#| $
.H| $
.#| $
##H| $
$$
#H H| $
##HHH| $
## H| $
. . $
$
$$
#| $
##|.. $
.H| $
##H| $
##HH| $
$$
.#| $
#H|. $
##HH| $
## . $
#HH| $
$$
#| $
... $
#| $
#| $
#H| $
$$
.#| $
#H|. $
## H| $
## H| $
#H| $
$$
#| $
## H| $
## H| $
## H| $
#HH| $
$$
##HH| $
... $
##H| $
## H| $
## H| $
$$
##HH|| $
... $
##H || $
## H|| $
## || $
$$
`
@@ -0,0 +1,80 @@
2.0.0 - 2024-09-04
==========
* Drop support for Node.js <18
1.0.0 - 2024-09-04
==========
* Drop support for Node.js below 0.8
* Fix: Ignore `If-Modified-Since` in the presence of `If-None-Match`, according to [spec](https://www.rfc-editor.org/rfc/rfc9110.html#section-13.1.3-5). Fixes [#35](https://github.com/jshttp/fresh/issues/35)
0.5.2 / 2017-09-13
==================
* Fix regression matching multiple ETags in `If-None-Match`
* perf: improve `If-None-Match` token parsing
0.5.1 / 2017-09-11
==================
* Fix handling of modified headers with invalid dates
* perf: improve ETag match loop
0.5.0 / 2017-02-21
==================
* Fix incorrect result when `If-None-Match` has both `*` and ETags
* Fix weak `ETag` matching to match spec
* perf: delay reading header values until needed
* perf: skip checking modified time if ETag check failed
* perf: skip parsing `If-None-Match` when no `ETag` header
* perf: use `Date.parse` instead of `new Date`
0.4.0 / 2017-02-05
==================
* Fix false detection of `no-cache` request directive
* perf: enable strict mode
* perf: hoist regular expressions
* perf: remove duplicate conditional
* perf: remove unnecessary boolean coercions
0.3.0 / 2015-05-12
==================
* Add weak `ETag` matching support
0.2.4 / 2014-09-07
==================
* Support Node.js 0.6
0.2.3 / 2014-09-07
==================
* Move repository to jshttp
0.2.2 / 2014-02-19
==================
* Revert "Fix for blank page on Safari reload"
0.2.1 / 2014-01-29
==================
* Fix for blank page on Safari reload
0.2.0 / 2013-08-11
==================
* Return stale for `Cache-Control: no-cache`
0.1.0 / 2012-06-15
==================
* Add `If-None-Match: *` support
0.0.1 / 2012-06-10
==================
* Initial release
@@ -0,0 +1 @@
{"version":3,"file":"defaultStreamHandler.js","names":[],"sources":["../../../src/ssr/defaultStreamHandler.tsx"],"sourcesContent":["import { defineHandlerCallback } from '@tanstack/router-core/ssr/server'\nimport { RouterServer } from './RouterServer'\nimport { renderRouterToStream } from './renderRouterToStream'\n\nexport const defaultStreamHandler = defineHandlerCallback(\n ({ request, router, responseHeaders }) =>\n renderRouterToStream({\n request,\n router,\n responseHeaders,\n children: <RouterServer router={router} />,\n }),\n)\n"],"mappings":";;;;;AAIA,IAAa,uBAAuB,uBACjC,EAAE,SAAS,QAAQ,sBAClB,qBAAqB;CACnB;CACA;CACA;CACA,UAAU,oBAAC,cAAD,EAAsB,QAAU,CAAA;CAC3C,CAAC,CACL"}
@@ -0,0 +1,86 @@
import { expect, expectTypeOf, test } from "vitest";
import * as z from "zod/v4";
test("basic apply (object)", () => {
const schema = z
.object({
a: z.number(),
b: z.string(),
})
.apply((s) => s.omit({ b: true }))
.apply((s) => s.extend({ c: z.boolean() }));
expect(z.toJSONSchema(schema)).toMatchInlineSnapshot(`
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"a": {
"type": "number",
},
"c": {
"type": "boolean",
},
},
"required": [
"a",
"c",
],
"type": "object",
}
`);
expectTypeOf<z.infer<typeof schema>>().toEqualTypeOf<{
a: number;
c: boolean;
}>();
});
test("basic apply (number)", () => {
const setCommonNumberChecks = <T extends z.ZodNumber>(schema: T) => {
return schema.min(0).max(100);
};
const schema = z.number().apply(setCommonNumberChecks).nullable();
expect(() => schema.parse(-1)).toThrowError();
expect(() => schema.parse(101)).toThrowError();
expect(schema.parse(0)).toBe(0);
expect(schema.parse(null)).toBe(null);
expectTypeOf<z.infer<typeof schema>>().toEqualTypeOf<number | null>();
});
test("The callback's return value becomes the apply's return value.", () => {
const symbol = Symbol();
const result = z.number().apply(() => symbol);
expect(result).toBe(symbol);
expectTypeOf<typeof result>().toEqualTypeOf<symbol>();
});
test("apply forwards extra args to the callback", () => {
const withDefault = <TSchema extends z.ZodType>(schema: TSchema, defaultValue: z.output<TSchema>) => {
return schema.nullish().transform((x) => x ?? defaultValue);
};
const schema = z.string().apply(withDefault, "default-id");
expect(schema.parse(undefined)).toBe("default-id");
expect(schema.parse(null)).toBe("default-id");
expect(schema.parse("value")).toBe("value");
expectTypeOf<z.infer<typeof schema>>().toEqualTypeOf<string>();
});
test("apply type-checks the extra args", () => {
const withMin = (schema: z.ZodString, n: number) => schema.min(n);
expect(z.string().apply(withMin, 3).parse("abcd")).toBe("abcd");
expectTypeOf(z.number().apply<z.ZodNumber>((schema) => schema.min(0))).toEqualTypeOf<z.ZodNumber>();
// @ts-expect-error wrong arg type
z.string().apply(withMin, "3");
// @ts-expect-error missing arg
z.string().apply(withMin);
// @ts-expect-error extra arg for a single-parameter callback
z.string().apply((schema: z.ZodString) => schema, 3);
});
@@ -0,0 +1,79 @@
export declare enum PredefinedFormats {
camelCase = 1,
strictCamelCase = 2,
PascalCase = 3,
StrictPascalCase = 4,
snake_case = 5,
UPPER_CASE = 6
}
export type PredefinedFormatsString = keyof typeof PredefinedFormats;
export declare enum UnderscoreOptions {
forbid = 1,
allow = 2,
require = 3,
requireDouble = 4,
allowDouble = 5,
allowSingleOrDouble = 6
}
export type UnderscoreOptionsString = keyof typeof UnderscoreOptions;
export declare enum Selectors {
variable = 1,
function = 2,
parameter = 4,
parameterProperty = 8,
classicAccessor = 16,
enumMember = 32,
classMethod = 64,
objectLiteralMethod = 128,
typeMethod = 256,
classProperty = 512,
objectLiteralProperty = 1024,
typeProperty = 2048,
autoAccessor = 4096,
class = 8192,
interface = 16384,
typeAlias = 32768,
enum = 65536,
typeParameter = 131072,
import = 262144
}
export type SelectorsString = keyof typeof Selectors;
export declare enum MetaSelectors {
default = -1,
variableLike = 7,
memberLike = 8184,
typeLike = 253952,
method = 448,
property = 3584,
accessor = 4112
}
export type MetaSelectorsString = keyof typeof MetaSelectors;
export type IndividualAndMetaSelectorsString = MetaSelectorsString | SelectorsString;
export declare enum Modifiers {
const = 1,
readonly = 2,
static = 4,
public = 8,
protected = 16,
private = 32,
'#private' = 64,
abstract = 128,
destructured = 256,
global = 512,
exported = 1024,
unused = 2048,
requiresQuotes = 4096,
override = 8192,
async = 16384,
default = 32768,
namespace = 65536
}
export type ModifiersString = keyof typeof Modifiers;
export declare enum TypeModifiers {
boolean = 131072,
string = 262144,
number = 524288,
function = 1048576,
array = 2097152
}
export type TypeModifiersString = keyof typeof TypeModifiers;
@@ -0,0 +1,65 @@
{
"name": "@humanwhocodes/module-importer",
"version": "1.0.1",
"description": "Universal module importer for Node.js",
"main": "src/module-importer.cjs",
"module": "src/module-importer.js",
"type": "module",
"types": "dist/module-importer.d.ts",
"exports": {
"require": "./src/module-importer.cjs",
"import": "./src/module-importer.js"
},
"files": [
"dist",
"src"
],
"publishConfig": {
"access": "public"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.js": [
"eslint --fix"
]
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/nzakas"
},
"scripts": {
"build": "rollup -c && tsc",
"prepare": "npm run build",
"lint": "eslint src/ tests/",
"test:unit": "c8 mocha tests/module-importer.test.js",
"test:build": "node tests/pkg.test.cjs && node tests/pkg.test.mjs",
"test": "npm run test:unit && npm run test:build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/humanwhocodes/module-importer.git"
},
"keywords": [
"modules",
"esm",
"commonjs"
],
"engines": {
"node": ">=12.22"
},
"author": "Nicholas C. Zaks",
"license": "Apache-2.0",
"devDependencies": {
"@types/node": "^18.7.6",
"c8": "7.12.0",
"chai": "4.3.6",
"eslint": "8.22.0",
"lint-staged": "13.0.3",
"mocha": "9.2.2",
"rollup": "2.78.0",
"typescript": "4.7.4",
"yorkie": "2.0.0"
}
}
@@ -0,0 +1 @@
{"version":3,"file":"arrow-down-left-square.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,588 @@
//#region rolldown:runtime
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
value: mod,
enumerable: true
}) : target, mod));
//#endregion
const path = __toESM(require("path"));
const fs = __toESM(require("fs"));
//#region src/utils.ts
function cleanPath(path$1) {
let normalized = (0, path.normalize)(path$1);
if (normalized.length > 1 && normalized[normalized.length - 1] === path.sep) normalized = normalized.substring(0, normalized.length - 1);
return normalized;
}
const SLASHES_REGEX = /[\\/]/g;
function convertSlashes(path$1, separator) {
return path$1.replace(SLASHES_REGEX, separator);
}
const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
function isRootDirectory(path$1) {
return path$1 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$1);
}
function normalizePath(path$1, options) {
const { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options;
const pathNeedsCleaning = process.platform === "win32" && path$1.includes("/") || path$1.startsWith(".");
if (resolvePaths) path$1 = (0, path.resolve)(path$1);
if (normalizePath$1 || pathNeedsCleaning) path$1 = cleanPath(path$1);
if (path$1 === ".") return "";
const needsSeperator = path$1[path$1.length - 1] !== pathSeparator;
return convertSlashes(needsSeperator ? path$1 + pathSeparator : path$1, pathSeparator);
}
//#endregion
//#region src/api/functions/join-path.ts
function joinPathWithBasePath(filename, directoryPath) {
return directoryPath + filename;
}
function joinPathWithRelativePath(root, options) {
return function(filename, directoryPath) {
const sameRoot = directoryPath.startsWith(root);
if (sameRoot) return directoryPath.slice(root.length) + filename;
else return convertSlashes((0, path.relative)(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
};
}
function joinPath(filename) {
return filename;
}
function joinDirectoryPath(filename, directoryPath, separator) {
return directoryPath + filename + separator;
}
function build$7(root, options) {
const { relativePaths, includeBasePath } = options;
return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
}
//#endregion
//#region src/api/functions/push-directory.ts
function pushDirectoryWithRelativePath(root) {
return function(directoryPath, paths) {
paths.push(directoryPath.substring(root.length) || ".");
};
}
function pushDirectoryFilterWithRelativePath(root) {
return function(directoryPath, paths, filters) {
const relativePath = directoryPath.substring(root.length) || ".";
if (filters.every((filter) => filter(relativePath, true))) paths.push(relativePath);
};
}
const pushDirectory = (directoryPath, paths) => {
paths.push(directoryPath || ".");
};
const pushDirectoryFilter = (directoryPath, paths, filters) => {
const path$1 = directoryPath || ".";
if (filters.every((filter) => filter(path$1, true))) paths.push(path$1);
};
const empty$2 = () => {};
function build$6(root, options) {
const { includeDirs, filters, relativePaths } = options;
if (!includeDirs) return empty$2;
if (relativePaths) return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root);
return filters && filters.length ? pushDirectoryFilter : pushDirectory;
}
//#endregion
//#region src/api/functions/push-file.ts
const pushFileFilterAndCount = (filename, _paths, counts, filters) => {
if (filters.every((filter) => filter(filename, false))) counts.files++;
};
const pushFileFilter = (filename, paths, _counts, filters) => {
if (filters.every((filter) => filter(filename, false))) paths.push(filename);
};
const pushFileCount = (_filename, _paths, counts, _filters) => {
counts.files++;
};
const pushFile = (filename, paths) => {
paths.push(filename);
};
const empty$1 = () => {};
function build$5(options) {
const { excludeFiles, filters, onlyCounts } = options;
if (excludeFiles) return empty$1;
if (filters && filters.length) return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
else if (onlyCounts) return pushFileCount;
else return pushFile;
}
//#endregion
//#region src/api/functions/get-array.ts
const getArray = (paths) => {
return paths;
};
const getArrayGroup = () => {
return [""].slice(0, 0);
};
function build$4(options) {
return options.group ? getArrayGroup : getArray;
}
//#endregion
//#region src/api/functions/group-files.ts
const groupFiles = (groups, directory, files) => {
groups.push({
directory,
files,
dir: directory
});
};
const empty = () => {};
function build$3(options) {
return options.group ? groupFiles : empty;
}
//#endregion
//#region src/api/functions/resolve-symlink.ts
const resolveSymlinksAsync = function(path$1, state, callback$1) {
const { queue, fs: fs$1, options: { suppressErrors } } = state;
queue.enqueue();
fs$1.realpath(path$1, (error, resolvedPath) => {
if (error) return queue.dequeue(suppressErrors ? null : error, state);
fs$1.stat(resolvedPath, (error$1, stat) => {
if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return queue.dequeue(null, state);
callback$1(stat, resolvedPath);
queue.dequeue(null, state);
});
});
};
const resolveSymlinks = function(path$1, state, callback$1) {
const { queue, fs: fs$1, options: { suppressErrors } } = state;
queue.enqueue();
try {
const resolvedPath = fs$1.realpathSync(path$1);
const stat = fs$1.statSync(resolvedPath);
if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return;
callback$1(stat, resolvedPath);
} catch (e) {
if (!suppressErrors) throw e;
}
};
function build$2(options, isSynchronous) {
if (!options.resolveSymlinks || options.excludeSymlinks) return null;
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
}
function isRecursive(path$1, resolved, state) {
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
let parent = (0, path.dirname)(path$1);
let depth = 1;
while (parent !== state.root && depth < 2) {
const resolvedPath = state.symlinks.get(parent);
const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath));
if (isSameRoot) depth++;
else parent = (0, path.dirname)(parent);
}
state.symlinks.set(path$1, resolved);
return depth > 1;
}
function isRecursiveUsingRealPaths(resolved, state) {
return state.visited.includes(resolved + state.options.pathSeparator);
}
//#endregion
//#region src/api/functions/invoke-callback.ts
const onlyCountsSync = (state) => {
return state.counts;
};
const groupsSync = (state) => {
return state.groups;
};
const defaultSync = (state) => {
return state.paths;
};
const limitFilesSync = (state) => {
return state.paths.slice(0, state.options.maxFiles);
};
const onlyCountsAsync = (state, error, callback$1) => {
report(error, callback$1, state.counts, state.options.suppressErrors);
return null;
};
const defaultAsync = (state, error, callback$1) => {
report(error, callback$1, state.paths, state.options.suppressErrors);
return null;
};
const limitFilesAsync = (state, error, callback$1) => {
report(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
return null;
};
const groupsAsync = (state, error, callback$1) => {
report(error, callback$1, state.groups, state.options.suppressErrors);
return null;
};
function report(error, callback$1, output, suppressErrors) {
if (error && !suppressErrors) callback$1(error, output);
else callback$1(null, output);
}
function build$1(options, isSynchronous) {
const { onlyCounts, group, maxFiles } = options;
if (onlyCounts) return isSynchronous ? onlyCountsSync : onlyCountsAsync;
else if (group) return isSynchronous ? groupsSync : groupsAsync;
else if (maxFiles) return isSynchronous ? limitFilesSync : limitFilesAsync;
else return isSynchronous ? defaultSync : defaultAsync;
}
//#endregion
//#region src/api/functions/walk-directory.ts
const readdirOpts = { withFileTypes: true };
const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
state.queue.enqueue();
if (currentDepth < 0) return state.queue.dequeue(null, state);
const { fs: fs$1 } = state;
state.visited.push(crawlPath);
state.counts.directories++;
fs$1.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
callback$1(entries, directoryPath, currentDepth);
state.queue.dequeue(state.options.suppressErrors ? null : error, state);
});
};
const walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
const { fs: fs$1 } = state;
if (currentDepth < 0) return;
state.visited.push(crawlPath);
state.counts.directories++;
let entries = [];
try {
entries = fs$1.readdirSync(crawlPath || ".", readdirOpts);
} catch (e) {
if (!state.options.suppressErrors) throw e;
}
callback$1(entries, directoryPath, currentDepth);
};
function build(isSynchronous) {
return isSynchronous ? walkSync : walkAsync;
}
//#endregion
//#region src/api/queue.ts
/**
* This is a custom stateless queue to track concurrent async fs calls.
* It increments a counter whenever a call is queued and decrements it
* as soon as it completes. When the counter hits 0, it calls onQueueEmpty.
*/
var Queue = class {
count = 0;
constructor(onQueueEmpty) {
this.onQueueEmpty = onQueueEmpty;
}
enqueue() {
this.count++;
return this.count;
}
dequeue(error, output) {
if (this.onQueueEmpty && (--this.count <= 0 || error)) {
this.onQueueEmpty(error, output);
if (error) {
output.controller.abort();
this.onQueueEmpty = void 0;
}
}
}
};
//#endregion
//#region src/api/counter.ts
var Counter = class {
_files = 0;
_directories = 0;
set files(num) {
this._files = num;
}
get files() {
return this._files;
}
set directories(num) {
this._directories = num;
}
get directories() {
return this._directories;
}
/**
* @deprecated use `directories` instead
*/
/* c8 ignore next 3 */
get dirs() {
return this._directories;
}
};
//#endregion
//#region src/api/aborter.ts
/**
* AbortController is not supported on Node 14 so we use this until we can drop
* support for Node 14.
*/
var Aborter = class {
aborted = false;
abort() {
this.aborted = true;
}
};
//#endregion
//#region src/api/walker.ts
var Walker = class {
root;
isSynchronous;
state;
joinPath;
pushDirectory;
pushFile;
getArray;
groupFiles;
resolveSymlink;
walkDirectory;
callbackInvoker;
constructor(root, options, callback$1) {
this.isSynchronous = !callback$1;
this.callbackInvoker = build$1(options, this.isSynchronous);
this.root = normalizePath(root, options);
this.state = {
root: isRootDirectory(this.root) ? this.root : this.root.slice(0, -1),
paths: [""].slice(0, 0),
groups: [],
counts: new Counter(),
options,
queue: new Queue((error, state) => this.callbackInvoker(state, error, callback$1)),
symlinks: /* @__PURE__ */ new Map(),
visited: [""].slice(0, 0),
controller: new Aborter(),
fs: options.fs || fs
};
this.joinPath = build$7(this.root, options);
this.pushDirectory = build$6(this.root, options);
this.pushFile = build$5(options);
this.getArray = build$4(options);
this.groupFiles = build$3(options);
this.resolveSymlink = build$2(options, this.isSynchronous);
this.walkDirectory = build(this.isSynchronous);
}
start() {
this.pushDirectory(this.root, this.state.paths, this.state.options.filters);
this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
}
walk = (entries, directoryPath, depth) => {
const { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;
if (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles) return;
const files = this.getArray(this.state.paths);
for (let i = 0; i < entries.length; ++i) {
const entry = entries[i];
if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) {
const filename = this.joinPath(entry.name, directoryPath);
this.pushFile(filename, files, this.state.counts, filters);
} else if (entry.isDirectory()) {
let path$1 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
if (exclude && exclude(entry.name, path$1)) continue;
this.pushDirectory(path$1, paths, filters);
this.walkDirectory(this.state, path$1, path$1, depth - 1, this.walk);
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
let path$1 = joinPathWithBasePath(entry.name, directoryPath);
this.resolveSymlink(path$1, this.state, (stat, resolvedPath) => {
if (stat.isDirectory()) {
resolvedPath = normalizePath(resolvedPath, this.state.options);
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$1 + pathSeparator)) return;
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$1 + pathSeparator, depth - 1, this.walk);
} else {
resolvedPath = useRealPaths ? resolvedPath : path$1;
const filename = (0, path.basename)(resolvedPath);
const directoryPath$1 = normalizePath((0, path.dirname)(resolvedPath), this.state.options);
resolvedPath = this.joinPath(filename, directoryPath$1);
this.pushFile(resolvedPath, files, this.state.counts, filters);
}
});
}
}
this.groupFiles(this.state.groups, directoryPath, files);
};
};
//#endregion
//#region src/api/async.ts
function promise(root, options) {
return new Promise((resolve$1, reject) => {
callback(root, options, (err, output) => {
if (err) return reject(err);
resolve$1(output);
});
});
}
function callback(root, options, callback$1) {
let walker = new Walker(root, options, callback$1);
walker.start();
}
//#endregion
//#region src/api/sync.ts
function sync(root, options) {
const walker = new Walker(root, options);
return walker.start();
}
//#endregion
//#region src/builder/api-builder.ts
var APIBuilder = class {
constructor(root, options) {
this.root = root;
this.options = options;
}
withPromise() {
return promise(this.root, this.options);
}
withCallback(cb) {
callback(this.root, this.options, cb);
}
sync() {
return sync(this.root, this.options);
}
};
//#endregion
//#region src/builder/index.ts
let pm = null;
/* c8 ignore next 6 */
try {
require.resolve("picomatch");
pm = require("picomatch");
} catch {}
var Builder = class {
globCache = {};
options = {
maxDepth: Infinity,
suppressErrors: true,
pathSeparator: path.sep,
filters: []
};
globFunction;
constructor(options) {
this.options = {
...this.options,
...options
};
this.globFunction = this.options.globFunction;
}
group() {
this.options.group = true;
return this;
}
withPathSeparator(separator) {
this.options.pathSeparator = separator;
return this;
}
withBasePath() {
this.options.includeBasePath = true;
return this;
}
withRelativePaths() {
this.options.relativePaths = true;
return this;
}
withDirs() {
this.options.includeDirs = true;
return this;
}
withMaxDepth(depth) {
this.options.maxDepth = depth;
return this;
}
withMaxFiles(limit) {
this.options.maxFiles = limit;
return this;
}
withFullPaths() {
this.options.resolvePaths = true;
this.options.includeBasePath = true;
return this;
}
withErrors() {
this.options.suppressErrors = false;
return this;
}
withSymlinks({ resolvePaths = true } = {}) {
this.options.resolveSymlinks = true;
this.options.useRealPaths = resolvePaths;
return this.withFullPaths();
}
withAbortSignal(signal) {
this.options.signal = signal;
return this;
}
normalize() {
this.options.normalizePath = true;
return this;
}
filter(predicate) {
this.options.filters.push(predicate);
return this;
}
onlyDirs() {
this.options.excludeFiles = true;
this.options.includeDirs = true;
return this;
}
exclude(predicate) {
this.options.exclude = predicate;
return this;
}
onlyCounts() {
this.options.onlyCounts = true;
return this;
}
crawl(root) {
return new APIBuilder(root || ".", this.options);
}
withGlobFunction(fn) {
this.globFunction = fn;
return this;
}
/**
* @deprecated Pass options using the constructor instead:
* ```ts
* new fdir(options).crawl("/path/to/root");
* ```
* This method will be removed in v7.0
*/
/* c8 ignore next 4 */
crawlWithOptions(root, options) {
this.options = {
...this.options,
...options
};
return new APIBuilder(root || ".", this.options);
}
glob(...patterns) {
if (this.globFunction) return this.globWithOptions(patterns);
return this.globWithOptions(patterns, ...[{ dot: true }]);
}
globWithOptions(patterns, ...options) {
const globFn = this.globFunction || pm;
/* c8 ignore next 5 */
if (!globFn) throw new Error("Please specify a glob function to use glob matching.");
var isMatch = this.globCache[patterns.join("\0")];
if (!isMatch) {
isMatch = globFn(patterns, ...options);
this.globCache[patterns.join("\0")] = isMatch;
}
this.options.filters.push((path$1) => isMatch(path$1));
return this;
}
};
//#endregion
exports.fdir = Builder;
@@ -0,0 +1,297 @@
# BalancedPool
<!--introduced_in=v4.8.0-->
<!--type=module-->
<!-- source_link=lib/dispatcher/balanced-pool.js -->
> Stability: 2 - Stable
A `BalancedPool` distributes requests across a set of {Pool} instances, each
connected to a different upstream. It uses a weighted round-robin algorithm:
every upstream starts with the same weight, and the weight is adjusted up on
successful connections and down on connection errors, so that healthy upstreams
receive a larger share of traffic.
Requests are not guaranteed to be dispatched in the order they are issued.
```mjs
import { BalancedPool } from 'undici'
const pool = new BalancedPool([
'http://localhost:3000',
'http://localhost:3001',
'http://localhost:3002',
])
const { statusCode, body } = await pool.request({
path: '/',
method: 'GET',
})
console.log('response received', statusCode)
for await (const chunk of body) {
console.log('data', chunk.toString())
}
```
## Class: `BalancedPool`
<!-- YAML
added: v4.8.0
changes:
- version: v4.10.4
pr-url: https://github.com/nodejs/undici/pull/1114
description: Introduced the `BalancedPool` class.
-->
* Extends: {Dispatcher}
A pool of {Pool} instances connected to multiple upstreams.
### `new BalancedPool(upstreams[, options])`
<!-- YAML
added: v4.8.0
changes:
- version: v4.15.0
pr-url: https://github.com/nodejs/undici/pull/1237
description: Added the `factory` option.
-->
* `upstreams` {URL|string|URL[]|string[]} One or more upstream origins. Each
value should only include the **protocol, hostname, and port**. **Default:**
`[]`.
* `options` {BalancedPoolOptions} (optional)
The options passed to the constructor are forwarded to every {Pool} instance
that is created for an upstream.
#### Parameter: `BalancedPoolOptions`
Extends: {PoolOptions}
In addition to all {PoolOptions}, the following options are supported:
* `factory` {Function} A function used to create the {Pool} instance for each
upstream. **Default:** `(origin, opts) => new Pool(origin, opts)`.
* `origin` {URL|string} The upstream origin.
* `opts` {Object} The options object derived from the constructor options.
* Returns: {Dispatcher}
* `maxWeightPerServer` {number} The maximum weight any single upstream can
reach. Successful connections increase an upstream's weight up to this value.
**Default:** `100`.
* `errorPenalty` {number} The amount by which an upstream's weight is decreased
on a connection error and increased on a successful connection. **Default:**
`15`.
### `balancedPool.addUpstream(upstream)`
<!-- YAML
added: v4.8.0
-->
* `upstream` {URL|string} The upstream origin to add. It should only include the
**protocol, hostname, and port**.
* Returns: {BalancedPool} The `BalancedPool` instance, for chaining.
Adds an upstream. If an open, non-destroyed upstream with the same origin is
already present, the call is a no-op.
### `balancedPool.removeUpstream(upstream)`
<!-- YAML
added: v4.8.0
-->
* `upstream` {URL|string} The upstream origin to remove. It should only include
the **protocol, hostname, and port**.
* Returns: {BalancedPool} The `BalancedPool` instance, for chaining.
Removes an upstream that was previously added. If no matching upstream is found,
the call is a no-op.
### `balancedPool.getUpstream(upstream)`
<!-- YAML
added: v7.17.0
-->
* `upstream` {URL|string} The upstream origin to look up. It should only include
the **protocol, hostname, and port**.
* Returns: {Pool|undefined} The {Pool} instance managing the given upstream, or
`undefined` if it is not present.
Returns the {Pool} instance for the given upstream origin, if it is open and not
destroyed.
### `balancedPool.upstreams`
<!-- YAML
added: v4.8.0
-->
* Type: {string[]} The origins of the upstreams that are currently open and not
destroyed.
### `balancedPool.closed`
<!-- YAML
added: v4.8.0
changes:
- version: v4.10.4
pr-url: https://github.com/nodejs/undici/pull/1114
description: Introduced the `BalancedPool` class.
-->
* Type: {boolean} `true` after `balancedPool.close()` has been called.
Implements [`client.closed`][].
### `balancedPool.destroyed`
<!-- YAML
added: v4.8.0
changes:
- version: v4.10.4
pr-url: https://github.com/nodejs/undici/pull/1114
description: Introduced the `BalancedPool` class.
-->
* Type: {boolean} `true` after `balancedPool.destroy()` has been called, or after
`balancedPool.close()` has been called and the shutdown has completed.
Implements [`client.destroyed`][].
### `balancedPool.stats`
<!-- YAML
added: v4.8.0
-->
* Type: {PoolStats}
Returns a {PoolStats} instance aggregating the statistics of the underlying
pools.
### `balancedPool.close([callback])`
<!-- YAML
added: v4.8.0
-->
Implements [`Dispatcher.close([callback])`][].
### `balancedPool.destroy([error[, callback]])`
<!-- YAML
added: v4.8.0
-->
Implements [`Dispatcher.destroy([error, callback])`][].
### `balancedPool.connect(options[, callback])`
<!-- YAML
added: v4.8.0
-->
See [`Dispatcher.connect(options[, callback])`][].
### `balancedPool.dispatch(options, handlers)`
<!-- YAML
added: v4.8.0
changes:
- version: v4.10.4
pr-url: https://github.com/nodejs/undici/pull/1114
description: Introduced the `BalancedPool` class.
-->
Implements [`Dispatcher.dispatch(options, handler)`][].
### `balancedPool.pipeline(options, handler)`
<!-- YAML
added: v4.8.0
-->
See [`Dispatcher.pipeline(options, handler)`][].
### `balancedPool.request(options[, callback])`
<!-- YAML
added: v4.8.0
-->
See [`Dispatcher.request(options[, callback])`][].
### `balancedPool.stream(options, factory[, callback])`
<!-- YAML
added: v4.8.0
-->
See [`Dispatcher.stream(options, factory[, callback])`][].
### `balancedPool.upgrade(options[, callback])`
<!-- YAML
added: v4.8.0
-->
See [`Dispatcher.upgrade(options[, callback])`][].
### Event: `'connect'`
<!-- YAML
added: v4.8.0
changes:
- version: v4.10.4
pr-url: https://github.com/nodejs/undici/pull/1114
description: Introduced the `BalancedPool` class.
- version: v5.8.0
pr-url: https://github.com/nodejs/undici/pull/1069
description: Adopted weighted round-robin selection across upstreams.
-->
See [Dispatcher Event: `'connect'`][].
### Event: `'disconnect'`
<!-- YAML
added: v4.8.0
changes:
- version: v4.10.4
pr-url: https://github.com/nodejs/undici/pull/1114
description: Introduced the `BalancedPool` class.
- version: v5.8.0
pr-url: https://github.com/nodejs/undici/pull/1069
description: Adopted weighted round-robin selection across upstreams.
-->
See [Dispatcher Event: `'disconnect'`][].
### Event: `'drain'`
<!-- YAML
added: v4.8.0
changes:
- version: v4.10.4
pr-url: https://github.com/nodejs/undici/pull/1114
description: Introduced the `BalancedPool` class.
-->
See [Dispatcher Event: `'drain'`][].
[Dispatcher Event: `'connect'`]: Dispatcher.md#event-connect
[Dispatcher Event: `'disconnect'`]: Dispatcher.md#event-disconnect
[Dispatcher Event: `'drain'`]: Dispatcher.md#event-drain
[`Dispatcher.close([callback])`]: Dispatcher.md#dispatcherclosecallback-promise
[`Dispatcher.connect(options[, callback])`]: Dispatcher.md#dispatcherconnectoptions-callback
[`Dispatcher.destroy([error, callback])`]: Dispatcher.md#dispatcherdestroyerror-callback-promise
[`Dispatcher.dispatch(options, handler)`]: Dispatcher.md#dispatcherdispatchoptions-handler
[`Dispatcher.pipeline(options, handler)`]: Dispatcher.md#dispatcherpipelineoptions-handler
[`Dispatcher.request(options[, callback])`]: Dispatcher.md#dispatcherrequestoptions-callback
[`Dispatcher.stream(options, factory[, callback])`]: Dispatcher.md#dispatcherstreamoptions-factory-callback
[`Dispatcher.upgrade(options[, callback])`]: Dispatcher.md#dispatcherupgradeoptions-callback
[`client.closed`]: Client.md#clientclosed
[`client.destroyed`]: Client.md#clientdestroyed
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Spline = createLucideIcon("Spline", [
["circle", { cx: "19", cy: "5", r: "2", key: "mhkx31" }],
["circle", { cx: "5", cy: "19", r: "2", key: "v8kfzx" }],
["path", { d: "M5 17A12 12 0 0 1 17 5", key: "1okkup" }]
]);
export { Spline as default };
//# sourceMappingURL=spline.js.map
@@ -0,0 +1 @@
{"version":3,"file":"badge-dollar-sign.js","sources":["../../../src/icons/badge-dollar-sign.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BadgeDollarSign\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMy44NSA4LjYyYTQgNCAwIDAgMSA0Ljc4LTQuNzcgNCA0IDAgMCAxIDYuNzQgMCA0IDQgMCAwIDEgNC43OCA0Ljc4IDQgNCAwIDAgMSAwIDYuNzQgNCA0IDAgMCAxLTQuNzcgNC43OCA0IDQgMCAwIDEtNi43NSAwIDQgNCAwIDAgMS00Ljc4LTQuNzcgNCA0IDAgMCAxIDAtNi43NloiIC8+CiAgPHBhdGggZD0iTTE2IDhoLTZhMiAyIDAgMSAwIDAgNGg0YTIgMiAwIDEgMSAwIDRIOCIgLz4KICA8cGF0aCBkPSJNMTIgMThWNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/badge-dollar-sign\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 BadgeDollarSign = createLucideIcon('BadgeDollarSign', [\n [\n 'path',\n {\n d: 'M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z',\n key: '3c2336',\n },\n ],\n ['path', { d: 'M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8', key: '1h4pet' }],\n ['path', { d: 'M12 18V6', key: 'zqpxq5' }],\n]);\n\nexport default BadgeDollarSign;\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,CAAkB,iBAAiB,iBAAmB,CAAA,CAAA,CAAA;AAAA,CAC1D,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACzE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"minimize-2.js","sources":["../../../src/icons/minimize-2.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Minimize2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSI0IDE0IDEwIDE0IDEwIDIwIiAvPgogIDxwb2x5bGluZSBwb2ludHM9IjIwIDEwIDE0IDEwIDE0IDQiIC8+CiAgPGxpbmUgeDE9IjE0IiB4Mj0iMjEiIHkxPSIxMCIgeTI9IjMiIC8+CiAgPGxpbmUgeDE9IjMiIHgyPSIxMCIgeTE9IjIxIiB5Mj0iMTQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/minimize-2\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 Minimize2 = createLucideIcon('Minimize2', [\n ['polyline', { points: '4 14 10 14 10 20', key: '11kfnr' }],\n ['polyline', { points: '20 10 14 10 14 4', key: 'rlmsce' }],\n ['line', { x1: '14', x2: '21', y1: '10', y2: '3', key: 'o5lafz' }],\n ['line', { x1: '3', x2: '10', y1: '21', y2: '14', key: '1atl0r' }],\n]);\n\nexport default Minimize2;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC1D,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACjE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACnE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,27 @@
/**
* Check if the value is an object.
*
* 校验是否是一个对象
*
* @example
* ```js
* import { isObject } from 'is-what-type';
*
* isObject(1); // false
* isObject(undefined); // false
* isObject({}); // true
* isObject([]); // true
* isObject(null); // false
* isObject(function() {}); // true
* isObject(new Date()); // true
* isObject('string'); // false
* isObject(true); // false
* isObject(false); // false
* isObject(NaN); // false
* isObject(Infinity); // false
* ```
*
* @param value - The value to check
* @returns `true` if the value is an object, `false` otherwise
*/
export declare function isObject<T = object>(value: unknown): value is T;
@@ -0,0 +1 @@
{"version":3,"file":"build-styles.mjs","sources":["../../../../../src/render/html/utils/build-styles.ts"],"sourcesContent":["import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformProps } from \"../../utils/keys-transform\"\nimport { isCSSVariableName } from \"../../../animation/utils/is-css-variable\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport { buildTransform } from \"./build-transform\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nexport function buildHTMLStyles(\n state: HTMLRenderState,\n latestValues: ResolvedValues,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n const { style, vars, transformOrigin } = state\n\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false\n let hasTransformOrigin = false\n\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key]\n\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true\n continue\n } else if (isCSSVariableName(key)) {\n vars[key] = value\n continue\n } else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true\n transformOrigin[key as keyof typeof transformOrigin] =\n valueAsType\n } else {\n style[key] = valueAsType\n }\n }\n }\n\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(\n latestValues,\n state.transform,\n transformTemplate\n )\n } else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\"\n }\n }\n\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const {\n originX = \"50%\",\n originY = \"50%\",\n originZ = 0,\n } = transformOrigin\n style.transformOrigin = `${originX} ${originY} ${originZ}`\n }\n}\n"],"names":[],"mappings":";;;;;;SASgB,eAAe,CAC3B,KAAsB,EACtB,YAA4B,EAC5B,iBAA0D,EAAA;IAE1D,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,KAAK;;IAG9C,IAAI,YAAY,GAAG,KAAK;IACxB,IAAI,kBAAkB,GAAG,KAAK;AAE9B;;;;;AAKG;AACH,IAAA,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE;AAC5B,QAAA,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC;AAE/B,QAAA,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;;YAEzB,YAAY,GAAG,IAAI;YACnB;QACJ;AAAO,aAAA,IAAI,iBAAiB,CAAC,GAAG,CAAC,EAAE;AAC/B,YAAA,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK;YACjB;QACJ;aAAO;;YAEH,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;AAEhE,YAAA,IAAI,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;;gBAE1B,kBAAkB,GAAG,IAAI;gBACzB,eAAe,CAAC,GAAmC,CAAC;AAChD,oBAAA,WAAW;YACnB;iBAAO;AACH,gBAAA,KAAK,CAAC,GAAG,CAAC,GAAG,WAAW;YAC5B;QACJ;IACJ;AAEA,IAAA,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE;AACzB,QAAA,IAAI,YAAY,IAAI,iBAAiB,EAAE;AACnC,YAAA,KAAK,CAAC,SAAS,GAAG,cAAc,CAC5B,YAAY,EACZ,KAAK,CAAC,SAAS,EACf,iBAAiB,CACpB;QACL;AAAO,aAAA,IAAI,KAAK,CAAC,SAAS,EAAE;AACxB;;;AAGG;AACH,YAAA,KAAK,CAAC,SAAS,GAAG,MAAM;QAC5B;IACJ;AAEA;;;AAGG;IACH,IAAI,kBAAkB,EAAE;AACpB,QAAA,MAAM,EACF,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,CAAC,GACd,GAAG,eAAe;QACnB,KAAK,CAAC,eAAe,GAAG,CAAA,EAAG,OAAO,IAAI,OAAO,CAAA,CAAA,EAAI,OAAO,CAAA,CAAE;IAC9D;AACJ;;;;"}
@@ -0,0 +1,69 @@
import { defaultSerializeError } from './router'
/**
* Well-known symbol used by {@link defer} to tag a promise with
* its deferred state. Consumers can read `promise[TSR_DEFERRED_PROMISE]`
* to access `status`, `data`, or `error`.
*/
export const TSR_DEFERRED_PROMISE = Symbol.for('TSR_DEFERRED_PROMISE')
export type DeferredPromiseState<T> =
| {
status: 'pending'
data?: T
error?: unknown
}
| {
status: 'success'
data: T
}
| {
status: 'error'
data?: T
error: unknown
}
export type DeferredPromise<T> = Promise<T> & {
[TSR_DEFERRED_PROMISE]: DeferredPromiseState<T>
}
/**
* Wrap a promise with a deferred state for use with `<Await>` and `useAwaited`.
*
* The returned promise is augmented with internal state (status/data/error)
* so UI can read progress or suspend until it settles.
*
* @param _promise The promise to wrap.
* @param options Optional config. Provide `serializeError` to customize how
* errors are serialized for transfer.
* @returns The same promise with attached deferred metadata.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/deferFunction
*/
export function defer<T>(
_promise: Promise<T>,
options?: {
serializeError?: typeof defaultSerializeError
},
) {
const promise = _promise as DeferredPromise<T>
// this is already deferred promise
if ((promise as any)[TSR_DEFERRED_PROMISE]) {
return promise
}
promise[TSR_DEFERRED_PROMISE] = { status: 'pending' }
promise
.then((data) => {
promise[TSR_DEFERRED_PROMISE].status = 'success'
promise[TSR_DEFERRED_PROMISE].data = data
})
.catch((error) => {
promise[TSR_DEFERRED_PROMISE].status = 'error'
;(promise[TSR_DEFERRED_PROMISE] as any).error = {
data: (options?.serializeError ?? defaultSerializeError)(error),
__isServerError: true,
}
})
return promise
}
@@ -0,0 +1,106 @@
# obug
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Unit Test][unit-test-src]][unit-test-href]
A lightweight JavaScript debugging utility, forked from [debug](https://www.npmjs.com/package/debug), featuring TypeScript and ESM support.
> [!NOTE]
> obug v1 retains most of the compatibility with [debug](https://github.com/debug-js/debug), but drops support for older browsers and Node.js, making it a drop-in replacement.
>
> obug v2 refactors some API imports and usage for better support of ESM and TypeScript, easier customization, and an even smaller package size.
## Key Differences from `debug`
- ✨ Minimal footprint
- 7.7 kB package size
- 1.4 KB minified + gzipped for browsers
- 📦 Zero dependencies
- 📝 Full TypeScript support
- 🚀 Native ESM compatibility
- 🌐 Optimized for modern runtimes
- ES2015+ browsers
- Modern Node.js versions
- 🎨 Customizable formatting
## Installation
```bash
npm install obug
```
## Usage
```ts
import { createDebug, disable, enable, enabled, namespaces } from 'obug'
// Get the currently enabled namespaces
console.log(namespaces())
const debug = createDebug('my-namespace', {
// All options are optional
useColors: true, // false, true, undefined for auto-detect
color: 2, // custom color
// custom formatArgs
formatArgs(args) {},
formatters: {},
// Node.js only
inspectOpts: {},
// custom log
log: console.log,
})
debug('This is a debug message')
console.log(
debug.namespace, // 'my-namespace'
debug.enabled, // Check if enabled
debug.useColors, // true
debug.color, // 2
debug.formatArgs, // custom formatArgs
debug.formatters, // {}
debug.inspectOpts, // {}
debug.log, // implemented log function
)
// Create a sub-namespace, and it will inherit options from the parent debugger
const sub = debug.extend('sub-namespace')
sub('This is a sub-namespace debug message')
console.log(sub.namespace) // 'my-namespace:sub-namespace'
```
## Original Authors
As obug is a fork of debug with significant modifications, we would like to acknowledge the original authors:
- TJ Holowaychuk
- Nathan Rajlich
- Andrew Rhyne
- Josh Junon
## Sponsors
<p align="center">
<a href="https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg">
<img src='https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg'/>
</a>
</p>
## License
[MIT](./LICENSE) License © 2025-PRESENT [Kevin Deng](https://github.com/sxzz)
[The MIT License](./LICENSE) Copyright (c) 2014-2017 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
[The MIT License](./LICENSE) Copyright (c) 2018-2021 Josh Junon
<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/obug.svg
[npm-version-href]: https://npmjs.com/package/obug
[npm-downloads-src]: https://img.shields.io/npm/dm/obug
[npm-downloads-href]: https://www.npmcharts.com/compare/obug?interval=30
[unit-test-src]: https://github.com/sxzz/obug/actions/workflows/unit-test.yml/badge.svg
[unit-test-href]: https://github.com/sxzz/obug/actions/workflows/unit-test.yml
@@ -0,0 +1,722 @@
import { StringLiteralUnion } from "../utils/types.js";
import { BaseMime } from "../utils/mime.js";
//#region src/jsx/intrinsic-elements.d.ts
/**
* This code is based on React.
* https://github.com/facebook/react
* MIT License
* Copyright (c) Meta Platforms, Inc. and affiliates.
*/
export declare namespace JSX {
export type CrossOrigin = 'anonymous' | 'use-credentials' | '' | undefined;
export interface CSSProperties {
[propertyKey: string]: unknown;
}
type AnyAttributes = {
[attributeName: string]: any;
};
interface JSXAttributes {
dangerouslySetInnerHTML?: {
__html: string;
};
}
interface EventAttributes {
onScroll?: (event: Event) => void;
onScrollCapture?: (event: Event) => void;
onScrollEnd?: (event: Event) => void;
onScrollEndCapture?: (event: Event) => void;
onWheel?: (event: WheelEvent) => void;
onWheelCapture?: (event: WheelEvent) => void;
onAnimationCancel?: (event: AnimationEvent) => void;
onAnimationCancelCapture?: (event: AnimationEvent) => void;
onAnimationEnd?: (event: AnimationEvent) => void;
onAnimationEndCapture?: (event: AnimationEvent) => void;
onAnimationIteration?: (event: AnimationEvent) => void;
onAnimationIterationCapture?: (event: AnimationEvent) => void;
onAnimationStart?: (event: AnimationEvent) => void;
onAnimationStartCapture?: (event: AnimationEvent) => void;
onCopy?: (event: ClipboardEvent) => void;
onCopyCapture?: (event: ClipboardEvent) => void;
onCut?: (event: ClipboardEvent) => void;
onCutCapture?: (event: ClipboardEvent) => void;
onPaste?: (event: ClipboardEvent) => void;
onPasteCapture?: (event: ClipboardEvent) => void;
onCompositionEnd?: (event: CompositionEvent) => void;
onCompositionEndCapture?: (event: CompositionEvent) => void;
onCompositionStart?: (event: CompositionEvent) => void;
onCompositionStartCapture?: (event: CompositionEvent) => void;
onCompositionUpdate?: (event: CompositionEvent) => void;
onCompositionUpdateCapture?: (event: CompositionEvent) => void;
onBlur?: (event: FocusEvent) => void;
onBlurCapture?: (event: FocusEvent) => void;
onFocus?: (event: FocusEvent) => void;
onFocusCapture?: (event: FocusEvent) => void;
onFocusIn?: (event: FocusEvent) => void;
onFocusInCapture?: (event: FocusEvent) => void;
onFocusOut?: (event: FocusEvent) => void;
onFocusOutCapture?: (event: FocusEvent) => void;
onFullscreenChange?: (event: Event) => void;
onFullscreenChangeCapture?: (event: Event) => void;
onFullscreenError?: (event: Event) => void;
onFullscreenErrorCapture?: (event: Event) => void;
onKeyDown?: (event: KeyboardEvent) => void;
onKeyDownCapture?: (event: KeyboardEvent) => void;
onKeyPress?: (event: KeyboardEvent) => void;
onKeyPressCapture?: (event: KeyboardEvent) => void;
onKeyUp?: (event: KeyboardEvent) => void;
onKeyUpCapture?: (event: KeyboardEvent) => void;
onAuxClick?: (event: MouseEvent) => void;
onAuxClickCapture?: (event: MouseEvent) => void;
onClick?: (event: MouseEvent) => void;
onClickCapture?: (event: MouseEvent) => void;
onContextMenu?: (event: MouseEvent) => void;
onContextMenuCapture?: (event: MouseEvent) => void;
onDoubleClick?: (event: MouseEvent) => void;
onDoubleClickCapture?: (event: MouseEvent) => void;
onMouseDown?: (event: MouseEvent) => void;
onMouseDownCapture?: (event: MouseEvent) => void;
onMouseEnter?: (event: MouseEvent) => void;
onMouseEnterCapture?: (event: MouseEvent) => void;
onMouseLeave?: (event: MouseEvent) => void;
onMouseLeaveCapture?: (event: MouseEvent) => void;
onMouseMove?: (event: MouseEvent) => void;
onMouseMoveCapture?: (event: MouseEvent) => void;
onMouseOut?: (event: MouseEvent) => void;
onMouseOutCapture?: (event: MouseEvent) => void;
onMouseOver?: (event: MouseEvent) => void;
onMouseOverCapture?: (event: MouseEvent) => void;
onMouseUp?: (event: MouseEvent) => void;
onMouseUpCapture?: (event: MouseEvent) => void;
onMouseWheel?: (event: WheelEvent) => void;
onMouseWheelCapture?: (event: WheelEvent) => void;
onGotPointerCapture?: (event: PointerEvent) => void;
onGotPointerCaptureCapture?: (event: PointerEvent) => void;
onLostPointerCapture?: (event: PointerEvent) => void;
onLostPointerCaptureCapture?: (event: PointerEvent) => void;
onPointerCancel?: (event: PointerEvent) => void;
onPointerCancelCapture?: (event: PointerEvent) => void;
onPointerDown?: (event: PointerEvent) => void;
onPointerDownCapture?: (event: PointerEvent) => void;
onPointerEnter?: (event: PointerEvent) => void;
onPointerEnterCapture?: (event: PointerEvent) => void;
onPointerLeave?: (event: PointerEvent) => void;
onPointerLeaveCapture?: (event: PointerEvent) => void;
onPointerMove?: (event: PointerEvent) => void;
onPointerMoveCapture?: (event: PointerEvent) => void;
onPointerOut?: (event: PointerEvent) => void;
onPointerOutCapture?: (event: PointerEvent) => void;
onPointerOver?: (event: PointerEvent) => void;
onPointerOverCapture?: (event: PointerEvent) => void;
onPointerUp?: (event: PointerEvent) => void;
onPointerUpCapture?: (event: PointerEvent) => void;
onTouchCancel?: (event: TouchEvent) => void;
onTouchCancelCapture?: (event: TouchEvent) => void;
onTouchEnd?: (event: TouchEvent) => void;
onTouchEndCapture?: (event: TouchEvent) => void;
onTouchMove?: (event: TouchEvent) => void;
onTouchMoveCapture?: (event: TouchEvent) => void;
onTouchStart?: (event: TouchEvent) => void;
onTouchStartCapture?: (event: TouchEvent) => void;
onTransitionCancel?: (event: TransitionEvent) => void;
onTransitionCancelCapture?: (event: TransitionEvent) => void;
onTransitionEnd?: (event: TransitionEvent) => void;
onTransitionEndCapture?: (event: TransitionEvent) => void;
onTransitionRun?: (event: TransitionEvent) => void;
onTransitionRunCapture?: (event: TransitionEvent) => void;
onTransitionStart?: (event: TransitionEvent) => void;
onTransitionStartCapture?: (event: TransitionEvent) => void;
onFormData?: (event: FormDataEvent) => void;
onFormDataCapture?: (event: FormDataEvent) => void;
onReset?: (event: Event) => void;
onResetCapture?: (event: Event) => void;
onSubmit?: (event: Event) => void;
onSubmitCapture?: (event: Event) => void;
onInvalid?: (event: Event) => void;
onInvalidCapture?: (event: Event) => void;
onSelect?: (event: Event) => void;
onSelectCapture?: (event: Event) => void;
onSelectChange?: (event: Event) => void;
onSelectChangeCapture?: (event: Event) => void;
onInput?: (event: InputEvent) => void;
onInputCapture?: (event: InputEvent) => void;
onBeforeInput?: (event: InputEvent) => void;
onBeforeInputCapture?: (event: InputEvent) => void;
onChange?: (event: Event) => void;
onChangeCapture?: (event: Event) => void;
}
export interface HTMLAttributes extends JSXAttributes, EventAttributes, AnyAttributes {
accesskey?: string | undefined;
autocapitalize?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters' | undefined;
autofocus?: boolean | undefined;
class?: string | Promise<string> | undefined;
contenteditable?: boolean | 'inherit' | 'plaintext-only' | undefined;
contextmenu?: string | undefined;
dir?: string | undefined;
draggable?: 'true' | 'false' | boolean | undefined;
enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' | undefined;
hidden?: boolean | undefined;
id?: string | undefined;
inert?: boolean | undefined;
inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search' | undefined;
is?: string | undefined;
itemid?: string | undefined;
itemprop?: string | undefined;
itemref?: string | undefined;
itemscope?: boolean | undefined;
itemtype?: string | undefined;
lang?: string | undefined;
nonce?: string | undefined;
placeholder?: string | undefined;
/** @see https://developer.mozilla.org/en-US/docs/Web/API/Popover_API */
popover?: boolean | 'auto' | 'manual' | undefined;
slot?: string | undefined;
spellcheck?: boolean | undefined;
style?: CSSProperties | string | undefined;
tabindex?: number | undefined;
title?: string | undefined;
translate?: 'yes' | 'no' | undefined;
itemProp?: string | undefined;
}
type HTMLAttributeReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
type HTMLAttributeAnchorTarget = StringLiteralUnion<'_self' | '_blank' | '_parent' | '_top'>;
interface AnchorHTMLAttributes extends HTMLAttributes {
download?: string | boolean | undefined;
href?: string | undefined;
hreflang?: string | undefined;
media?: string | undefined;
ping?: string | undefined;
target?: HTMLAttributeAnchorTarget | undefined;
type?: StringLiteralUnion<BaseMime> | undefined;
referrerpolicy?: HTMLAttributeReferrerPolicy | undefined;
}
interface AudioHTMLAttributes extends MediaHTMLAttributes {}
interface AreaHTMLAttributes extends HTMLAttributes {
alt?: string | undefined;
coords?: string | undefined;
download?: string | boolean | undefined;
href?: string | undefined;
hreflang?: string | undefined;
media?: string | undefined;
referrerpolicy?: HTMLAttributeReferrerPolicy | undefined;
shape?: string | undefined;
target?: HTMLAttributeAnchorTarget | undefined;
}
interface BaseHTMLAttributes extends HTMLAttributes {
href?: string | undefined;
target?: HTMLAttributeAnchorTarget | undefined;
}
interface BlockquoteHTMLAttributes extends HTMLAttributes {
cite?: string | undefined;
}
/** @see https://developer.mozilla.org/en-US/docs/Web/API/Popover_API */
type HTMLAttributePopoverTargetAction = 'show' | 'hide' | 'toggle';
interface ButtonHTMLAttributes extends HTMLAttributes {
disabled?: boolean | undefined;
form?: string | undefined;
formenctype?: HTMLAttributeFormEnctype | undefined;
formmethod?: HTMLAttributeFormMethod | undefined;
formnovalidate?: boolean | undefined;
formtarget?: HTMLAttributeAnchorTarget | undefined;
name?: string | undefined;
type?: 'submit' | 'reset' | 'button' | undefined;
value?: string | ReadonlyArray<string> | number | undefined;
popovertarget?: string | undefined;
popovertargetaction?: HTMLAttributePopoverTargetAction | undefined;
formAction?: string | Function | undefined;
}
interface CanvasHTMLAttributes extends HTMLAttributes {
height?: number | string | undefined;
width?: number | string | undefined;
}
interface ColHTMLAttributes extends HTMLAttributes {
span?: number | undefined;
width?: number | string | undefined;
}
interface ColgroupHTMLAttributes extends HTMLAttributes {
span?: number | undefined;
}
interface DataHTMLAttributes extends HTMLAttributes {
value?: string | ReadonlyArray<string> | number | undefined;
}
interface DetailsHTMLAttributes extends HTMLAttributes {
open?: boolean | undefined;
}
interface DelHTMLAttributes extends HTMLAttributes {
cite?: string | undefined;
dateTime?: string | undefined;
}
interface DialogHTMLAttributes extends HTMLAttributes {
open?: boolean | undefined;
}
interface EmbedHTMLAttributes extends HTMLAttributes {
height?: number | string | undefined;
src?: string | undefined;
type?: StringLiteralUnion<BaseMime> | undefined;
width?: number | string | undefined;
}
interface FieldsetHTMLAttributes extends HTMLAttributes {
disabled?: boolean | undefined;
form?: string | undefined;
name?: string | undefined;
}
/** @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#method */
type HTMLAttributeFormMethod = 'get' | 'post' | 'dialog';
/** @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#enctype */
type HTMLAttributeFormEnctype = 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
/** @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#autocomplete */
type HTMLAttributeFormAutocomplete = 'on' | 'off';
interface FormHTMLAttributes extends HTMLAttributes {
'accept-charset'?: StringLiteralUnion<'utf-8'> | undefined;
autocomplete?: HTMLAttributeFormAutocomplete | undefined;
enctype?: HTMLAttributeFormEnctype | undefined;
method?: HTMLAttributeFormMethod | undefined;
name?: string | undefined;
novalidate?: boolean | undefined;
target?: HTMLAttributeAnchorTarget | undefined;
action?: string | Function | undefined;
}
interface HtmlHTMLAttributes extends HTMLAttributes {
manifest?: string | undefined;
}
interface IframeHTMLAttributes extends HTMLAttributes {
allow?: string | undefined;
allowfullscreen?: boolean | undefined;
height?: number | string | undefined;
loading?: 'eager' | 'lazy' | undefined;
name?: string | undefined;
referrerpolicy?: HTMLAttributeReferrerPolicy | undefined;
sandbox?: string | undefined;
seamless?: boolean | undefined;
src?: string | undefined;
srcdoc?: string | undefined;
width?: number | string | undefined;
}
interface ImgHTMLAttributes extends HTMLAttributes {
alt?: string | undefined;
crossorigin?: CrossOrigin;
decoding?: 'async' | 'auto' | 'sync' | undefined;
height?: number | string | undefined;
loading?: 'eager' | 'lazy' | undefined;
referrerpolicy?: HTMLAttributeReferrerPolicy | undefined;
sizes?: string | undefined;
src?: string | undefined;
srcset?: string | undefined;
usemap?: string | undefined;
width?: number | string | undefined;
}
interface InsHTMLAttributes extends HTMLAttributes {
cite?: string | undefined;
datetime?: string | undefined;
}
type HTMLInputTypeAttribute = StringLiteralUnion<'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week'>;
type AutoFillAddressKind = 'billing' | 'shipping';
type AutoFillBase = '' | 'off' | 'on';
type AutoFillContactField = 'email' | 'tel' | 'tel-area-code' | 'tel-country-code' | 'tel-extension' | 'tel-local' | 'tel-local-prefix' | 'tel-local-suffix' | 'tel-national';
type AutoFillContactKind = 'home' | 'mobile' | 'work';
type AutoFillCredentialField = 'webauthn';
type AutoFillNormalField = 'additional-name' | 'address-level1' | 'address-level2' | 'address-level3' | 'address-level4' | 'address-line1' | 'address-line2' | 'address-line3' | 'bday-day' | 'bday-month' | 'bday-year' | 'cc-csc' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-family-name' | 'cc-given-name' | 'cc-name' | 'cc-number' | 'cc-type' | 'country' | 'country-name' | 'current-password' | 'family-name' | 'given-name' | 'honorific-prefix' | 'honorific-suffix' | 'name' | 'new-password' | 'one-time-code' | 'organization' | 'postal-code' | 'street-address' | 'transaction-amount' | 'transaction-currency' | 'username';
type OptionalPrefixToken<T extends string> = `${T} ` | '';
type OptionalPostfixToken<T extends string> = ` ${T}` | '';
type AutoFillField = AutoFillNormalField | `${OptionalPrefixToken<AutoFillContactKind>}${AutoFillContactField}`;
type AutoFillSection = `section-${string}`;
type AutoFill = AutoFillBase | `${OptionalPrefixToken<AutoFillSection>}${OptionalPrefixToken<AutoFillAddressKind>}${AutoFillField}${OptionalPostfixToken<AutoFillCredentialField>}`;
interface InputHTMLAttributes extends HTMLAttributes {
accept?: string | undefined;
alt?: string | undefined;
autocomplete?: StringLiteralUnion<AutoFill> | undefined;
capture?: boolean | 'user' | 'environment' | undefined;
checked?: boolean | undefined;
disabled?: boolean | undefined;
form?: string | undefined;
formenctype?: HTMLAttributeFormEnctype | undefined;
formmethod?: HTMLAttributeFormMethod | undefined;
formnovalidate?: boolean | undefined;
formtarget?: HTMLAttributeAnchorTarget | undefined;
height?: number | string | undefined;
list?: string | undefined;
max?: number | string | undefined;
maxlength?: number | undefined;
min?: number | string | undefined;
minlength?: number | undefined;
multiple?: boolean | undefined;
name?: string | undefined;
pattern?: string | undefined;
placeholder?: string | undefined;
readonly?: boolean | undefined;
required?: boolean | undefined;
size?: number | undefined;
src?: string | undefined;
step?: number | string | undefined;
type?: HTMLInputTypeAttribute | undefined;
value?: string | ReadonlyArray<string> | number | undefined;
width?: number | string | undefined;
popovertarget?: string | undefined;
popovertargetaction?: HTMLAttributePopoverTargetAction | undefined;
formAction?: string | Function | undefined;
}
interface KeygenHTMLAttributes extends HTMLAttributes {
challenge?: string | undefined;
disabled?: boolean | undefined;
form?: string | undefined;
keytype?: string | undefined;
name?: string | undefined;
}
interface LabelHTMLAttributes extends HTMLAttributes {
form?: string | undefined;
for?: string | undefined;
}
interface LiHTMLAttributes extends HTMLAttributes {
value?: string | ReadonlyArray<string> | number | undefined;
}
interface LinkHTMLAttributes extends HTMLAttributes {
as?: string | undefined;
crossorigin?: CrossOrigin;
href?: string | undefined;
hreflang?: string | undefined;
integrity?: string | undefined;
media?: string | undefined;
imagesrcset?: string | undefined;
imagesizes?: string | undefined;
referrerpolicy?: HTMLAttributeReferrerPolicy | undefined;
sizes?: string | undefined;
type?: StringLiteralUnion<BaseMime> | undefined;
charSet?: string | undefined;
rel?: string | undefined;
precedence?: string | undefined;
title?: string | undefined;
disabled?: boolean | undefined;
onError?: ((event: Event) => void) | undefined;
onLoad?: ((event: Event) => void) | undefined;
blocking?: 'render' | undefined;
}
interface MapHTMLAttributes extends HTMLAttributes {
name?: string | undefined;
}
interface MenuHTMLAttributes extends HTMLAttributes {
type?: string | undefined;
}
interface MediaHTMLAttributes extends HTMLAttributes {
autoplay?: boolean | undefined;
controls?: boolean | undefined;
controlslist?: string | undefined;
crossorigin?: CrossOrigin;
loop?: boolean | undefined;
mediagroup?: string | undefined;
muted?: boolean | undefined;
playsinline?: boolean | undefined;
preload?: string | undefined;
src?: string | undefined;
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#http-equiv
*/
type MetaHttpEquiv = 'content-security-policy' | 'content-type' | 'default-style' | 'x-ua-compatible' | 'refresh';
/**
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name
*/
type MetaName = 'application-name' | 'author' | 'description' | 'generator' | 'keywords' | 'referrer' | 'theme-color' | 'color-scheme' | 'viewport' | 'creator' | 'googlebot' | 'publisher' | 'robots';
/**
* @see https://ogp.me/
*/
type MetaProperty = 'og:title' | 'og:type' | 'og:image' | 'og:url' | 'og:audio' | 'og:description' | 'og:determiner' | 'og:locale' | 'og:locale:alternate' | 'og:site_name' | 'og:video' | 'og:image:url' | 'og:image:secure_url' | 'og:image:type' | 'og:image:width' | 'og:image:height' | 'og:image:alt';
interface MetaHTMLAttributes extends HTMLAttributes {
charset?: StringLiteralUnion<'utf-8'> | undefined;
'http-equiv'?: StringLiteralUnion<MetaHttpEquiv> | undefined;
name?: StringLiteralUnion<MetaName> | undefined;
media?: string | undefined;
content?: string | undefined;
property?: StringLiteralUnion<MetaProperty> | undefined;
httpEquiv?: StringLiteralUnion<MetaHttpEquiv> | undefined;
}
interface MeterHTMLAttributes extends HTMLAttributes {
form?: string | undefined;
high?: number | undefined;
low?: number | undefined;
max?: number | string | undefined;
min?: number | string | undefined;
optimum?: number | undefined;
value?: string | ReadonlyArray<string> | number | undefined;
}
interface QuoteHTMLAttributes extends HTMLAttributes {
cite?: string | undefined;
}
interface ObjectHTMLAttributes extends HTMLAttributes {
data?: string | undefined;
form?: string | undefined;
height?: number | string | undefined;
name?: string | undefined;
type?: StringLiteralUnion<BaseMime> | undefined;
usemap?: string | undefined;
width?: number | string | undefined;
}
interface OlHTMLAttributes extends HTMLAttributes {
reversed?: boolean | undefined;
start?: number | undefined;
type?: '1' | 'a' | 'A' | 'i' | 'I' | undefined;
}
interface OptgroupHTMLAttributes extends HTMLAttributes {
disabled?: boolean | undefined;
label?: string | undefined;
}
interface OptionHTMLAttributes extends HTMLAttributes {
disabled?: boolean | undefined;
label?: string | undefined;
selected?: boolean | undefined;
value?: string | ReadonlyArray<string> | number | undefined;
}
interface OutputHTMLAttributes extends HTMLAttributes {
form?: string | undefined;
for?: string | undefined;
name?: string | undefined;
}
interface ParamHTMLAttributes extends HTMLAttributes {
name?: string | undefined;
value?: string | ReadonlyArray<string> | number | undefined;
}
interface ProgressHTMLAttributes extends HTMLAttributes {
max?: number | string | undefined;
value?: string | ReadonlyArray<string> | number | undefined;
}
interface SlotHTMLAttributes extends HTMLAttributes {
name?: string | undefined;
}
interface ScriptHTMLAttributes extends HTMLAttributes {
async?: boolean | undefined;
crossorigin?: CrossOrigin;
defer?: boolean | undefined;
integrity?: string | undefined;
nomodule?: boolean | undefined;
referrerpolicy?: HTMLAttributeReferrerPolicy | undefined;
src?: string | undefined;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type
*/
type?: StringLiteralUnion<'' | 'text/javascript' | 'importmap' | 'module'> | undefined;
crossOrigin?: CrossOrigin;
fetchPriority?: string | undefined;
noModule?: boolean | undefined;
referrer?: HTMLAttributeReferrerPolicy | undefined;
onError?: ((event: Event) => void) | undefined;
onLoad?: ((event: Event) => void) | undefined;
blocking?: 'render' | undefined;
}
interface SelectHTMLAttributes extends HTMLAttributes {
autocomplete?: string | undefined;
disabled?: boolean | undefined;
form?: string | undefined;
multiple?: boolean | undefined;
name?: string | undefined;
required?: boolean | undefined;
size?: number | undefined;
value?: string | ReadonlyArray<string> | number | undefined;
}
type MediaMime = BaseMime & (`image/${string}` | `audio/${string}` | `video/${string}`);
interface SourceHTMLAttributes extends HTMLAttributes {
height?: number | string | undefined;
media?: string | undefined;
sizes?: string | undefined;
src?: string | undefined;
srcset?: string | undefined;
type?: StringLiteralUnion<MediaMime> | undefined;
width?: number | string | undefined;
}
interface StyleHTMLAttributes extends HTMLAttributes {
media?: string | undefined;
scoped?: boolean | undefined;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style#type
*/
type?: '' | 'text/css' | undefined;
href?: string | undefined;
precedence?: string | undefined;
title?: string | undefined;
disabled?: boolean | undefined;
blocking?: 'render' | undefined;
}
interface TableHTMLAttributes extends HTMLAttributes {
align?: 'left' | 'center' | 'right' | undefined;
bgcolor?: string | undefined;
border?: number | undefined;
cellpadding?: number | string | undefined;
cellspacing?: number | string | undefined;
frame?: boolean | undefined;
rules?: 'none' | 'groups' | 'rows' | 'columns' | 'all' | undefined;
summary?: string | undefined;
width?: number | string | undefined;
}
interface TextareaHTMLAttributes extends HTMLAttributes {
autocomplete?: string | undefined;
cols?: number | undefined;
dirname?: string | undefined;
disabled?: boolean | undefined;
form?: string | undefined;
maxlength?: number | undefined;
minlength?: number | undefined;
name?: string | undefined;
placeholder?: string | undefined;
readonly?: boolean | undefined;
required?: boolean | undefined;
rows?: number | undefined;
value?: string | ReadonlyArray<string> | number | undefined;
wrap?: string | undefined;
}
interface TdHTMLAttributes extends HTMLAttributes {
align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined;
colspan?: number | undefined;
headers?: string | undefined;
rowspan?: number | undefined;
scope?: string | undefined;
abbr?: string | undefined;
height?: number | string | undefined;
width?: number | string | undefined;
valign?: 'top' | 'middle' | 'bottom' | 'baseline' | undefined;
}
interface ThHTMLAttributes extends HTMLAttributes {
align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined;
colspan?: number | undefined;
headers?: string | undefined;
rowspan?: number | undefined;
scope?: 'row' | 'col' | 'rowgroup' | 'colgroup' | string | undefined;
abbr?: string | undefined;
}
interface TimeHTMLAttributes extends HTMLAttributes {
datetime?: string | undefined;
}
interface TrackHTMLAttributes extends HTMLAttributes {
default?: boolean | undefined;
kind?: string | undefined;
label?: string | undefined;
src?: string | undefined;
srclang?: string | undefined;
}
interface VideoHTMLAttributes extends MediaHTMLAttributes {
height?: number | string | undefined;
playsinline?: boolean | undefined;
poster?: string | undefined;
width?: number | string | undefined;
disablePictureInPicture?: boolean | undefined;
disableRemotePlayback?: boolean | undefined;
}
export interface IntrinsicElements {
a: AnchorHTMLAttributes;
abbr: HTMLAttributes;
address: HTMLAttributes;
area: AreaHTMLAttributes;
article: HTMLAttributes;
aside: HTMLAttributes;
audio: AudioHTMLAttributes;
b: HTMLAttributes;
base: BaseHTMLAttributes;
bdi: HTMLAttributes;
bdo: HTMLAttributes;
big: HTMLAttributes;
blockquote: BlockquoteHTMLAttributes;
body: HTMLAttributes;
br: HTMLAttributes;
button: ButtonHTMLAttributes;
canvas: CanvasHTMLAttributes;
caption: HTMLAttributes;
center: HTMLAttributes;
cite: HTMLAttributes;
code: HTMLAttributes;
col: ColHTMLAttributes;
colgroup: ColgroupHTMLAttributes;
data: DataHTMLAttributes;
datalist: HTMLAttributes;
dd: HTMLAttributes;
del: DelHTMLAttributes;
details: DetailsHTMLAttributes;
dfn: HTMLAttributes;
dialog: DialogHTMLAttributes;
div: HTMLAttributes;
dl: HTMLAttributes;
dt: HTMLAttributes;
em: HTMLAttributes;
embed: EmbedHTMLAttributes;
fieldset: FieldsetHTMLAttributes;
figcaption: HTMLAttributes;
figure: HTMLAttributes;
footer: HTMLAttributes;
form: FormHTMLAttributes;
h1: HTMLAttributes;
h2: HTMLAttributes;
h3: HTMLAttributes;
h4: HTMLAttributes;
h5: HTMLAttributes;
h6: HTMLAttributes;
head: HTMLAttributes;
header: HTMLAttributes;
hgroup: HTMLAttributes;
hr: HTMLAttributes;
html: HtmlHTMLAttributes;
i: HTMLAttributes;
iframe: IframeHTMLAttributes;
img: ImgHTMLAttributes;
input: InputHTMLAttributes;
ins: InsHTMLAttributes;
kbd: HTMLAttributes;
keygen: KeygenHTMLAttributes;
label: LabelHTMLAttributes;
legend: HTMLAttributes;
li: LiHTMLAttributes;
link: LinkHTMLAttributes;
main: HTMLAttributes;
map: MapHTMLAttributes;
mark: HTMLAttributes;
menu: MenuHTMLAttributes;
menuitem: HTMLAttributes;
meta: MetaHTMLAttributes;
meter: MeterHTMLAttributes;
nav: HTMLAttributes;
noscript: HTMLAttributes;
object: ObjectHTMLAttributes;
ol: OlHTMLAttributes;
optgroup: OptgroupHTMLAttributes;
option: OptionHTMLAttributes;
output: OutputHTMLAttributes;
p: HTMLAttributes;
param: ParamHTMLAttributes;
picture: HTMLAttributes;
pre: HTMLAttributes;
progress: ProgressHTMLAttributes;
q: QuoteHTMLAttributes;
rp: HTMLAttributes;
rt: HTMLAttributes;
ruby: HTMLAttributes;
s: HTMLAttributes;
samp: HTMLAttributes;
search: HTMLAttributes;
slot: SlotHTMLAttributes;
script: ScriptHTMLAttributes;
section: HTMLAttributes;
select: SelectHTMLAttributes;
small: HTMLAttributes;
source: SourceHTMLAttributes;
span: HTMLAttributes;
strong: HTMLAttributes;
style: StyleHTMLAttributes;
sub: HTMLAttributes;
summary: HTMLAttributes;
sup: HTMLAttributes;
table: TableHTMLAttributes;
template: HTMLAttributes;
tbody: HTMLAttributes;
td: TdHTMLAttributes;
textarea: TextareaHTMLAttributes;
tfoot: HTMLAttributes;
th: ThHTMLAttributes;
thead: HTMLAttributes;
time: TimeHTMLAttributes;
title: HTMLAttributes;
tr: HTMLAttributes;
track: TrackHTMLAttributes;
u: HTMLAttributes;
ul: HTMLAttributes;
var: HTMLAttributes;
video: VideoHTMLAttributes;
wbr: HTMLAttributes;
}
export {};
}
export interface IntrinsicElements extends JSX.IntrinsicElements {}
//#endregion
@@ -0,0 +1,40 @@
{
"name": "update-browserslist-db",
"version": "1.2.3",
"description": "CLI tool to update caniuse-lite to refresh target browsers from Browserslist config",
"keywords": [
"caniuse",
"browsers",
"target"
],
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/browserslist"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"author": "Andrey Sitnik <andrey@sitnik.ru>",
"license": "MIT",
"repository": "browserslist/update-db",
"types": "./index.d.ts",
"exports": {
".": "./index.js",
"./package.json": "./package.json"
},
"dependencies": {
"escalade": "^3.2.0",
"picocolors": "^1.1.1"
},
"peerDependencies": {
"browserslist": ">= 4.21.0"
},
"bin": "cli.js"
}
@@ -0,0 +1 @@
{"version":3,"file":"power-circle.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,396 @@
'use strict';
/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`.
TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed
*/
/**
* @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
*/
/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly string[]`. TODO: check why */
/**
* @type {VisitorKeys}
*/
const KEYS = {
ArrayExpression: [
"elements"
],
ArrayPattern: [
"elements"
],
ArrowFunctionExpression: [
"params",
"body"
],
AssignmentExpression: [
"left",
"right"
],
AssignmentPattern: [
"left",
"right"
],
AwaitExpression: [
"argument"
],
BinaryExpression: [
"left",
"right"
],
BlockStatement: [
"body"
],
BreakStatement: [
"label"
],
CallExpression: [
"callee",
"arguments"
],
CatchClause: [
"param",
"body"
],
ChainExpression: [
"expression"
],
ClassBody: [
"body"
],
ClassDeclaration: [
"id",
"superClass",
"body"
],
ClassExpression: [
"id",
"superClass",
"body"
],
ConditionalExpression: [
"test",
"consequent",
"alternate"
],
ContinueStatement: [
"label"
],
DebuggerStatement: [],
DoWhileStatement: [
"body",
"test"
],
EmptyStatement: [],
ExperimentalRestProperty: [
"argument"
],
ExperimentalSpreadProperty: [
"argument"
],
ExportAllDeclaration: [
"exported",
"source",
"attributes"
],
ExportDefaultDeclaration: [
"declaration"
],
ExportNamedDeclaration: [
"declaration",
"specifiers",
"source",
"attributes"
],
ExportSpecifier: [
"local",
"exported"
],
ExpressionStatement: [
"expression"
],
ForInStatement: [
"left",
"right",
"body"
],
ForOfStatement: [
"left",
"right",
"body"
],
ForStatement: [
"init",
"test",
"update",
"body"
],
FunctionDeclaration: [
"id",
"params",
"body"
],
FunctionExpression: [
"id",
"params",
"body"
],
Identifier: [],
IfStatement: [
"test",
"consequent",
"alternate"
],
ImportAttribute: [
"key",
"value"
],
ImportDeclaration: [
"specifiers",
"source",
"attributes"
],
ImportDefaultSpecifier: [
"local"
],
ImportExpression: [
"source",
"options"
],
ImportNamespaceSpecifier: [
"local"
],
ImportSpecifier: [
"imported",
"local"
],
JSXAttribute: [
"name",
"value"
],
JSXClosingElement: [
"name"
],
JSXClosingFragment: [],
JSXElement: [
"openingElement",
"children",
"closingElement"
],
JSXEmptyExpression: [],
JSXExpressionContainer: [
"expression"
],
JSXFragment: [
"openingFragment",
"children",
"closingFragment"
],
JSXIdentifier: [],
JSXMemberExpression: [
"object",
"property"
],
JSXNamespacedName: [
"namespace",
"name"
],
JSXOpeningElement: [
"name",
"attributes"
],
JSXOpeningFragment: [],
JSXSpreadAttribute: [
"argument"
],
JSXSpreadChild: [
"expression"
],
JSXText: [],
LabeledStatement: [
"label",
"body"
],
Literal: [],
LogicalExpression: [
"left",
"right"
],
MemberExpression: [
"object",
"property"
],
MetaProperty: [
"meta",
"property"
],
MethodDefinition: [
"key",
"value"
],
NewExpression: [
"callee",
"arguments"
],
ObjectExpression: [
"properties"
],
ObjectPattern: [
"properties"
],
PrivateIdentifier: [],
Program: [
"body"
],
Property: [
"key",
"value"
],
PropertyDefinition: [
"key",
"value"
],
RestElement: [
"argument"
],
ReturnStatement: [
"argument"
],
SequenceExpression: [
"expressions"
],
SpreadElement: [
"argument"
],
StaticBlock: [
"body"
],
Super: [],
SwitchCase: [
"test",
"consequent"
],
SwitchStatement: [
"discriminant",
"cases"
],
TaggedTemplateExpression: [
"tag",
"quasi"
],
TemplateElement: [],
TemplateLiteral: [
"quasis",
"expressions"
],
ThisExpression: [],
ThrowStatement: [
"argument"
],
TryStatement: [
"block",
"handler",
"finalizer"
],
UnaryExpression: [
"argument"
],
UpdateExpression: [
"argument"
],
VariableDeclaration: [
"declarations"
],
VariableDeclarator: [
"id",
"init"
],
WhileStatement: [
"test",
"body"
],
WithStatement: [
"object",
"body"
],
YieldExpression: [
"argument"
]
};
// Types.
const NODE_TYPES = Object.keys(KEYS);
// Freeze the keys.
for (const type of NODE_TYPES) {
Object.freeze(KEYS[type]);
}
Object.freeze(KEYS);
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
/**
* @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys
*/
// List to ignore keys.
const KEY_BLACKLIST = new Set([
"parent",
"leadingComments",
"trailingComments"
]);
/**
* Check whether a given key should be used or not.
* @param {string} key The key to check.
* @returns {boolean} `true` if the key should be used.
*/
function filterKey(key) {
return !KEY_BLACKLIST.has(key) && key[0] !== "_";
}
/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`.
TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed
*/
/**
* Get visitor keys of a given node.
* @param {Object} node The AST node to get keys.
* @returns {readonly string[]} Visitor keys of the node.
*/
function getKeys(node) {
return Object.keys(node).filter(filterKey);
}
/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly` */
/**
* Make the union set with `KEYS` and given keys.
* @param {VisitorKeys} additionalKeys The additional keys.
* @returns {VisitorKeys} The union set.
*/
function unionWith(additionalKeys) {
const retv = /** @type {{ [type: string]: ReadonlyArray<string> }} */
(Object.assign({}, KEYS));
for (const type of Object.keys(additionalKeys)) {
if (Object.hasOwn(retv, type)) {
const keys = new Set(additionalKeys[type]);
for (const key of retv[type]) {
keys.add(key);
}
retv[type] = Object.freeze(Array.from(keys));
} else {
retv[type] = Object.freeze(Array.from(additionalKeys[type]));
}
}
return Object.freeze(retv);
}
exports.KEYS = KEYS;
exports.getKeys = getKeys;
exports.unionWith = unionWith;
@@ -0,0 +1,123 @@
# eslint-visitor-keys
[![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys)
[![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys)
[![Build Status](https://github.com/eslint/js/workflows/CI/badge.svg)](https://github.com/eslint/js/actions)
Constants and utilities about visitor keys to traverse AST.
## 💿 Installation
Use [npm] to install.
```bash
$ npm install eslint-visitor-keys
```
### Requirements
- [Node.js] `^20.19.0`, `^22.13.0`, or `>=24`
## 📖 Usage
To use in an ESM file:
```js
import * as evk from "eslint-visitor-keys";
```
To use in a CommonJS file:
```js
const evk = require("eslint-visitor-keys");
```
### evk.KEYS
> type: `{ [type: string]: string[] | undefined }`
Visitor keys. This keys are frozen.
This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes.
For example:
```
console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"]
```
### evk.getKeys(node)
> type: `(node: object) => string[]`
Get the visitor keys of a given AST node.
This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`.
This will be used to traverse unknown nodes.
For example:
```js
const node = {
type: "AssignmentExpression",
left: { type: "Identifier", name: "foo" },
right: { type: "Literal", value: 0 },
};
console.log(evk.getKeys(node)); // → ["type", "left", "right"]
```
### evk.unionWith(additionalKeys)
> type: `(additionalKeys: object) => { [type: string]: string[] | undefined }`
Make the union set with `evk.KEYS` and the given keys.
- The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that.
- It removes duplicated keys as keeping the first one.
For example:
```js
console.log(
evk.unionWith({
MethodDefinition: ["decorators"],
}),
); // → { ..., MethodDefinition: ["decorators", "key", "value"], ... }
```
## 📰 Change log
See [GitHub releases](https://github.com/eslint/js/releases).
## 🍻 Contributing
Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/).
### Development commands
- `npm test` runs tests and measures code coverage.
- `npm run lint` checks source codes with ESLint.
- `npm run test:open-coverage` opens the code coverage report of the previous test with your default browser.
[npm]: https://www.npmjs.com/
[Node.js]: https://nodejs.org/
[ESTree]: https://github.com/estree/estree
<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->
## Sponsors
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).
<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://www.n-ix.com/"><img src="https://images.opencollective.com/n-ix-ltd/575a7a5/logo.png" alt="N-iX Ltd" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="TestMu AI Open Source Office (Formerly LambdaTest)" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/slot.tsx"],
"sourcesContent": ["import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\n\ndeclare module 'react' {\n interface ReactElement {\n $$typeof?: symbol | string;\n }\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type Usable<T> = PromiseLike<T> | React.Context<T>;\n\ntype SlotProps<Elem extends Element = HTMLElement, Props = React.HTMLAttributes<Elem>> = Props & {\n children?: React.ReactNode;\n};\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlot<\n Elem extends Element = HTMLElement,\n Props = React.HTMLAttributes<Elem>,\n>(ownerName: string) {\n const Slot = React.forwardRef<Elem, SlotProps<Elem, Props>>((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n let slottableElement: React.ReactElement | null = null;\n let hasSlottable = false;\n const newChildren: React.ReactNode[] = [];\n\n if (isLazyComponent(children) && typeof use === 'function') {\n children = use(children._payload);\n }\n\n React.Children.forEach(children, (maybeSlottable) => {\n if (isSlottable(maybeSlottable)) {\n hasSlottable = true;\n const slottable = maybeSlottable;\n let child = 'child' in slottable.props ? slottable.props.child : slottable.props.children;\n\n if (isLazyComponent(child) && typeof use === 'function') {\n child = use(child._payload);\n }\n\n slottableElement = getSlottableElementFromSlottable(slottable, child);\n newChildren.push((slottableElement?.props as any)?.children);\n } else {\n newChildren.push(maybeSlottable);\n }\n });\n\n if (slottableElement) {\n slottableElement = React.cloneElement(slottableElement, undefined, newChildren);\n } else if (\n // A `Slottable` was found but it didn't resolve to a single element (e.g.\n // it wrapped multiple elements, text, or a render-prop `child` that\n // wasn't an element). Don't fall back to treating the `Slottable` wrapper\n // itself as the slot target \u2014 throw a descriptive error below instead.\n !hasSlottable &&\n React.Children.count(children) === 1 &&\n React.isValidElement(children)\n ) {\n slottableElement = children;\n }\n\n const slottableElementRef = slottableElement ? getElementRef(slottableElement) : undefined;\n const composedRef = useComposedRefs(forwardedRef, slottableElementRef);\n\n if (!slottableElement) {\n // Empty/falsy children (`null`, `undefined`, `false`, no children, etc.) are valid and\n // render nothing. Anything else is content we couldn't slot onto a single element, which\n // is a usage error, so we fail loudly with a clear message.\n if (children || children === 0) {\n throw new Error(\n hasSlottable ? createSlottableError(ownerName) : createSlotError(ownerName),\n );\n }\n return children;\n }\n\n const mergedProps = mergeProps(slotProps, slottableElement.props ?? {});\n\n // do not pass ref to React.Fragment for React 19 compatibility\n if (slottableElement.type !== React.Fragment) {\n mergedProps.ref = forwardedRef ? composedRef : slottableElementRef;\n }\n\n return React.cloneElement(slottableElement, mergedProps);\n });\n\n Slot.displayName = `${ownerName}.Slot`;\n return Slot;\n}\n\nconst Slot = createSlot('Slot');\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst SLOTTABLE_IDENTIFIER = Symbol.for('radix.slottable');\n\ntype SlottableChildrenProps = { children: React.ReactNode };\ntype SlottableRenderFnProps = {\n child: React.ReactNode;\n children: (slottable: React.ReactNode) => React.ReactNode;\n};\n\ntype SlottableProps = SlottableRenderFnProps | SlottableChildrenProps;\ninterface SlottableComponent extends React.FC<SlottableProps> {\n __radixId: symbol;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlottable(ownerName: string) {\n const Slottable: SlottableComponent = (props) =>\n 'child' in props ? props.children(props.child) : props.children;\n\n Slottable.displayName = `${ownerName}.Slottable`;\n Slottable.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable;\n}\n\nconst Slottable = createSlottable('Slottable');\n\n/* -------------------------------------------------------------------------------------------------\n * getSlottableElementFromSlottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst getSlottableElementFromSlottable = (slottable: SlottableElement, child: React.ReactNode) => {\n if ('child' in slottable.props) {\n const child = slottable.proLine truncated
"mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAAA;AAkBE,SAAS,WAGzC,WAAmB;AACnB,QAAMA,QAAa,iBAAyC,CAAC,OAAO,iBAAiB;AACnF,QAAI,EAAE,UAAU,GAAG,UAAU,IAAI;AACjC,QAAI,mBAA8C;AAClD,QAAI,eAAe;AACnB,UAAM,cAAiC,CAAC;AAExC,QAAI,gBAAgB,QAAQ,KAAK,OAAO,QAAQ,YAAY;AAC1D,iBAAW,IAAI,SAAS,QAAQ;AAAA,IAClC;AAEA,IAAM,eAAS,QAAQ,UAAU,CAAC,mBAAmB;AACnD,UAAI,YAAY,cAAc,GAAG;AAC/B,uBAAe;AACf,cAAM,YAAY;AAClB,YAAI,QAAQ,WAAW,UAAU,QAAQ,UAAU,MAAM,QAAQ,UAAU,MAAM;AAEjF,YAAI,gBAAgB,KAAK,KAAK,OAAO,QAAQ,YAAY;AACvD,kBAAQ,IAAI,MAAM,QAAQ;AAAA,QAC5B;AAEA,2BAAmB,iCAAiC,WAAW,KAAK;AACpE,oBAAY,KAAM,kBAAkB,OAAe,QAAQ;AAAA,MAC7D,OAAO;AACL,oBAAY,KAAK,cAAc;AAAA,MACjC;AAAA,IACF,CAAC;AAED,QAAI,kBAAkB;AACpB,yBAAyB,mBAAa,kBAAkB,QAAW,WAAW;AAAA,IAChF;AAAA;AAAA;AAAA;AAAA;AAAA,MAKE,CAAC,gBACK,eAAS,MAAM,QAAQ,MAAM,KAC7B,qBAAe,QAAQ;AAAA,MAC7B;AACA,yBAAmB;AAAA,IACrB;AAEA,UAAM,sBAAsB,mBAAmB,cAAc,gBAAgB,IAAI;AACjF,UAAM,cAAc,gBAAgB,cAAc,mBAAmB;AAErE,QAAI,CAAC,kBAAkB;AAIrB,UAAI,YAAY,aAAa,GAAG;AAC9B,cAAM,IAAI;AAAA,UACR,eAAe,qBAAqB,SAAS,IAAI,gBAAgB,SAAS;AAAA,QAC5E;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAEA,UAAM,cAAc,WAAW,WAAW,iBAAiB,SAAS,CAAC,CAAC;AAGtE,QAAI,iBAAiB,SAAe,gBAAU;AAC5C,kBAAY,MAAM,eAAe,cAAc;AAAA,IACjD;AAEA,WAAa,mBAAa,kBAAkB,WAAW;AAAA,EACzD,CAAC;AAED,EAAAA,MAAK,cAAc,GAAG,SAAS;AAC/B,SAAOA;AACT;AAEA,IAAM,OAAO,2BAAW,MAAM;AAM9B,IAAM,uBAAuB,OAAO,IAAI,iBAAiB;AAAA;AAavB,SAAS,gBAAgB,WAAmB;AAC5E,QAAMC,aAAgC,CAAC,UACrC,WAAW,QAAQ,MAAM,SAAS,MAAM,KAAK,IAAI,MAAM;AAEzD,EAAAA,WAAU,cAAc,GAAG,SAAS;AACpC,EAAAA,WAAU,YAAY;AACtB,SAAOA;AACT;AAEA,IAAM,YAAY,gCAAgB,WAAW;AAM7C,IAAM,mCAAmC,CAAC,WAA6B,UAA2B;AAChG,MAAI,WAAW,UAAU,OAAO;AAC9B,UAAMC,SAAQ,UAAU,MAAM;AAC9B,QAAI,CAAO,qBAAwCA,MAAK,EAAG,QAAO;AAClE,WAAa,mBAAaA,QAAO,QAAW,UAAU,MAAM,SAASA,OAAM,MAAM,QAAQ,CAAC;AAAA,EAC5F;AAEA,SAAa,qBAAe,KAAK,IAAI,QAAQ;AAC/C;AAQA,SAAS,WAAW,WAAqB,YAAsB;AAE7D,QAAM,gBAAgB,EAAE,GAAG,WAAW;AAEtC,aAAW,YAAY,YAAY;AACjC,UAAM,gBAAgB,UAAU,QAAQ;AACxC,UAAM,iBAAiB,WAAW,QAAQ;AAE1C,UAAM,YAAY,WAAW,KAAK,QAAQ;AAC1C,QAAI,WAAW;AAEb,UAAI,iBAAiB,gBAAgB;AACnC,sBAAc,QAAQ,IAAI,IAAI,SAAoB;AAChD,gBAAM,SAAS,eAAe,GAAG,IAAI;AACrC,wBAAc,GAAG,IAAI;AACrB,iBAAO;AAAA,QACT;AAAA,MACF,WAES,eAAe;AACtB,sBAAc,QAAQ,IAAI;AAAA,MAC5B;AAAA,IACF,WAES,aAAa,SAAS;AAC7B,oBAAc,QAAQ,IAAI,EAAE,GAAG,eAAe,GAAG,eAAe;AAAA,IAClE,WAAW,aAAa,aAAa;AACnC,oBAAc,QAAQ,IAAI,CAAC,eAAe,cAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IACpF;AAAA,EACF;AAEA,SAAO,EAAE,GAAG,WAAW,GAAG,cAAc;AAC1C;AAWA,SAAS,cAAc,SAA6B;AAElD,MAAI,SAAS,OAAO,yBAAyB,QAAQ,OAAO,KAAK,GAAG;AACpE,MAAI,UAAU,UAAU,oBAAoB,UAAU,OAAO;AAC7D,MAAI,SAAS;AACX,WAAQ,QAAgB;AAAA,EAC1B;AAGA,WAAS,OAAO,yBAAyB,SAAS,KAAK,GAAG;AAC1D,YAAU,UAAU,oBAAoB,UAAU,OAAO;AACzD,MAAI,SAAS;AACX,WAAQ,QAAQ,MAAuC;AAAA,EACzD;AAGA,SAAQ,QAAQ,MAAuC,OAAQ,QAAgB;AACjF;AAMA,SAAS,YACP,OAC+D;AAC/D,SACQ,qBAAe,KAAK,KAC1B,OAAO,MAAM,SAAS,cACtB,eAAe,MAAM,QACrB,MAAM,KAAK,cAAc;AAE7B;AAEA,IAAM,kBAAkB,OAAO,IAAI,YAAY;AAO/C,SAAS,gBAAgB,SAAuD;AAC9E,SACE,WAAW,QACX,OAAO,YAAY,YACnB,cAAc,WACd,QAAQ,aAAa,mBACrB,cAAc,WACd,cAAc,QAAQ,QAAQ;AAElC;AAEA,SAAS,cAAc,OAA+C;AACpE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU;AAClE;AAEA,IAAM,kBAAkB,CAAC,cAAsB;AAC7C,SAAO,GAAG,SAAS;AACrB;AAEA,IAAM,uBAAuB,CAAC,cAAsB;AAClD,SAAO,GAAG,SAAS;AACrB;AAEA,IAAM,MAAqC,MAAc,QAAQ,KAAK,EAAE,SAAS,CAAC;",
"names": ["Slot", "Slottable", "child"]
}
@@ -0,0 +1 @@
{"version":3,"file":"scissors-square-dashed-bottom.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"message-square-text.js","sources":["../../../src/icons/message-square-text.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MessageSquareText\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTVhMiAyIDAgMCAxLTIgMkg3bC00IDRWNWEyIDIgMCAwIDEgMi0yaDE0YTIgMiAwIDAgMSAyIDJ6IiAvPgogIDxwYXRoIGQ9Ik0xMyA4SDciIC8+CiAgPHBhdGggZD0iTTE3IDEySDciIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/message-square-text\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 MessageSquareText = createLucideIcon('MessageSquareText', [\n ['path', { d: 'M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z', key: '1lielz' }],\n ['path', { d: 'M13 8H7', key: '14i4kc' }],\n ['path', { d: 'M17 12H7', key: '16if0g' }],\n]);\n\nexport default MessageSquareText;\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,CAAoB,iBAAiB,mBAAqB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC9F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,11 @@
export type Options = [
{
allowDestructuring?: boolean;
allowedNames?: string[];
}
];
export type MessageIds = 'thisAssignment' | 'thisDestructure';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,65 @@
{
"100": "Continue",
"101": "Switching Protocols",
"102": "Processing",
"103": "Early Hints",
"200": "OK",
"201": "Created",
"202": "Accepted",
"203": "Non-Authoritative Information",
"204": "No Content",
"205": "Reset Content",
"206": "Partial Content",
"207": "Multi-Status",
"208": "Already Reported",
"226": "IM Used",
"300": "Multiple Choices",
"301": "Moved Permanently",
"302": "Found",
"303": "See Other",
"304": "Not Modified",
"305": "Use Proxy",
"307": "Temporary Redirect",
"308": "Permanent Redirect",
"400": "Bad Request",
"401": "Unauthorized",
"402": "Payment Required",
"403": "Forbidden",
"404": "Not Found",
"405": "Method Not Allowed",
"406": "Not Acceptable",
"407": "Proxy Authentication Required",
"408": "Request Timeout",
"409": "Conflict",
"410": "Gone",
"411": "Length Required",
"412": "Precondition Failed",
"413": "Payload Too Large",
"414": "URI Too Long",
"415": "Unsupported Media Type",
"416": "Range Not Satisfiable",
"417": "Expectation Failed",
"418": "I'm a Teapot",
"421": "Misdirected Request",
"422": "Unprocessable Entity",
"423": "Locked",
"424": "Failed Dependency",
"425": "Too Early",
"426": "Upgrade Required",
"428": "Precondition Required",
"429": "Too Many Requests",
"431": "Request Header Fields Too Large",
"451": "Unavailable For Legal Reasons",
"500": "Internal Server Error",
"501": "Not Implemented",
"502": "Bad Gateway",
"503": "Service Unavailable",
"504": "Gateway Timeout",
"505": "HTTP Version Not Supported",
"506": "Variant Also Negotiates",
"507": "Insufficient Storage",
"508": "Loop Detected",
"509": "Bandwidth Limit Exceeded",
"510": "Not Extended",
"511": "Network Authentication Required"
}
@@ -0,0 +1,7 @@
// @ts-ignore -- @vitest/browser-playwright might not be installed
export * from '@vitest/browser-playwright/context'
// @ts-ignore -- @vitest/browser-webdriverio might not be installed
export * from '@vitest/browser-webdriverio/context'
// @ts-ignore -- @vitest/browser-preview might not be installed
export * from '@vitest/browser-preview/context'
export { BrowserCommands, CDPSession, FsOptions } from 'vitest/internal/browser'
@@ -0,0 +1,112 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ZodError_js_1 = require("../ZodError.cjs");
const util_js_1 = require("../helpers/util.cjs");
const errorMap = (issue, _ctx) => {
let message;
switch (issue.code) {
case ZodError_js_1.ZodIssueCode.invalid_type:
if (issue.received === util_js_1.ZodParsedType.undefined) {
message = "Required";
}
else {
message = `Expected ${issue.expected}, received ${issue.received}`;
}
break;
case ZodError_js_1.ZodIssueCode.invalid_literal:
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util_js_1.util.jsonStringifyReplacer)}`;
break;
case ZodError_js_1.ZodIssueCode.unrecognized_keys:
message = `Unrecognized key(s) in object: ${util_js_1.util.joinValues(issue.keys, ", ")}`;
break;
case ZodError_js_1.ZodIssueCode.invalid_union:
message = `Invalid input`;
break;
case ZodError_js_1.ZodIssueCode.invalid_union_discriminator:
message = `Invalid discriminator value. Expected ${util_js_1.util.joinValues(issue.options)}`;
break;
case ZodError_js_1.ZodIssueCode.invalid_enum_value:
message = `Invalid enum value. Expected ${util_js_1.util.joinValues(issue.options)}, received '${issue.received}'`;
break;
case ZodError_js_1.ZodIssueCode.invalid_arguments:
message = `Invalid function arguments`;
break;
case ZodError_js_1.ZodIssueCode.invalid_return_type:
message = `Invalid function return type`;
break;
case ZodError_js_1.ZodIssueCode.invalid_date:
message = `Invalid date`;
break;
case ZodError_js_1.ZodIssueCode.invalid_string:
if (typeof issue.validation === "object") {
if ("includes" in issue.validation) {
message = `Invalid input: must include "${issue.validation.includes}"`;
if (typeof issue.validation.position === "number") {
message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
}
}
else if ("startsWith" in issue.validation) {
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
}
else if ("endsWith" in issue.validation) {
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
}
else {
util_js_1.util.assertNever(issue.validation);
}
}
else if (issue.validation !== "regex") {
message = `Invalid ${issue.validation}`;
}
else {
message = "Invalid";
}
break;
case ZodError_js_1.ZodIssueCode.too_small:
if (issue.type === "array")
message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
else if (issue.type === "string")
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
else if (issue.type === "number")
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
else if (issue.type === "bigint")
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
else if (issue.type === "date")
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
else
message = "Invalid input";
break;
case ZodError_js_1.ZodIssueCode.too_big:
if (issue.type === "array")
message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
else if (issue.type === "string")
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
else if (issue.type === "number")
message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
else if (issue.type === "bigint")
message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
else if (issue.type === "date")
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
else
message = "Invalid input";
break;
case ZodError_js_1.ZodIssueCode.custom:
message = `Invalid input`;
break;
case ZodError_js_1.ZodIssueCode.invalid_intersection_types:
message = `Intersection results could not be merged`;
break;
case ZodError_js_1.ZodIssueCode.not_multiple_of:
message = `Number must be a multiple of ${issue.multipleOf}`;
break;
case ZodError_js_1.ZodIssueCode.not_finite:
message = "Number must be finite";
break;
default:
message = _ctx.defaultError;
util_js_1.util.assertNever(issue);
}
return { message };
};
exports.default = errorMap;
module.exports = exports.default;
@@ -0,0 +1 @@
var html=function(t){"use strict";var n="".replace,u=/[&<>'"]/g,r=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g,a={"&":"&amp;","<":"&lt;",">":"&gt;","'":"&#39;",'"':"&quot;"},e={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"'};function c(t){return a[t]}function o(t){return e[t]}return t.escape=function(t){return n.call(t,u,c)},t.unescape=function(t){return n.call(t,r,o)},t}({});
@@ -0,0 +1,16 @@
"use client";
import { drag } from '../../motion/features/drag.mjs';
import { layout } from '../../motion/features/layout.mjs';
import { domAnimation } from './features-animation.mjs';
/**
* @public
*/
const domMax = {
...domAnimation,
...drag,
...layout,
};
export { domMax };
//# sourceMappingURL=features-max.mjs.map
@@ -0,0 +1,369 @@
/**
* @fileoverview Disallows or enforces spaces inside of object literals.
* @author Jamund Ferguson
* @deprecated in ESLint v8.53.0
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "object-curly-spacing",
url: "https://eslint.style/rules/object-curly-spacing",
},
},
],
},
type: "layout",
docs: {
description: "Enforce consistent spacing inside braces",
recommended: false,
url: "https://eslint.org/docs/latest/rules/object-curly-spacing",
},
fixable: "whitespace",
schema: [
{
enum: ["always", "never"],
},
{
type: "object",
properties: {
arraysInObjects: {
type: "boolean",
},
objectsInObjects: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
requireSpaceBefore: "A space is required before '{{token}}'.",
requireSpaceAfter: "A space is required after '{{token}}'.",
unexpectedSpaceBefore:
"There should be no space before '{{token}}'.",
unexpectedSpaceAfter: "There should be no space after '{{token}}'.",
},
},
create(context) {
const spaced = context.options[0] === "always",
sourceCode = context.sourceCode;
/**
* Determines whether an option is set, relative to the spacing option.
* If spaced is "always", then check whether option is set to false.
* If spaced is "never", then check whether option is set to true.
* @param {Object} option The option to exclude.
* @returns {boolean} Whether or not the property is excluded.
*/
function isOptionSet(option) {
return context.options[1]
? context.options[1][option] === !spaced
: false;
}
const options = {
spaced,
arraysInObjectsException: isOptionSet("arraysInObjects"),
objectsInObjectsException: isOptionSet("objectsInObjects"),
};
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Reports that there shouldn't be a space after the first token
* @param {ASTNode} node The node to report in the event of an error.
* @param {Token} token The token to use for the report.
* @returns {void}
*/
function reportNoBeginningSpace(node, token) {
const nextToken = context.sourceCode.getTokenAfter(token, {
includeComments: true,
});
context.report({
node,
loc: { start: token.loc.end, end: nextToken.loc.start },
messageId: "unexpectedSpaceAfter",
data: {
token: token.value,
},
fix(fixer) {
return fixer.removeRange([
token.range[1],
nextToken.range[0],
]);
},
});
}
/**
* Reports that there shouldn't be a space before the last token
* @param {ASTNode} node The node to report in the event of an error.
* @param {Token} token The token to use for the report.
* @returns {void}
*/
function reportNoEndingSpace(node, token) {
const previousToken = context.sourceCode.getTokenBefore(token, {
includeComments: true,
});
context.report({
node,
loc: { start: previousToken.loc.end, end: token.loc.start },
messageId: "unexpectedSpaceBefore",
data: {
token: token.value,
},
fix(fixer) {
return fixer.removeRange([
previousToken.range[1],
token.range[0],
]);
},
});
}
/**
* Reports that there should be a space after the first token
* @param {ASTNode} node The node to report in the event of an error.
* @param {Token} token The token to use for the report.
* @returns {void}
*/
function reportRequiredBeginningSpace(node, token) {
context.report({
node,
loc: token.loc,
messageId: "requireSpaceAfter",
data: {
token: token.value,
},
fix(fixer) {
return fixer.insertTextAfter(token, " ");
},
});
}
/**
* Reports that there should be a space before the last token
* @param {ASTNode} node The node to report in the event of an error.
* @param {Token} token The token to use for the report.
* @returns {void}
*/
function reportRequiredEndingSpace(node, token) {
context.report({
node,
loc: token.loc,
messageId: "requireSpaceBefore",
data: {
token: token.value,
},
fix(fixer) {
return fixer.insertTextBefore(token, " ");
},
});
}
/**
* Determines if spacing in curly braces is valid.
* @param {ASTNode} node The AST node to check.
* @param {Token} first The first token to check (should be the opening brace)
* @param {Token} second The second token to check (should be first after the opening brace)
* @param {Token} penultimate The penultimate token to check (should be last before closing brace)
* @param {Token} last The last token to check (should be closing brace)
* @returns {void}
*/
function validateBraceSpacing(node, first, second, penultimate, last) {
if (astUtils.isTokenOnSameLine(first, second)) {
const firstSpaced = sourceCode.isSpaceBetween(first, second);
if (options.spaced && !firstSpaced) {
reportRequiredBeginningSpace(node, first);
}
if (!options.spaced && firstSpaced && second.type !== "Line") {
reportNoBeginningSpace(node, first);
}
}
if (astUtils.isTokenOnSameLine(penultimate, last)) {
const shouldCheckPenultimate =
(options.arraysInObjectsException &&
astUtils.isClosingBracketToken(penultimate)) ||
(options.objectsInObjectsException &&
astUtils.isClosingBraceToken(penultimate));
const penultimateType =
shouldCheckPenultimate &&
sourceCode.getNodeByRangeIndex(penultimate.range[0]).type;
const closingCurlyBraceMustBeSpaced =
(options.arraysInObjectsException &&
penultimateType === "ArrayExpression") ||
(options.objectsInObjectsException &&
(penultimateType === "ObjectExpression" ||
penultimateType === "ObjectPattern"))
? !options.spaced
: options.spaced;
const lastSpaced = sourceCode.isSpaceBetween(penultimate, last);
if (closingCurlyBraceMustBeSpaced && !lastSpaced) {
reportRequiredEndingSpace(node, last);
}
if (!closingCurlyBraceMustBeSpaced && lastSpaced) {
reportNoEndingSpace(node, last);
}
}
}
/**
* Gets '}' token of an object node.
*
* Because the last token of object patterns might be a type annotation,
* this traverses tokens preceded by the last property, then returns the
* first '}' token.
* @param {ASTNode} node The node to get. This node is an
* ObjectExpression or an ObjectPattern. And this node has one or
* more properties.
* @returns {Token} '}' token.
*/
function getClosingBraceOfObject(node) {
const lastProperty = node.properties.at(-1);
return sourceCode.getTokenAfter(
lastProperty,
astUtils.isClosingBraceToken,
);
}
/**
* Reports a given object node if spacing in curly braces is invalid.
* @param {ASTNode} node An ObjectExpression or ObjectPattern node to check.
* @returns {void}
*/
function checkForObject(node) {
if (node.properties.length === 0) {
return;
}
const first = sourceCode.getFirstToken(node),
last = getClosingBraceOfObject(node),
second = sourceCode.getTokenAfter(first, {
includeComments: true,
}),
penultimate = sourceCode.getTokenBefore(last, {
includeComments: true,
});
validateBraceSpacing(node, first, second, penultimate, last);
}
/**
* Reports a given import node if spacing in curly braces is invalid.
* @param {ASTNode} node An ImportDeclaration node to check.
* @returns {void}
*/
function checkForImport(node) {
if (node.specifiers.length === 0) {
return;
}
let firstSpecifier = node.specifiers[0];
const lastSpecifier = node.specifiers.at(-1);
if (lastSpecifier.type !== "ImportSpecifier") {
return;
}
if (firstSpecifier.type !== "ImportSpecifier") {
firstSpecifier = node.specifiers[1];
}
const first = sourceCode.getTokenBefore(firstSpecifier),
last = sourceCode.getTokenAfter(
lastSpecifier,
astUtils.isNotCommaToken,
),
second = sourceCode.getTokenAfter(first, {
includeComments: true,
}),
penultimate = sourceCode.getTokenBefore(last, {
includeComments: true,
});
validateBraceSpacing(node, first, second, penultimate, last);
}
/**
* Reports a given export node if spacing in curly braces is invalid.
* @param {ASTNode} node An ExportNamedDeclaration node to check.
* @returns {void}
*/
function checkForExport(node) {
if (node.specifiers.length === 0) {
return;
}
const firstSpecifier = node.specifiers[0],
lastSpecifier = node.specifiers.at(-1),
first = sourceCode.getTokenBefore(firstSpecifier),
last = sourceCode.getTokenAfter(
lastSpecifier,
astUtils.isNotCommaToken,
),
second = sourceCode.getTokenAfter(first, {
includeComments: true,
}),
penultimate = sourceCode.getTokenBefore(last, {
includeComments: true,
});
validateBraceSpacing(node, first, second, penultimate, last);
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
// var {x} = y;
ObjectPattern: checkForObject,
// var y = {x: 'y'}
ObjectExpression: checkForObject,
// import {y} from 'x';
ImportDeclaration: checkForImport,
// export {name} from 'yo';
ExportNamedDeclaration: checkForExport,
};
},
};
@@ -0,0 +1,14 @@
import Range = require("../classes/range");
import SemVer = require("../classes/semver");
import semver = require("../index");
/**
* Return true if version is greater than all the versions possible in the range.
*/
declare function gtr(
version: string | SemVer,
range: string | Range,
optionsOrLoose?: boolean | semver.RangeOptions,
): boolean;
export = gtr;
@@ -0,0 +1,15 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FlagTriangleRight = createLucideIcon("FlagTriangleRight", [
["path", { d: "M7 22V2l10 5-10 5", key: "17n18y" }]
]);
export { FlagTriangleRight as default };
//# sourceMappingURL=flag-triangle-right.js.map
@@ -0,0 +1 @@
{"version":3,"file":"mouse-off.js","sources":["../../../src/icons/mouse-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MouseOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgNnYuMzQzIiAvPgogIDxwYXRoIGQ9Ik0xOC4yMTggMTguMjE4QTcgNyAwIDAgMSA1IDE1VjlhNyA3IDAgMCAxIC43ODItMy4yMTgiIC8+CiAgPHBhdGggZD0iTTE5IDEzLjM0M1Y5QTcgNyAwIDAgMCA4LjU2IDIuOTAyIiAvPgogIDxwYXRoIGQ9Ik0yMiAyMiAyIDIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/mouse-off\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 MouseOff = createLucideIcon('MouseOff', [\n ['path', { d: 'M12 6v.343', key: '1gyhex' }],\n ['path', { d: 'M18.218 18.218A7 7 0 0 1 5 15V9a7 7 0 0 1 .782-3.218', key: 'ukzz01' }],\n ['path', { d: 'M19 13.343V9A7 7 0 0 0 8.56 2.902', key: '104jy9' }],\n ['path', { d: 'M22 22 2 2', key: '1r8tn9' }],\n]);\n\nexport default MouseOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACrF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAClE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,9 @@
import ws from "./ws";
const handler = {
scheme: "wss",
domainHost: ws.domainHost,
parse: ws.parse,
serialize: ws.serialize
};
export default handler;
//# sourceMappingURL=wss.js.map
@@ -0,0 +1 @@
{"version":3,"file":"animation-count.mjs","sources":["../../../src/stats/animation-count.ts"],"sourcesContent":["export const activeAnimations = {\n layout: 0,\n mainThread: 0,\n waapi: 0,\n}\n"],"names":[],"mappings":"AAAO,MAAM,gBAAgB,GAAG;AAC5B,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,UAAU,EAAE,CAAC;AACb,IAAA,KAAK,EAAE,CAAC;;;;;"}
@@ -0,0 +1,12 @@
'use strict'
const { stringify } = require('jsonfile/utils')
const { outputFile } = require('../output-file')
async function outputJson (file, data, options = {}) {
const str = stringify(data, options)
await outputFile(file, str, options)
}
module.exports = outputJson
@@ -0,0 +1,35 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./BlockScope"), exports);
__exportStar(require("./CatchScope"), exports);
__exportStar(require("./ClassFieldInitializerScope"), exports);
__exportStar(require("./ClassScope"), exports);
__exportStar(require("./ConditionalTypeScope"), exports);
__exportStar(require("./ForScope"), exports);
__exportStar(require("./FunctionExpressionNameScope"), exports);
__exportStar(require("./FunctionScope"), exports);
__exportStar(require("./FunctionTypeScope"), exports);
__exportStar(require("./GlobalScope"), exports);
__exportStar(require("./MappedTypeScope"), exports);
__exportStar(require("./ModuleScope"), exports);
__exportStar(require("./Scope"), exports);
__exportStar(require("./ScopeType"), exports);
__exportStar(require("./SwitchScope"), exports);
__exportStar(require("./TSEnumScope"), exports);
__exportStar(require("./TSModuleScope"), exports);
__exportStar(require("./TypeScope"), exports);
__exportStar(require("./WithScope"), exports);
@@ -0,0 +1,219 @@
/**
* @fileoverview Rule to count multiple spaces in regular expressions
* @author Matt DuVall <http://www.mattduvall.com/>
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
const regexpp = require("@eslint-community/regexpp");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const regExpParser = new regexpp.RegExpParser();
const DOUBLE_SPACE = / {2}/u;
/**
* Check if node is a string
* @param {ASTNode} node node to evaluate
* @returns {boolean} True if its a string
* @private
*/
function isString(node) {
return node && node.type === "Literal" && typeof node.value === "string";
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow multiple spaces in regular expressions",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-regex-spaces",
},
schema: [],
fixable: "code",
messages: {
multipleSpaces: "Spaces are hard to count. Use {{{length}}}.",
},
},
create(context) {
const sourceCode = context.sourceCode;
/**
* Validate regular expression
* @param {ASTNode} nodeToReport Node to report.
* @param {string} pattern Regular expression pattern to validate.
* @param {string} rawPattern Raw representation of the pattern in the source code.
* @param {number} rawPatternStartRange Start range of the pattern in the source code.
* @param {string} flags Regular expression flags.
* @returns {void}
* @private
*/
function checkRegex(
nodeToReport,
pattern,
rawPattern,
rawPatternStartRange,
flags,
) {
// Skip if there are no consecutive spaces in the source code, to avoid reporting e.g., RegExp(' \ ').
if (!DOUBLE_SPACE.test(rawPattern)) {
return;
}
const characterClassNodes = [];
let regExpAST;
try {
regExpAST = regExpParser.parsePattern(
pattern,
0,
pattern.length,
{
unicode: flags.includes("u"),
unicodeSets: flags.includes("v"),
},
);
} catch {
// Ignore regular expressions with syntax errors
return;
}
regexpp.visitRegExpAST(regExpAST, {
onCharacterClassEnter(ccNode) {
characterClassNodes.push(ccNode);
},
});
const spacesPattern = /( {2,})(?: [+*{?]|[^+*{?]|$)/gu;
let match;
while ((match = spacesPattern.exec(pattern))) {
const {
1: { length },
index,
} = match;
// Report only consecutive spaces that are not in character classes.
if (
characterClassNodes.every(
({ start, end }) => index < start || end <= index,
)
) {
context.report({
node: nodeToReport,
messageId: "multipleSpaces",
data: { length },
fix(fixer) {
if (pattern !== rawPattern) {
return null;
}
return fixer.replaceTextRange(
[
rawPatternStartRange + index,
rawPatternStartRange + index + length,
],
` {${length}}`,
);
},
});
// Report only the first occurrence of consecutive spaces
return;
}
}
}
/**
* Validate regular expression literals
* @param {ASTNode} node node to validate
* @returns {void}
* @private
*/
function checkLiteral(node) {
if (node.regex) {
const pattern = node.regex.pattern;
const rawPattern = node.raw.slice(1, node.raw.lastIndexOf("/"));
const rawPatternStartRange = node.range[0] + 1;
const flags = node.regex.flags;
checkRegex(
node,
pattern,
rawPattern,
rawPatternStartRange,
flags,
);
}
}
/**
* Validate strings passed to the RegExp constructor
* @param {ASTNode} node node to validate
* @returns {void}
* @private
*/
function checkFunction(node) {
const scope = sourceCode.getScope(node);
const regExpVar = astUtils.getVariableByName(scope, "RegExp");
const shadowed = regExpVar && regExpVar.defs.length > 0;
const patternNode = node.arguments[0];
if (
node.callee.type === "Identifier" &&
node.callee.name === "RegExp" &&
isString(patternNode) &&
!shadowed
) {
const pattern = patternNode.value;
const rawPattern = patternNode.raw.slice(1, -1);
const rawPatternStartRange = patternNode.range[0] + 1;
let flags;
if (node.arguments.length < 2) {
// It has no flags.
flags = "";
} else {
const flagsNode = node.arguments[1];
if (isString(flagsNode)) {
flags = flagsNode.value;
} else {
// The flags cannot be determined.
return;
}
}
checkRegex(
node,
pattern,
rawPattern,
rawPatternStartRange,
flags,
);
}
}
return {
Literal: checkLiteral,
CallExpression: checkFunction,
NewExpression: checkFunction,
};
},
};
@@ -0,0 +1,825 @@
export default `flf2a$ 8 7 20 -1 7
STELLAR by Ron Fritz 8/94
Figlet Release 2.0
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
\`..@
\`..@
\`..@
\`. @
\`. @
@
\`..@
@@
\`. \`.@
\`. \`.@
@
@
@
@
@
@@
@
\`.. \`.. @
\`...... \`....@
\`.. \`.. @
\`.. \`.. @
\`...... \`....@
\`.. \`.. @
@@
\`.. @
\`. \`.. @
\`.. @
\`.. @
\`..@
\`.. \`.. @
\`.. @
@@
@
\`.. \`.. @
\`.. @
\`.. @
\`.. @
\`.. @
\`.. \`.. @
@@
\`. @
\`.. \`..@
\`.. @
\`... @
\`.. @
\`.. \`..@
\`. @
@@
\`..@
\`.@
@
@
@
@
@
@@
\`..@
\`.. @
\`.. @
\`.. @
\`.. @
\`.. @
\`..@
@@
\`.. @
\`.. @
\`..@
\`..@
\`..@
\`.. @
\`.. @
@@
\`.. @
\`.. \`.. \`..@
\`. \`. \`.. @
\`.... \`.......@
\`. \`. \`.. @
\`.. \`.. \`..@
\`.. @
@@
@
\`.. @
\`.. @
\`... \`.....@
\`.. @
\`.. @
@
@@
@
@
@
@
@
@
\`..@
\`.@@
@
@
@
\`.....@
@
@
@
@@
@
@
@
@
@
@
\`..@
@@
\`..@
\`.. @
\`.. @
\`.. @
\`.. @
\`.. @
\`.. @
@@
@
\`.. @
\`.. \`.. @
\`.. \`.. @
\`.. \`..@
\`.. \`.. @
\`... @
@@
@
\`.. @
\`.. @
\`.. @
\`.. @
\`.. @
\`....@
@@
@
\`.. \`.. @
\`. \`..@
\`.. @
\`.. @
\`.. @
\`........ @
@@
@
\`.. \`.. @
\`.. @
\`.. @
\`.. @
\`..@
\`..... @
@@
@
\`.. @
\` \`.. @
\`. \`.. @
\`.. \`.. @
\`.... \`. \`..@
\`.. @
@@
@
\`.. \`... @
\`.. @
\`... @
\`.. @
\`..@
\`... \`.. @
@@
@
\`.. @
\`.. @
\`.. @
\`. \`.. @
\`.. \`..@
\`.. \`.. @
@@
@
\`..... \`..@
\`.. @
\`.. @
\`.. @
\`.. @
\`.. @
@@
@
\`. @
\`.. \`.. @
\`.. \`. @
\`.. \`. @
\`.. \`..@
\`.... @
@@
@
\`. \`.. @
\`.. \`..@
\`. \`.. @
\`. \`.. @
\`.. @
\`.. @
@@
@
@
@
@
\`..@
@
\`..@
@@
@
@
@
@
\`..@
@
\`..@
\`.@@
\`..@
\`.. @
\`.. @
\`.. @
\`.. @
\`.. @
\`..@
@@
@
@
\`......@
@
\`......@
@
@
@@
\`.. @
\`.. @
\`.. @
\`..@
\`.. @
\`.. @
\`.. @
@@
\`... @
\`.. @
\`..@
\`.. @
\`.. @
@
\`.. @
@@
@
\`... @
\`. \`.. @
\`. \`.. \`..@
\`.. \`..\` \`..@
\`.. \`\`\` @
\`.. @
@@
\`. @
\`. .. @
\`. \`.. @
\`.. \`.. @
\`...... \`.. @
\`.. \`.. @
\`.. \`..@
@@
\`.. \`.. @
\`. \`.. @
\`. \`..@
\`... \`. @
\`. \`..@
\`. \`.@
\`.... \`.. @
@@
\`.. @
\`.. \`..@
\`.. @
\`.. @
\`.. @
\`.. \`..@
\`.... @
@@
\`..... @
\`.. \`.. @
\`.. \`..@
\`.. \`..@
\`.. \`..@
\`.. \`.. @
\`..... @
@@
\`........@
\`.. @
\`.. @
\`...... @
\`.. @
\`.. @
\`........@
@@
\`........@
\`.. @
\`.. @
\`...... @
\`.. @
\`.. @
\`.. @
@@
\`.... @
\`. \`.. @
\`.. @
\`.. @
\`.. \`....@
\`.. \`. @
\`..... @
@@
\`.. \`..@
\`.. \`..@
\`.. \`..@
\`...... \`..@
\`.. \`..@
\`.. \`..@
\`.. \`..@
@@
\`..@
\`..@
\`..@
\`..@
\`..@
\`..@
\`..@
@@
\`..@
\`..@
\`..@
\`..@
\`..@
\`. \`..@
\`.... @
@@
\`.. \`.. @
\`.. \`.. @
\`.. \`.. @
\`. \`. @
\`.. \`.. @
\`.. \`.. @
\`.. \`..@
@@
\`.. @
\`.. @
\`.. @
\`.. @
\`.. @
\`.. @
\`........@
@@
\`.. \`..@
\`. \`.. \`...@
\`.. \`.. \` \`..@
\`.. \`.. \`..@
\`.. \`. \`..@
\`.. \`..@
\`.. \`..@
@@
\`... \`..@
\`. \`.. \`..@
\`.. \`.. \`..@
\`.. \`.. \`..@
\`.. \`. \`..@
\`.. \`. ..@
\`.. \`..@
@@
\`.... @
\`.. \`.. @
\`.. \`..@
\`.. \`..@
\`.. \`..@
\`.. \`.. @
\`.... @
@@
\`....... @
\`.. \`..@
\`.. \`..@
\`....... @
\`.. @
\`.. @
\`.. @
@@
\`.... @
\`.. \`.. @
\`.. \`..@
\`.. \`..@
\`.. \`..@
\`.. \`. \`.. @
\`.. .. @
\`. @@
\`....... @
\`.. \`.. @
\`.. \`.. @
\`. \`.. @
\`.. \`.. @
\`.. \`.. @
\`.. \`..@
@@
\`.. .. @
\`.. \`..@
\`.. @
\`.. @
\`.. @
\`.. \`..@
\`.. .. @
@@
\`... \`......@
\`.. @
\`.. @
\`.. @
\`.. @
\`.. @
\`.. @
@@
\`.. \`..@
\`.. \`..@
\`.. \`..@
\`.. \`..@
\`.. \`..@
\`.. \`..@
\`..... @
@@
\`.. \`..@
\`.. \`.. @
\`.. \`.. @
\`.. \`.. @
\`.. \`.. @
\`.... @
\`.. @
@@
\`.. \`..@
\`.. \`..@
\`.. \`. \`..@
\`.. \`.. \`..@
\`.. \`. \`.. \`..@
\`. \`. \`....@
\`.. \`..@
@@
\`.. \`..@
\`.. \`.. @
\`.. \`.. @
\`.. @
\`.. \`.. @
\`.. \`.. @
\`.. \`..@
@@
\`.. \`..@
\`.. \`.. @
\`.. \`.. @
\`.. @
\`.. @
\`.. @
\`.. @
@@
\`....... \`..@
\`.. @
\`.. @
\`.. @
\`.. @
\`.. @
\`...........@
@@
\`....@
\`.. @
\`.. @
\`.. @
\`.. @
\`.. @
\`....@
@@
\`.. @
\`.. @
\`.. @
\`.. @
\`.. @
\`.. @
\`..@
@@
\`....@
\`..@
\`..@
\`..@
\`..@
\`..@
\`....@
@@
\`.. @
\`.. \`.. @
\`.. \`..@
@
@
@
@
@@
@
@
@
@
@
@
@
\`.....@@
\`..@
\`. @
@
@
@
@
@
@@
@
@
\`.. @
\`.. \`.. @
\`.. \`.. @
\`.. \`.. @
\`.. \`...@
@@
\`.. @
\`.. @
\`.. @
\`.. \`.. @
\`.. \`..@
\`.. \`..@
\`.. \`.. @
@@
@
@
\`...@
\`.. @
\`.. @
\`.. @
\`...@
@@
\`..@
\`..@
\`..@
\`.. \`..@
\`. \`..@
\`. \`..@
\`.. \`..@
@@
@
@
\`.. @
\`. \`.. @
\`..... \`..@
\`. @
\`.... @
@@
\`..@
\`. @
\`.\`. \`.@
\`.. @
\`.. @
\`.. @
\`.. @
@@
@
@
\`.. @
\`.. \`..@
\`.. \`..@
\`.. \`..@
\`.. @
\`.. @@
@
\`.. @
\`.. @
\`. \`. @
\`.. \`..@
\`. \`..@
\`.. \`..@
@@
@
\`.@
@
\`..@
\`..@
\`..@
\`..@
@@
@
\`..@
@
\`..@
\`..@
\`..@
\`..@
\`... @@
\`.. @
\`.. @
\`.. \`..@
\`.. \`.. @
\`.\`.. @
\`.. \`.. @
\`.. \`..@
@@
\`..@
\`..@
\`..@
\`..@
\`..@
\`..@
\`...@
@@
@
@
\`... \`.. \`.. @
\`.. \`. \`..@
\`.. \`. \`..@
\`.. \`. \`..@
\`... \`. \`..@
@@
@
@
\`.. \`.. @
\`.. \`..@
\`.. \`..@
\`.. \`..@
\`... \`..@
@@
@
@
\`.. @
\`.. \`.. @
\`.. \`..@
\`.. \`.. @
\`.. @
@@
@
@
\`. \`.. @
\`. \`.. @
\`. \`..@
\`.. \`.. @
\`.. @
\`.. @@
@
@
\`.. @
\`. \`.. @
\`. \`.. @
\`..\`.. @
\`.. @
\`...@@
@
@
\`. \`...@
\`.. @
\`.. @
\`.. @
\`... @
@@
@
@
\`.... @
\`.. @
\`... @
\`..@
\`.. \`..@
@@
\`.. @
\`.. @
\`.\`. \`.@
\`.. @
\`.. @
\`.. @
\`.. @
@@
@
@
\`.. \`..@
\`.. \`..@
\`.. \`..@
\`.. \`..@
\`..\`..@
@@
@
@
\`.. \`..@
\`.. \`.. @
\`.. \`.. @
\`.\`.. @
\`.. @
@@
@
@
\`.. \`...@
\`.. . \`..@
\`.. \`. \`..@
\`. \`. \`.\`..@
\`... \`...@
@@
@
@
\`.. \`..@
\`. \`.. @
\`. @
\`. \`.. @
\`.. \`..@
@@
@
@
\`.. \`..@
\`.. \`.. @
\`... @
\`.. @
\`.. @
\`.. @@
@
@
\`.... \`..@
\`.. @
\`.. @
\`.. @
\`........@
@@
\`..@
\`.. @
\`.. @
\`... @
\`.. @
\`.. @
\`..@
@@
\`.@
\`.@
\`.@
@
\`.@
\`.@
\`.@
@@
\`.. @
\`.. @
\`.. @
\`..@
\`.. @
\`.. @
\`.. @
@@
\`.. \`. @
\`. \`..@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,413 @@
flf2a$ 4 3 10 0 4
straight.flf Version 2
by: Bas Meijer meijer@info.win.tue.nl bas@damek.kth.se
fixed by: Ryan Youck youck@cs.uregina.ca
Disclaimer: most capitals have been designed by someone else
$$@
$$@
$$@
$$@@
@
| @
. @
@@
// @
$$ @
@
@@
@
_|_|_ @
-|-|- @
@@
||_ @
(||$ @
_||) @
|| @@
@
0/ @
/0 @
@@
@
()/ @
(X @
@@
/ @
$ @
$ @
@@
$/ @
($ @
$\ @
@@
\$ @
$) @
/$ @
@@
$ $@
$\/$@
$/\$@
$ $@@
$ $@
$_|_$@
$ | $@
$ $@@
$@
$$@
,$@
$@@
$ $@
$__$@
$ $@
$ $@@
$@
$ $@
. $@
$@@
@
$/ @
/$ @
@@
$ __ @
$/ \ @
$\__/ @
$ @@
$ @
$/| @
$ | @
$ @@
$__ @
$ _) @
$/__ @
$ @@
$__ @
$ _) @
$__) @
$ @@
$ @
$|__| @
$ | @
$ @@
$ __ @
$|_ @
$__) @
$ @@
$ __ @
$/__ @
$\__) @
$ @@
$___ @
$ / @
$ / @
$ @@
$ __ @
$(__) @
$(__) @
$ @@
$ __ @
$(__\ @
$ __/ @
$ @@
@
. @
. @
@@
@
. @
, @
@@
$ $@
$/$@
$\$@
$ $@@
$ $@
$__$@
$--$@
$ $@@
$ $@
$\$@
$/$@
$ $@@
$ _ @
$ )@
$ . @
$ @@
@
@
@
@@
@
$/\ @
/--\ @
@@
$__ @
|__) @
|__) @
@@
$__ @
/ @
\__ @
@@
$__ @
| \ @
|__/ @
@@
$__ @
|_ @
|__ @
@@
$__ @
|_ @
| @
@@
$__ @
/ _ @
\__) @
@@
$ @
|__| @
| | @
@@
$ @
| @
| @
@@
$ @
$| @
__) @
@@
$ @
|_/ @
| \ @
@@
$ @
| @
|__ @
@@
$ @
|\/| @
| | @
@@
$ @
|\ | @
| \| @
@@
$__ @
/ \ @
\__/ @
@@
$__ @
|__) @
| $ @
@@
$__ @
/ \ @
\_\/ @
@@
$__ @
|__) @
| \ @
@@
$__ @
(_ @
__) @
@@
___ @
$|$ @
| @
@@
$ @
/ \ @
\__/ @
@@
$ @
\ / @
\/ @
@@
$ @
| | @
|/\| @
@@
$ @
\_/ @
/ \ @
@@
$ @
\_/ @
| @
@@
___ @
$_/ @
/__ @
@@
_ @
|$ @
|_ @
@@
@
\ @
\ @
@@
_ @
$| @
_| @
@@
@
/\ @
$$ @
@@
@
@
__ @
@@
\ @
$ @
$ @
@@
@
_ @
(_| @
@@
@
|_ @
|_) @
@@
@
_ @
(_ @
@@
@
_| @
(_| @
@@
@
_ @
(- @
@@
_ @
(_ @
|$ @
@@
@
_ @
(_) @
_/ @@
@
|_ @
| ) @
@@
@
. @
| @
@@
@
. @
| @
/ @@
@
|$ @
|( @
@@
@
| @
| @
@@
@
_ @
||| @
@@
@
_ @
| ) @
@@
@
_ @
(_) @
@@
@
_ @
|_) @
| @@
@
_ @
(_| @
| @@
@
_ @
|$ @
@@
@
_ @
_) @
@@
@
|_ @
|_ @
@@
@
$ $ @
|_| @
@@
@
$$ @
\/ @
@@
@
$ $ @
\)/ @
@@
@
$$ @
)( @
@@
@
$$ @
\/ @
/ @@
@
_ @
/_ @
@@
( @
< @
( @
@@
| @
| @
| @
@@
) @
> @
) @
@@
@
/\/ @
@
@@
o o @
/\ @
/--\ @
@@
o__o @
/ \ @
\__/ @
@@
o o @
/ \ @
\__/ @
@@
@
-_- @
(_| @
@@
@
-_- @
(_) @
@@
@
- - @
|_| @
@@
__ @
|__) @
|__) @
| @@
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ExternalLink = createLucideIcon("ExternalLink", [
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
["path", { d: "M10 14 21 3", key: "gplh6r" }],
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
]);
export { ExternalLink as default };
//# sourceMappingURL=external-link.js.map
@@ -0,0 +1 @@
{"version":3,"file":"book-text.js","sources":["../../../src/icons/book-text.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BookText\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAxOS41di0xNUEyLjUgMi41IDAgMCAxIDYuNSAySDE5YTEgMSAwIDAgMSAxIDF2MThhMSAxIDAgMCAxLTEgMUg2LjVhMSAxIDAgMCAxIDAtNUgyMCIgLz4KICA8cGF0aCBkPSJNOCAxMWg4IiAvPgogIDxwYXRoIGQ9Ik04IDdoNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/book-text\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 BookText = createLucideIcon('BookText', [\n [\n 'path',\n {\n d: 'M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20',\n key: 'k3hazp',\n },\n ],\n ['path', { d: 'M8 11h8', key: 'vwpz6n' }],\n ['path', { d: 'M8 7h6', key: '1f0q6e' }],\n]);\n\nexport default BookText;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAC5C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACzC,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["// While the public API was clearly inspired by the \"history\" npm package,\n// This implementation attempts to be more lightweight by\n// making assumptions about the way TanStack Router works\n\nexport interface NavigateOptions {\n ignoreBlocker?: boolean\n}\n\ntype SubscriberHistoryAction =\n | {\n type: Exclude<HistoryAction, 'GO'>\n }\n | {\n type: 'GO'\n index: number\n }\n\ntype SubscriberArgs = {\n location: HistoryLocation\n action: SubscriberHistoryAction\n}\n\nexport interface RouterHistory {\n location: HistoryLocation\n length: number\n subscribers: Set<(opts: SubscriberArgs) => void>\n subscribe: (cb: (opts: SubscriberArgs) => void) => () => void\n push: (path: string, state?: any, navigateOpts?: NavigateOptions) => void\n replace: (path: string, state?: any, navigateOpts?: NavigateOptions) => void\n go: (index: number, navigateOpts?: NavigateOptions) => void\n back: (navigateOpts?: NavigateOptions) => void\n forward: (navigateOpts?: NavigateOptions) => void\n canGoBack: () => boolean\n createHref: (href: string) => string\n block: (blocker: NavigationBlocker) => () => void\n flush: () => void\n destroy: () => void\n notify: (action: SubscriberHistoryAction) => void\n _ignoreSubscribers?: boolean\n}\n\nexport interface HistoryLocation extends ParsedPath {\n state: ParsedHistoryState\n}\n\nexport interface ParsedPath {\n href: string\n pathname: string\n search: string\n hash: string\n}\n\nexport interface HistoryState {}\n\nexport type ParsedHistoryState = HistoryState & {\n key?: string // TODO: Remove in v2 - use __TSR_key instead\n __TSR_key?: string\n __TSR_index: number\n}\n\ntype ShouldAllowNavigation = any\n\nexport type HistoryAction = 'PUSH' | 'REPLACE' | 'FORWARD' | 'BACK' | 'GO'\n\nexport type BlockerFnArgs = {\n currentLocation: HistoryLocation\n nextLocation: HistoryLocation\n action: HistoryAction\n}\n\nexport type BlockerFn = (\n args: BlockerFnArgs,\n) => Promise<ShouldAllowNavigation> | ShouldAllowNavigation\n\nexport type NavigationBlocker = {\n blockerFn: BlockerFn\n enableBeforeUnload?: (() => boolean) | boolean\n}\n\ntype TryNavigateArgs = {\n task: () => void\n type: 'PUSH' | 'REPLACE' | 'BACK' | 'FORWARD' | 'GO'\n navigateOpts?: NavigateOptions\n} & (\n | {\n type: 'PUSH' | 'REPLACE'\n path: string\n state: any\n }\n | {\n type: 'BACK' | 'FORWARD' | 'GO'\n }\n)\n\nconst stateIndexKey = '__TSR_index'\nconst popStateEvent = 'popstate'\nconst beforeUnloadEvent = 'beforeunload'\n\nexport function createHistory(opts: {\n getLocation: () => HistoryLocation\n getLength: () => number\n pushState: (path: string, state: any) => void\n replaceState: (path: string, state: any) => void\n go: (n: number) => void\n back: (ignoreBlocker: boolean) => void\n forward: (ignoreBlocker: boolean) => void\n createHref: (path: string) => string\n flush?: () => void\n destroy?: () => void\n onBlocked?: () => void\n getBlockers?: () => Array<NavigationBlocker>\n setBlockers?: (blockers: Array<NavigationBlocker>) => void\n // Avoid notifying on forward/back/go, used for browser history as we already get notified by the popstate event\n notifyOnIndexChange?: boolean\n}): RouterHistory {\n let location = opts.getLocation()\n const subscribers = new Set<(opts: SubscriberArgs) => void>()\n\n const notify = (action: SubscriberHistoryAction) => {\n location = opts.getLocation()\n subscribers.forEach((subscriber) => subscriber({ location, action }))\n }\n\n const handleIndexChange = (action: SubscriberHistoryAction) => {\n if (opts.notifyOnIndexChange ?? true) notify(action)\n else location = opts.getLocation()\n }\n\n const tryNavigation = async ({\n task,\n navigateOpts,\n ...actionInfo\n }: TryNavigateArgs) => {\n const ignoreBlocker = navigateOpts?.ignoreBlocker ?? false\n if (ignoreBlocker) {\n task()\n return\n }\n\n const blockers = opts.getBlockers?.() ?? []\n const isPushOrReplace =\n actionInfo.type === 'PUSH' || actionInfo.type === 'REPLACE'\n if (typeof document !== 'undefined' && blockers.length && isPushOrReplace) {\n for (const blocker of blockers) {\n const nextLocation = parseHref(actionInfo.path, actionInfo.state)\n const isBlocked = await blocker.blockerFn({\n currentLocation: location,\n nextLocation,\n action: actionInfo.type,\n })\n if (isBlocked) {\n opts.onBlocked?.()\n return\n }\n }\n }\n\n task()\n }\n\n return {\n get location() {\n return location\n },\n get length() {\n return opts.getLength()\n },\n subscribers,\n subscribe: (cb: (opts: SubscriberArgs) => void) => {\n subscribers.add(cb)\n\n return () => {\n subscribers.delete(cb)\n }\n },\n push: (path, state, navigaLine truncated
@@ -0,0 +1,272 @@
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
const require_useRouter = require("./useRouter.cjs");
let _tanstack_router_core = require("@tanstack/router-core");
let react = require("react");
react = require_runtime.__toESM(react);
let _tanstack_react_store = require("@tanstack/react-store");
let _tanstack_router_core_isServer = require("@tanstack/router-core/isServer");
//#region src/headContentUtils.tsx
function buildTagsFromMatches(router, nonce, matches, assetCrossOrigin) {
const routeMeta = matches.map((match) => match.meta).filter(Boolean);
const resultMeta = [];
const metaByAttribute = {};
let title;
for (let i = routeMeta.length - 1; i >= 0; i--) {
const metas = routeMeta[i];
for (let j = metas.length - 1; j >= 0; j--) {
const m = metas[j];
if (!m) continue;
if (m.title) {
if (!title) title = {
tag: "title",
children: m.title
};
} else if ("script:ld+json" in m) try {
const json = JSON.stringify(m["script:ld+json"]);
resultMeta.push({
tag: "script",
attrs: { type: "application/ld+json" },
children: (0, _tanstack_router_core.escapeHtml)(json)
});
} catch {}
else {
const attribute = m.name ?? m.property;
if (attribute) if (metaByAttribute[attribute]) continue;
else metaByAttribute[attribute] = true;
resultMeta.push({
tag: "meta",
attrs: {
...m,
nonce
}
});
}
}
}
if (title) resultMeta.push(title);
if (nonce) resultMeta.push({
tag: "meta",
attrs: {
property: "csp-nonce",
content: nonce
}
});
resultMeta.reverse();
const constructedLinks = matches.map((match) => match.links).filter(Boolean).flat(1).map((link) => ({
tag: "link",
attrs: {
...link,
nonce
}
}));
const manifest = router.ssr?.manifest;
const assetLinks = matches.map((match) => manifest?.routes[match.routeId]?.assets ?? []).filter(Boolean).flat(1).flatMap((asset) => {
if (asset.tag === "link") {
if ((0, _tanstack_router_core.isInlinableStylesheet)(manifest, asset)) return [];
return [{
tag: "link",
attrs: {
...asset.attrs,
crossOrigin: (0, _tanstack_router_core.getAssetCrossOrigin)(assetCrossOrigin, "stylesheet") ?? asset.attrs?.crossOrigin,
suppressHydrationWarning: true,
nonce
}
}];
}
if (asset.tag === "style") return [{
tag: "style",
attrs: {
...asset.attrs,
nonce
},
children: asset.children,
...asset.inlineCss ? { inlineCss: true } : {}
}];
return [];
});
const preloadLinks = [];
matches.map((match) => router.looseRoutesById[match.routeId]).forEach((route) => router.ssr?.manifest?.routes[route.id]?.preloads?.filter(Boolean).forEach((preload) => {
const preloadLink = (0, _tanstack_router_core.resolveManifestAssetLink)(preload);
preloadLinks.push({
tag: "link",
attrs: {
rel: "modulepreload",
href: preloadLink.href,
crossOrigin: (0, _tanstack_router_core.getAssetCrossOrigin)(assetCrossOrigin, "modulepreload") ?? preloadLink.crossOrigin,
nonce
}
});
}));
const styles = matches.map((match) => match.styles).flat(1).filter(Boolean).map(({ children, ...attrs }) => ({
tag: "style",
attrs: {
...attrs,
nonce
},
children
}));
const headScripts = matches.map((match) => match.headScripts).flat(1).filter(Boolean).map(({ children, ...script }) => ({
tag: "script",
attrs: {
...script,
nonce
},
children
}));
return uniqBy([
...resultMeta,
...preloadLinks,
...constructedLinks,
...assetLinks,
...styles,
...headScripts
], (d) => JSON.stringify(d));
}
/**
* Build the list of head/link/meta/script tags to render for active matches.
* Used internally by `HeadContent`.
*/
var useTags = (assetCrossOrigin) => {
const router = require_useRouter.useRouter();
const nonce = router.options.ssr?.nonce;
if (_tanstack_router_core_isServer.isServer ?? router.isServer) return buildTagsFromMatches(router, nonce, router.stores.matches.get(), assetCrossOrigin);
const routeMeta = (0, _tanstack_react_store.useStore)(router.stores.matches, (matches) => {
return matches.map((match) => match.meta).filter(Boolean);
}, _tanstack_router_core.deepEqual);
const meta = react.useMemo(() => {
const resultMeta = [];
const metaByAttribute = {};
let title;
for (let i = routeMeta.length - 1; i >= 0; i--) {
const metas = routeMeta[i];
for (let j = metas.length - 1; j >= 0; j--) {
const m = metas[j];
if (!m) continue;
if (m.title) {
if (!title) title = {
tag: "title",
children: m.title
};
} else if ("script:ld+json" in m) try {
const json = JSON.stringify(m["script:ld+json"]);
resultMeta.push({
tag: "script",
attrs: { type: "application/ld+json" },
children: (0, _tanstack_router_core.escapeHtml)(json)
});
} catch {}
else {
const attribute = m.name ?? m.property;
if (attribute) if (metaByAttribute[attribute]) continue;
else metaByAttribute[attribute] = true;
resultMeta.push({
tag: "meta",
attrs: {
...m,
nonce
}
});
}
}
}
if (title) resultMeta.push(title);
if (nonce) resultMeta.push({
tag: "meta",
attrs: {
property: "csp-nonce",
content: nonce
}
});
resultMeta.reverse();
return resultMeta;
}, [routeMeta, nonce]);
const links = (0, _tanstack_react_store.useStore)(router.stores.matches, (matches) => {
const constructed = matches.map((match) => match.links).filter(Boolean).flat(1).map((link) => ({
tag: "link",
attrs: {
...link,
nonce
}
}));
const manifest = router.ssr?.manifest;
const assets = matches.map((match) => manifest?.routes[match.routeId]?.assets ?? []).filter(Boolean).flat(1).flatMap((asset) => {
if (asset.tag === "link") {
if ((0, _tanstack_router_core.isInlinableStylesheet)(manifest, asset)) return [];
return [{
tag: "link",
attrs: {
...asset.attrs,
crossOrigin: (0, _tanstack_router_core.getAssetCrossOrigin)(assetCrossOrigin, "stylesheet") ?? asset.attrs?.crossOrigin,
suppressHydrationWarning: true,
nonce
}
}];
}
if (asset.tag === "style") return [{
tag: "style",
attrs: {
...asset.attrs,
nonce
},
children: asset.children,
...asset.inlineCss ? { inlineCss: true } : {}
}];
return [];
});
return [...constructed, ...assets];
}, _tanstack_router_core.deepEqual);
const preloadLinks = (0, _tanstack_react_store.useStore)(router.stores.matches, (matches) => {
const preloadLinks = [];
matches.map((match) => router.looseRoutesById[match.routeId]).forEach((route) => router.ssr?.manifest?.routes[route.id]?.preloads?.filter(Boolean).forEach((preload) => {
const preloadLink = (0, _tanstack_router_core.resolveManifestAssetLink)(preload);
preloadLinks.push({
tag: "link",
attrs: {
rel: "modulepreload",
href: preloadLink.href,
crossOrigin: (0, _tanstack_router_core.getAssetCrossOrigin)(assetCrossOrigin, "modulepreload") ?? preloadLink.crossOrigin,
nonce
}
});
}));
return preloadLinks;
}, _tanstack_router_core.deepEqual);
const styles = (0, _tanstack_react_store.useStore)(router.stores.matches, (matches) => matches.map((match) => match.styles).flat(1).filter(Boolean).map(({ children, ...attrs }) => ({
tag: "style",
attrs: {
...attrs,
nonce
},
children
})), _tanstack_router_core.deepEqual);
const headScripts = (0, _tanstack_react_store.useStore)(router.stores.matches, (matches) => matches.map((match) => match.headScripts).flat(1).filter(Boolean).map(({ children, ...script }) => ({
tag: "script",
attrs: {
...script,
nonce
},
children
})), _tanstack_router_core.deepEqual);
return uniqBy([
...meta,
...preloadLinks,
...links,
...styles,
...headScripts
], (d) => {
return JSON.stringify(d);
});
};
function uniqBy(arr, fn) {
const seen = /* @__PURE__ */ new Set();
return arr.filter((item) => {
const key = fn(item);
if (seen.has(key)) return false;
seen.add(key);
return true;
});
}
//#endregion
exports.useTags = useTags;
//# sourceMappingURL=headContentUtils.cjs.map
@@ -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 MailOpen = createLucideIcon("MailOpen", [
[
"path",
{
d: "M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z",
key: "1jhwl8"
}
],
["path", { d: "m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10", key: "1qfld7" }]
]);
export { MailOpen as default };
//# sourceMappingURL=mail-open.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.cjs","sources":["../../src/index.ts"],"sourcesContent":["export * from '@tanstack/store'\n\nexport { useStore } from './useStore'\n\nexport function shallow<T>(objA: T, objB: T) {\n if (Object.is(objA, objB)) {\n return true\n }\n\n if (\n typeof objA !== 'object' ||\n objA === null ||\n typeof objB !== 'object' ||\n objB === null\n ) {\n return false\n }\n\n if (objA instanceof Map && objB instanceof Map) {\n if (objA.size !== objB.size) return false\n for (const [k, v] of objA) {\n if (!objB.has(k) || !Object.is(v, objB.get(k))) return false\n }\n return true\n }\n\n if (objA instanceof Set && objB instanceof Set) {\n if (objA.size !== objB.size) return false\n for (const v of objA) {\n if (!objB.has(v)) return false\n }\n return true\n }\n\n if (objA instanceof Date && objB instanceof Date) {\n if (objA.getTime() !== objB.getTime()) return false\n return true\n }\n\n const keysA = getOwnKeys(objA)\n if (keysA.length !== getOwnKeys(objB).length) {\n return false\n }\n\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < keysA.length; i++) {\n if (\n !Object.prototype.hasOwnProperty.call(objB, keysA[i] as string) ||\n !Object.is(objA[keysA[i] as keyof T], objB[keysA[i] as keyof T])\n ) {\n return false\n }\n }\n return true\n}\n\nfunction getOwnKeys(obj: object): Array<string | symbol> {\n return (Object.keys(obj) as Array<string | symbol>).concat(\n Object.getOwnPropertySymbols(obj),\n )\n}\n"],"names":[],"mappings":";;;;AAIO,SAAS,QAAW,MAAS,MAAS;AAC3C,MAAI,OAAO,GAAG,MAAM,IAAI,GAAG;AACzB,WAAO;AAAA,EACT;AAEA,MACE,OAAO,SAAS,YAChB,SAAS,QACT,OAAO,SAAS,YAChB,SAAS,MACT;AACA,WAAO;AAAA,EACT;AAEA,MAAI,gBAAgB,OAAO,gBAAgB,KAAK;AAC9C,QAAI,KAAK,SAAS,KAAK,KAAM,QAAO;AACpC,eAAW,CAAC,GAAG,CAAC,KAAK,MAAM;AACzB,UAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,KAAK,IAAI,CAAC,CAAC,EAAG,QAAO;AAAA,IACzD;AACA,WAAO;AAAA,EACT;AAEA,MAAI,gBAAgB,OAAO,gBAAgB,KAAK;AAC9C,QAAI,KAAK,SAAS,KAAK,KAAM,QAAO;AACpC,eAAW,KAAK,MAAM;AACpB,UAAI,CAAC,KAAK,IAAI,CAAC,EAAG,QAAO;AAAA,IAC3B;AACA,WAAO;AAAA,EACT;AAEA,MAAI,gBAAgB,QAAQ,gBAAgB,MAAM;AAChD,QAAI,KAAK,QAAA,MAAc,KAAK,QAAA,EAAW,QAAO;AAC9C,WAAO;AAAA,EACT;AAEA,QAAM,QAAQ,WAAW,IAAI;AAC7B,MAAI,MAAM,WAAW,WAAW,IAAI,EAAE,QAAQ;AAC5C,WAAO;AAAA,EACT;AAGA,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QACE,CAAC,OAAO,UAAU,eAAe,KAAK,MAAM,MAAM,CAAC,CAAW,KAC9D,CAAC,OAAO,GAAG,KAAK,MAAM,CAAC,CAAY,GAAG,KAAK,MAAM,CAAC,CAAY,CAAC,GAC/D;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,WAAW,KAAqC;AACvD,SAAQ,OAAO,KAAK,GAAG,EAA6B;AAAA,IAClD,OAAO,sBAAsB,GAAG;AAAA,EAAA;AAEpC;;;;;;;;;"}
@@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const isObject = require("./isObject.js");
const hasSymbol = typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol";
function isESModule(value) {
return isObject.isObject(value) && (value.__esModule || hasSymbol && value[Symbol.toStringTag] === "Module");
}
exports.isESModule = isESModule;
@@ -0,0 +1,3 @@
import { ZodCatchDef } from "zod/v3";
import { Refs } from "../Refs.js";
export declare const parseCatchDef: (def: ZodCatchDef<any>, refs: Refs) => import("../parseTypes.js").JsonSchema7Type | undefined;
@@ -0,0 +1 @@
{"version":3,"names":["_assertThisInitialized","self","ReferenceError"],"sources":["../../src/helpers/assertThisInitialized.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _assertThisInitialized<T>(self: T | undefined): T {\n if (self === void 0) {\n throw new ReferenceError(\n \"this hasn't been initialised - super() hasn't been called\",\n );\n }\n return self;\n}\n"],"mappings":";;;;;;AAEe,SAASA,sBAAsBA,CAAIC,IAAmB,EAAK;EACxE,IAAIA,IAAI,KAAK,KAAK,CAAC,EAAE;IACnB,MAAM,IAAIC,cAAc,CACtB,2DACF,CAAC;EACH;EACA,OAAOD,IAAI;AACb","ignoreList":[]}
@@ -0,0 +1,2 @@
export declare const setNonce: (nonce: string) => void;
export declare const getNonce: () => string | undefined;
@@ -0,0 +1,62 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2015_iterable = void 0;
const base_config_1 = require("./base-config");
const es2015_symbol_1 = require("./es2015.symbol");
exports.es2015_iterable = {
libs: [es2015_symbol_1.es2015_symbol],
variables: [
['SymbolConstructor', base_config_1.TYPE],
['IteratorYieldResult', base_config_1.TYPE],
['IteratorReturnResult', base_config_1.TYPE],
['IteratorResult', base_config_1.TYPE],
['Iterator', base_config_1.TYPE],
['Iterable', base_config_1.TYPE],
['IterableIterator', base_config_1.TYPE],
['IteratorObject', base_config_1.TYPE],
['BuiltinIteratorReturn', base_config_1.TYPE],
['ArrayIterator', base_config_1.TYPE],
['Array', base_config_1.TYPE],
['ArrayConstructor', base_config_1.TYPE],
['ReadonlyArray', base_config_1.TYPE],
['IArguments', base_config_1.TYPE],
['MapIterator', base_config_1.TYPE],
['Map', base_config_1.TYPE],
['ReadonlyMap', base_config_1.TYPE],
['MapConstructor', base_config_1.TYPE],
['WeakMap', base_config_1.TYPE],
['WeakMapConstructor', base_config_1.TYPE],
['SetIterator', base_config_1.TYPE],
['Set', base_config_1.TYPE],
['ReadonlySet', base_config_1.TYPE],
['SetConstructor', base_config_1.TYPE],
['WeakSet', base_config_1.TYPE],
['WeakSetConstructor', base_config_1.TYPE],
['Promise', base_config_1.TYPE],
['PromiseConstructor', base_config_1.TYPE],
['StringIterator', base_config_1.TYPE],
['String', base_config_1.TYPE],
['Int8Array', base_config_1.TYPE],
['Int8ArrayConstructor', base_config_1.TYPE],
['Uint8Array', base_config_1.TYPE],
['Uint8ArrayConstructor', base_config_1.TYPE],
['Uint8ClampedArray', base_config_1.TYPE],
['Uint8ClampedArrayConstructor', base_config_1.TYPE],
['Int16Array', base_config_1.TYPE],
['Int16ArrayConstructor', base_config_1.TYPE],
['Uint16Array', base_config_1.TYPE],
['Uint16ArrayConstructor', base_config_1.TYPE],
['Int32Array', base_config_1.TYPE],
['Int32ArrayConstructor', base_config_1.TYPE],
['Uint32Array', base_config_1.TYPE],
['Uint32ArrayConstructor', base_config_1.TYPE],
['Float32Array', base_config_1.TYPE],
['Float32ArrayConstructor', base_config_1.TYPE],
['Float64Array', base_config_1.TYPE],
['Float64ArrayConstructor', base_config_1.TYPE],
],
};