@eslint-react/shared 5.24.3 → 5.24.5

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.
Files changed (2) hide show
  1. package/dist/index.js +14 -21
  2. package/package.json +3 -3
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
- const Class = (function() {
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
- const constNull = constant(null);
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
- const hole = cast(absurd);
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
- const and = dual(2, (a, b) => (data) => a(data) && b(data));
83
- const or = dual(2, (a, b) => (data) => a(data) || b(data));
84
- const xor = dual(2, (a, b) => (data) => a(data) !== b(data));
85
- const eqv = dual(2, (a, b) => (data) => a(data) === b(data));
86
- const implies = dual(2, (antecedent, consequent) => (data) => !antecedent(data) || consequent(data));
87
- const nor = dual(2, (a, b) => (data) => !a(data) && !b(data));
88
- const nand = dual(2, (a, b) => (data) => !a(data) || !b(data));
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
- const hasProperty = dual(2, (data, property) => isObjectKeyword(data) && property in data);
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
- const dropWhile = dual(2, (self, predicate) => {
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
- const takeWhile = dual(2, (self, predicate) => {
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",
3
+ "version": "5.24.5",
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.3",
32
+ "@eslint-react/eslint": "5.24.5",
33
33
  "@typescript-eslint/utils": "^8.71.0",
34
34
  "ts-pattern": "^5.9.0",
35
35
  "zod": "^3.25.0 || ^4.0.0"
@@ -41,7 +41,7 @@
41
41
  "@types/node": "^26.6.4",
42
42
  "@types/picomatch": "^4.0.3",
43
43
  "eslint": "^10.12.0",
44
- "tinybench": "6.1.4",
44
+ "tinybench": "6.2.0",
45
45
  "tsdown": "^0.23.0",
46
46
  "typescript": "6.0.3"
47
47
  },