schemaglobin
Advanced tools
Comparing version 4.5.0 to 4.6.0
@@ -22,1 +22,4 @@ /** | ||
} | ||
/** Specific type of Invalid that is returned when a value is required. */ | ||
export declare class Required extends Invalid { | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Invalid = void 0; | ||
exports.Required = exports.Invalid = void 0; | ||
/** | ||
@@ -30,1 +30,5 @@ * Returned from `validate()` when a value is invalid. | ||
exports.Invalid = Invalid; | ||
/** Specific type of Invalid that is returned when a value is required. */ | ||
class Required extends Invalid { | ||
} | ||
exports.Required = Required; |
@@ -64,3 +64,3 @@ "use strict"; | ||
if (this.required) | ||
return new invalid_1.Invalid("Required"); | ||
return new invalid_1.Required("Required"); | ||
// Return empty array. | ||
@@ -67,0 +67,0 @@ // We know this assertion is okay because we know the array is empty. |
@@ -26,3 +26,3 @@ "use strict"; | ||
if (this.required && !value) | ||
return new invalid_1.Invalid("Required"); | ||
return new invalid_1.Required("Required"); | ||
// Return boolean. | ||
@@ -29,0 +29,0 @@ return value; |
@@ -50,3 +50,3 @@ "use strict"; | ||
if (this.required) | ||
return new invalid_1.Invalid("Required"); | ||
return new invalid_1.Required("Required"); | ||
// Return null. | ||
@@ -53,0 +53,0 @@ // We know this type assertion is sound because `null` can never be returned if `this.required == true`. |
@@ -47,3 +47,3 @@ "use strict"; | ||
if (this.required) | ||
return new invalid_1.Invalid("Required"); | ||
return new invalid_1.Required("Required"); | ||
// Return null. | ||
@@ -50,0 +50,0 @@ // We know this type assertion is sound because `null` can never be returned if `this.required == true`. |
@@ -35,3 +35,3 @@ "use strict"; | ||
if (this.required) | ||
return new invalid_1.Invalid("Required"); | ||
return new invalid_1.Required("Required"); | ||
// Return null. | ||
@@ -38,0 +38,0 @@ // We know this type assertion is sound because `null` can never be returned if `this.required == true`. |
@@ -53,3 +53,3 @@ "use strict"; | ||
if (this.required) | ||
return new invalid_1.Invalid("Required"); | ||
return new invalid_1.Required("Required"); | ||
// Return null. | ||
@@ -56,0 +56,0 @@ // We know this type assertion is sound because `null` can never be returned if `this.required == true`. |
@@ -43,3 +43,3 @@ "use strict"; | ||
if (this.required) | ||
return new invalid_1.Invalid("Required"); | ||
return new invalid_1.Required("Required"); | ||
// Return. | ||
@@ -46,0 +46,0 @@ // We know this type assertion is sound because `null` can never be returned if `this.required == true`. |
@@ -46,3 +46,3 @@ "use strict"; | ||
if (this.required) | ||
return new invalid_1.Invalid("Required"); | ||
return new invalid_1.Required("Required"); | ||
// Return empty object. | ||
@@ -49,0 +49,0 @@ // We know this type assertion is sound because we know value is empty. |
@@ -46,3 +46,3 @@ "use strict"; | ||
if (this.required) | ||
return new invalid_1.Invalid("Required"); | ||
return new invalid_1.Required("Required"); | ||
// Return null. | ||
@@ -49,0 +49,0 @@ // We know this type assertion is sound because `null` can never be returned if `this.required == true`. |
@@ -39,3 +39,3 @@ "use strict"; | ||
if (this.required) | ||
return new invalid_1.Invalid("Required"); | ||
return new invalid_1.Required("Required"); | ||
// Return. | ||
@@ -42,0 +42,0 @@ // We know this type assertion is sound because `null` can never be returned if `this.required == true`. |
@@ -55,3 +55,3 @@ "use strict"; | ||
if (this.required) | ||
return new invalid_1.Invalid("Required"); | ||
return new invalid_1.Required("Required"); | ||
// Return null. | ||
@@ -58,0 +58,0 @@ // We know this type assertion is sound because `null` can never be returned if `this.required == true`. |
@@ -64,3 +64,3 @@ "use strict"; | ||
if (this.required) | ||
return new invalid_1.Invalid("Required"); | ||
return new invalid_1.Required("Required"); | ||
// Return. | ||
@@ -67,0 +67,0 @@ return ""; |
@@ -44,3 +44,3 @@ "use strict"; | ||
if (this.required) | ||
return new invalid_1.Invalid("Required"); | ||
return new invalid_1.Required("Required"); | ||
// Return null. | ||
@@ -47,0 +47,0 @@ // We know this type assertion is sound because `null` can never be returned if `this.required == true`. |
{ | ||
"name": "schemaglobin", | ||
"description": "Validate user-entered data.", | ||
"version": "4.5.0", | ||
"version": "4.6.0", | ||
"repository": "https://github.com/dhoulb/schemaglobin", | ||
@@ -6,0 +6,0 @@ "author": "Dave Houlbrooke <dave@shax.com>", |
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
137463
2531