eslint-plugin-zod 3.0.0 → 3.0.1

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.
@@ -27,8 +27,8 @@ exports.preferEnumOverLiteralUnion = utils_1.ESLintUtils.RuleCreator(meta_js_1.g
27
27
  if ((zodSchema === null || zodSchema === void 0 ? void 0 : zodSchema.schemaType) !== 'union') {
28
28
  return;
29
29
  }
30
- const [unionArgument] = node.arguments;
31
- if (unionArgument.type !== utils_1.AST_NODE_TYPES.ArrayExpression) {
30
+ const unionArgument = node.arguments.at(0);
31
+ if ((unionArgument === null || unionArgument === void 0 ? void 0 : unionArgument.type) !== utils_1.AST_NODE_TYPES.ArrayExpression) {
32
32
  return;
33
33
  }
34
34
  const zodLiteralStrings = unionArgument.elements.map((s) => {
@@ -24,8 +24,8 @@ export const preferEnumOverLiteralUnion = ESLintUtils.RuleCreator(getRuleURL)({
24
24
  if ((zodSchema === null || zodSchema === void 0 ? void 0 : zodSchema.schemaType) !== 'union') {
25
25
  return;
26
26
  }
27
- const [unionArgument] = node.arguments;
28
- if (unionArgument.type !== AST_NODE_TYPES.ArrayExpression) {
27
+ const unionArgument = node.arguments.at(0);
28
+ if ((unionArgument === null || unionArgument === void 0 ? void 0 : unionArgument.type) !== AST_NODE_TYPES.ArrayExpression) {
29
29
  return;
30
30
  }
31
31
  const zodLiteralStrings = unionArgument.elements.map((s) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-zod",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "type": "module",
5
5
  "description": "ESLint plugin that adds custom linting rules to enforce best practices when using Zod",
6
6
  "engines": {