diff --git a/package-lock.json b/package-lock.json index bbeee338..c56c39ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,7 @@ "semantic-release": "19.0.5", "ts-jest": "28.0.8", "ts-node": "10.9.1", - "typescript": "4.7.4" + "typescript": "4.8.2" } }, "node_modules/@ampproject/remapping": { @@ -14387,9 +14387,9 @@ } }, "node_modules/typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz", + "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -25201,9 +25201,9 @@ "dev": true }, "typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz", + "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index c72b90e7..156db210 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "semantic-release": "19.0.5", "ts-jest": "28.0.8", "ts-node": "10.9.1", - "typescript": "4.7.4" + "typescript": "4.8.2" }, "jest": { "preset": "ts-jest", diff --git a/src/valueRules/enum/enum.ts b/src/valueRules/enum/enum.ts index 8a1aae26..688a0576 100644 --- a/src/valueRules/enum/enum.ts +++ b/src/valueRules/enum/enum.ts @@ -8,17 +8,20 @@ export class InvalidEnumError extends BaseError { type Values = T[keyof T] -export function isEnum(enumerator: Output, input: unknown): input is Values { +export function isEnum( + enumerator: Output, + input: unknown +): input is Values { const enumValues = Object.values(enumerator) return enumValues.includes(input) } -export function enumerated(enumerator: Output) { +export function enumerated(enumerator: Output) { return (input: unknown) => { if (isEnum(enumerator, input)) { return input as Values } const enumValues = Object.values(enumerator) - throw new InvalidEnumError>(enumValues) + throw new InvalidEnumError(enumValues) } }