praxis-kit 6.2.0 → 6.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_shared/diagnostics.d.ts +16 -0
- package/dist/_shared/diagnostics.js +16 -0
- package/dist/{chunk-4YVNOMUS.js → chunk-H3D2JA3J.js} +491 -26
- package/dist/lit/index.js +480 -15
- package/dist/preact/index.js +491 -26
- package/dist/react/index.js +1 -1
- package/dist/react/legacy.js +1 -1
- package/dist/solid/index.js +491 -26
- package/dist/svelte/index.js +491 -26
- package/dist/tailwind/index.js +1 -1
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/index.js +15 -0
- package/dist/vite-plugin/index.d.ts +16 -0
- package/dist/vue/index.js +491 -26
- package/dist/web/index.js +480 -15
- package/package.json +9 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** A single-argument pure function — the shape `memoize()` wraps. */
|
|
2
|
+
type UnaryFn<T, R> = (arg: T) => R;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Caches the result of a pure, single-argument function in an unbounded `Map`.
|
|
6
|
+
*
|
|
7
|
+
* Best suited to functions that are expensive relative to a cache lookup and
|
|
8
|
+
* repeatedly called with a relatively small, bounded set of inputs (for
|
|
9
|
+
* example, a finite vocabulary of tokens or strings). Avoid memoizing
|
|
10
|
+
* unbounded or attacker-controlled input spaces, as the cache will grow
|
|
11
|
+
* without limit. Use `LRUCache` instead when cache size should remain bounded.
|
|
12
|
+
*/
|
|
13
|
+
declare function memoize<T, R>(fn: UnaryFn<T, R>): UnaryFn<T, R>;
|
|
14
|
+
|
|
15
|
+
export { memoize };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// ../../lib/primitive/src/utils/memoize.ts
|
|
2
|
+
function memoize(fn) {
|
|
3
|
+
const cache = /* @__PURE__ */ new Map();
|
|
4
|
+
return (arg) => {
|
|
5
|
+
if (cache.has(arg)) {
|
|
6
|
+
return cache.get(arg);
|
|
7
|
+
}
|
|
8
|
+
const result = fn(arg);
|
|
9
|
+
cache.set(arg, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
memoize
|
|
15
|
+
};
|
|
@@ -53,6 +53,22 @@ declare enum DiagnosticCode {
|
|
|
53
53
|
HtmlStandaloneRegionOverride = "HTML3005",
|
|
54
54
|
HtmlLandmarkRoleOverride = "HTML3006",
|
|
55
55
|
HtmlInvalidChild = "HTML3007",
|
|
56
|
+
HtmlRoleNotPermitted = "HTML3008",
|
|
57
|
+
HtmlInputUnsupportedType = "HTML3101",
|
|
58
|
+
HtmlInputCheckedIgnoredForType = "HTML3102",
|
|
59
|
+
HtmlInputMultipleIgnoredForType = "HTML3103",
|
|
60
|
+
HtmlInputMaxLengthIgnoredForType = "HTML3104",
|
|
61
|
+
HtmlInputMinLengthIgnoredForType = "HTML3105",
|
|
62
|
+
HtmlInputPatternIgnoredForType = "HTML3106",
|
|
63
|
+
HtmlInputMinIgnoredForType = "HTML3107",
|
|
64
|
+
HtmlInputMaxIgnoredForType = "HTML3108",
|
|
65
|
+
HtmlInputStepIgnoredForType = "HTML3109",
|
|
66
|
+
HtmlInputAcceptIgnoredForType = "HTML3110",
|
|
67
|
+
HtmlInputCaptureIgnoredForType = "HTML3111",
|
|
68
|
+
A11yInputMissingAccessibleName = "A11Y8100",
|
|
69
|
+
A11yInputPlaceholderNotLabel = "A11Y8101",
|
|
70
|
+
A11yInputPasswordAutocomplete = "A11Y8102",
|
|
71
|
+
A11yInputRequiredReadOnlyConflict = "A11Y8103",
|
|
56
72
|
InvalidRenderingTarget = "RENDER4001",
|
|
57
73
|
LintDeadCompoundKey = "LINT5001",
|
|
58
74
|
LintDeadCompoundValue = "LINT5002",
|