Skip to content

Commit

Permalink
fix: record missing field errors were not giving correct path, nodepa…
Browse files Browse the repository at this point in the history
…ck bumped to version without a bug
  • Loading branch information
ncpa0cpl committed Mar 8, 2023
1 parent ca4f167 commit a9f5e44
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"test:unit": "jest --coverage"
},
"devDependencies": {
"@ncpa0cpl/nodepack": "^2.1.0",
"@ncpa0cpl/nodepack": "^2.1.1",
"@swc/core": "^1.3.38",
"@swc/jest": "^0.2.24",
"@types/jest": "^29.4.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AnyDataType } from "@DataTypes/types";
import { concatPath } from "../../utilities/concat-object-path";
import type { Path } from "../path";
import { concatPath } from "@Utilities/concat-object-path";
import type { Path } from "@Validation/path";

const ValidationErrorSymbol = Symbol("ValidationError");

Expand Down
2 changes: 1 addition & 1 deletion src/validation-algorithms/validators/validate-record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const validateRecord = (path: Path, type: RecordOf, data: unknown) => {
if (descriptor.required !== true) {
continue;
} else {
throw new ValidationError(path, type, data);
throw new ValidationError(path.concat(key), type, undefined);
}
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -721,10 +721,10 @@
dependencies:
uuid "^9.0.0"

"@ncpa0cpl/nodepack@^2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@ncpa0cpl/nodepack/-/nodepack-2.1.0.tgz#f9f8dc6bd5a0fc82d7e43ab7fd62ef28cc2c0e06"
integrity sha512-4Z79MBBYbA7b6Hc6W3prSpMU3dsIbuo2Lu+5MpvKYk1ItlWI4ZTAgqhDvAfO3agdcz4k48fXs4+IEu1WhkJBYg==
"@ncpa0cpl/nodepack@^2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@ncpa0cpl/nodepack/-/nodepack-2.1.1.tgz#1e440219c64a1feaf78194f708ed103f31621a91"
integrity sha512-+RXKF4qa5HCwhuq5WK9FSV80JC68aTPijtekT737F3G/dsnG6Yp84z0UwmBG1pC9jwbnZNusRvvWPhRcyptzRQ==
dependencies:
"@ncpa0cpl/node-worker-bridge" "^0.0.3"
"@ts-morph/bootstrap" "^0.18.0"
Expand Down

0 comments on commit a9f5e44

Please sign in to comment.