@eslint-react/shared
Advanced tools
Comparing version 1.17.1-next.0 to 1.17.1-next.2
@@ -218,2 +218,4 @@ 'use strict'; | ||
var createRuleForPlugin = (pluginName) => utils.ESLintUtils.RuleCreator(getDocsUrl(pluginName)); | ||
// ../../node_modules/.pnpm/valibot@1.0.0-beta.8_typescript@5.6.3/node_modules/valibot/dist/index.js | ||
var store; | ||
@@ -288,2 +290,11 @@ function getGlobalConfig(config2) { | ||
} | ||
function _getStandardProps(context) { | ||
return { | ||
version: 1, | ||
vendor: "valibot", | ||
validate(value2) { | ||
return context["~run"]({ value: value2 }, getGlobalConfig()); | ||
} | ||
}; | ||
} | ||
var ValiError = class extends Error { | ||
@@ -323,3 +334,6 @@ /** | ||
message, | ||
_run(dataset, config2) { | ||
get "~standard"() { | ||
return _getStandardProps(this); | ||
}, | ||
"~run"(dataset, config2) { | ||
const input = dataset.value; | ||
@@ -331,3 +345,3 @@ if (Array.isArray(input)) { | ||
const value2 = input[key]; | ||
const itemDataset = this.item._run({ typed: false, value: value2 }, config2); | ||
const itemDataset = this.item["~run"]({ value: value2 }, config2); | ||
if (itemDataset.issues) { | ||
@@ -377,3 +391,6 @@ const pathItem = { | ||
message, | ||
_run(dataset, config2) { | ||
get "~standard"() { | ||
return _getStandardProps(this); | ||
}, | ||
"~run"(dataset, config2) { | ||
if (typeof dataset.value === "boolean") { | ||
@@ -397,3 +414,6 @@ dataset.typed = true; | ||
message, | ||
_run(dataset, config2) { | ||
get "~standard"() { | ||
return _getStandardProps(this); | ||
}, | ||
"~run"(dataset, config2) { | ||
if (dataset.value instanceof this.class) { | ||
@@ -417,3 +437,6 @@ dataset.typed = true; | ||
message, | ||
_run(dataset, config2) { | ||
get "~standard"() { | ||
return _getStandardProps(this); | ||
}, | ||
"~run"(dataset, config2) { | ||
const input = dataset.value; | ||
@@ -425,6 +448,3 @@ if (input && typeof input === "object") { | ||
const value2 = input[key]; | ||
const valueDataset = this.entries[key]._run( | ||
{ typed: false, value: value2 }, | ||
config2 | ||
); | ||
const valueDataset = this.entries[key]["~run"]({ value: value2 }, config2); | ||
if (valueDataset.issues) { | ||
@@ -468,4 +488,4 @@ const pathItem = { | ||
} | ||
function optional(wrapped, ...args) { | ||
const schema = { | ||
function optional(wrapped, default_) { | ||
return { | ||
kind: "schema", | ||
@@ -477,10 +497,10 @@ type: "optional", | ||
wrapped, | ||
_run(dataset, config2) { | ||
default: default_, | ||
get "~standard"() { | ||
return _getStandardProps(this); | ||
}, | ||
"~run"(dataset, config2) { | ||
if (dataset.value === void 0) { | ||
if ("default" in this) { | ||
dataset.value = getDefault( | ||
this, | ||
dataset, | ||
config2 | ||
); | ||
if (this.default !== void 0) { | ||
dataset.value = getDefault(this, dataset, config2); | ||
} | ||
@@ -492,9 +512,5 @@ if (dataset.value === void 0) { | ||
} | ||
return this.wrapped._run(dataset, config2); | ||
return this.wrapped["~run"](dataset, config2); | ||
} | ||
}; | ||
if (0 in args) { | ||
schema.default = args[0]; | ||
} | ||
return schema; | ||
} | ||
@@ -509,3 +525,6 @@ function string(message) { | ||
message, | ||
_run(dataset, config2) { | ||
get "~standard"() { | ||
return _getStandardProps(this); | ||
}, | ||
"~run"(dataset, config2) { | ||
if (typeof dataset.value === "string") { | ||
@@ -521,6 +540,3 @@ dataset.typed = true; | ||
function parse(schema, input, config2) { | ||
const dataset = schema._run( | ||
{ typed: false, value: input }, | ||
getGlobalConfig(config2) | ||
); | ||
const dataset = schema["~run"]({ value: input }, getGlobalConfig(config2)); | ||
if (dataset.issues) { | ||
@@ -527,0 +543,0 @@ throw new ValiError(dataset.issues); |
{ | ||
"name": "@eslint-react/shared", | ||
"version": "1.17.1-next.0", | ||
"version": "1.17.1-next.2", | ||
"description": "ESLint React's Shared constants and functions.", | ||
@@ -42,3 +42,3 @@ "homepage": "https://github.com/rel1cx/eslint-react", | ||
"ts-pattern": "^5.5.0", | ||
"@eslint-react/tools": "1.17.1-next.0" | ||
"@eslint-react/tools": "1.17.1-next.2" | ||
}, | ||
@@ -51,3 +51,3 @@ "devDependencies": { | ||
"type-fest": "^4.27.0", | ||
"valibot": "^1.0.0-beta.7" | ||
"valibot": "^1.0.0-beta.8" | ||
}, | ||
@@ -54,0 +54,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
239023
4929
+ Added@eslint-react/tools@1.17.1-next.2(transitive)
- Removed@eslint-react/tools@1.17.1-next.0(transitive)