@eslint-react/shared 5.24.3 → 5.24.4
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/index.js +14 -21
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2,7 +2,6 @@ import module from "node:module";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { P, match } from "ts-pattern";
|
|
4
4
|
import { z } from "zod/v4";
|
|
5
|
-
|
|
6
5
|
//#region ../../.pkgs/eff/dist/index.js
|
|
7
6
|
const pipeArguments = (self, args) => {
|
|
8
7
|
switch (args.length) {
|
|
@@ -26,7 +25,7 @@ const pipeArguments = (self, args) => {
|
|
|
26
25
|
const Prototype = { pipe() {
|
|
27
26
|
return pipeArguments(this, arguments);
|
|
28
27
|
} };
|
|
29
|
-
|
|
28
|
+
(function() {
|
|
30
29
|
function PipeableBase() {}
|
|
31
30
|
PipeableBase.prototype = Prototype;
|
|
32
31
|
return PipeableBase;
|
|
@@ -62,15 +61,12 @@ const dual = function(arity, body) {
|
|
|
62
61
|
const identity = (a) => a;
|
|
63
62
|
const cast = identity;
|
|
64
63
|
const constant = (value) => () => value;
|
|
65
|
-
const constTrue = constant(true);
|
|
66
64
|
const constFalse = constant(false);
|
|
67
|
-
|
|
68
|
-
const constUndefined = constant(void 0);
|
|
69
|
-
const compose = dual(2, (ab, bc) => (a) => bc(ab(a)));
|
|
65
|
+
dual(2, (ab, bc) => (a) => bc(ab(a)));
|
|
70
66
|
const absurd = (_) => {
|
|
71
67
|
throw new Error("Called `absurd` function which should be uncallable");
|
|
72
68
|
};
|
|
73
|
-
|
|
69
|
+
cast(absurd);
|
|
74
70
|
function memoize(f) {
|
|
75
71
|
const objects = /* @__PURE__ */ new WeakMap();
|
|
76
72
|
const primitives = /* @__PURE__ */ new Map();
|
|
@@ -79,41 +75,40 @@ function memoize(f) {
|
|
|
79
75
|
return getOrInsertComputed(primitives, a, () => f(a));
|
|
80
76
|
};
|
|
81
77
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
78
|
+
dual(2, (a, b) => (data) => a(data) && b(data));
|
|
79
|
+
dual(2, (a, b) => (data) => a(data) || b(data));
|
|
80
|
+
dual(2, (a, b) => (data) => a(data) !== b(data));
|
|
81
|
+
dual(2, (a, b) => (data) => a(data) === b(data));
|
|
82
|
+
dual(2, (antecedent, consequent) => (data) => !antecedent(data) || consequent(data));
|
|
83
|
+
dual(2, (a, b) => (data) => !a(data) && !b(data));
|
|
84
|
+
dual(2, (a, b) => (data) => !a(data) || !b(data));
|
|
89
85
|
function isFunction(input) {
|
|
90
86
|
return typeof input === "function";
|
|
91
87
|
}
|
|
92
88
|
function isObjectKeyword(input) {
|
|
93
89
|
return typeof input === "object" && input !== null || isFunction(input);
|
|
94
90
|
}
|
|
95
|
-
|
|
91
|
+
dual(2, (data, property) => isObjectKeyword(data) && property in data);
|
|
96
92
|
function getOrInsertComputed(map, key, callback) {
|
|
97
93
|
if (map.has(key)) return map.get(key);
|
|
98
94
|
const value = callback(key);
|
|
99
95
|
map.set(key, value);
|
|
100
96
|
return value;
|
|
101
97
|
}
|
|
102
|
-
|
|
98
|
+
dual(2, (self, predicate) => {
|
|
103
99
|
const input = Array.isArray(self) ? self : Array.from(self);
|
|
104
100
|
const len = input.length;
|
|
105
101
|
let idx = 0;
|
|
106
102
|
while (idx < len && predicate(input[idx], idx)) idx++;
|
|
107
103
|
return input.slice(idx);
|
|
108
104
|
});
|
|
109
|
-
|
|
105
|
+
dual(2, (self, predicate) => {
|
|
110
106
|
const input = Array.isArray(self) ? self : Array.from(self);
|
|
111
107
|
const len = input.length;
|
|
112
108
|
let idx = 0;
|
|
113
109
|
while (idx < len && predicate(input[idx], idx)) idx++;
|
|
114
110
|
return input.slice(0, idx);
|
|
115
111
|
});
|
|
116
|
-
|
|
117
112
|
//#endregion
|
|
118
113
|
//#region src/regexp.ts
|
|
119
114
|
const RE_HTML_TAG = /^[a-z][^-]*$/u;
|
|
@@ -143,7 +138,6 @@ function toRegExp(string) {
|
|
|
143
138
|
function isRegExp(string) {
|
|
144
139
|
return RE_REGEXP_STR.test(string);
|
|
145
140
|
}
|
|
146
|
-
|
|
147
141
|
//#endregion
|
|
148
142
|
//#region src/settings.ts
|
|
149
143
|
const ESLintReactSettingsSchema = z.object({
|
|
@@ -204,6 +198,5 @@ const getNormalizedSettings = memoize((settings) => normalizeSettings(decodeSett
|
|
|
204
198
|
function getSettingsFromContext(context) {
|
|
205
199
|
return getNormalizedSettings(context.settings["react-x"]);
|
|
206
200
|
}
|
|
207
|
-
|
|
208
201
|
//#endregion
|
|
209
|
-
export { DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettingsSchema, ESLintSettingsSchema, RE_ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME, RE_CAMEL_CASE, RE_COMPONENT_NAME, RE_COMPONENT_NAME_LOOSE, RE_CONSTANT_CASE, RE_HOOK_NAME, RE_HTML_TAG, RE_JAVASCRIPT_PROTOCOL, RE_JS_EXT, RE_JS_IDENTIFIER, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_REGEXP_STR, RE_SNAKE_CASE, RE_TS_EXT, decodeESLintSettings, decodeSettings, getNormalizedSettings, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, toRegExp };
|
|
202
|
+
export { DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettingsSchema, ESLintSettingsSchema, RE_ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME, RE_CAMEL_CASE, RE_COMPONENT_NAME, RE_COMPONENT_NAME_LOOSE, RE_CONSTANT_CASE, RE_HOOK_NAME, RE_HTML_TAG, RE_JAVASCRIPT_PROTOCOL, RE_JS_EXT, RE_JS_IDENTIFIER, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_REGEXP_STR, RE_SNAKE_CASE, RE_TS_EXT, decodeESLintSettings, decodeSettings, getNormalizedSettings, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, toRegExp };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/shared",
|
|
3
|
-
"version": "5.24.
|
|
3
|
+
"version": "5.24.4",
|
|
4
4
|
"description": "ESLint React's Shared constants and functions.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@eslint-react/eslint": "5.24.
|
|
32
|
+
"@eslint-react/eslint": "5.24.4",
|
|
33
33
|
"@typescript-eslint/utils": "^8.71.0",
|
|
34
34
|
"ts-pattern": "^5.9.0",
|
|
35
35
|
"zod": "^3.25.0 || ^4.0.0"
|