schemaglobin
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -54,3 +54,5 @@ import { Schema, SchemaOptions, NullIfOptional } from "../types"; | ||
optional: NumberSchema<number, false>; | ||
/** An number representing a valid Unix timestamp in milliseconds, e.g. as returned by `Date.now()` */ | ||
timestamp: NumberSchema<number, true>; | ||
}; | ||
export {}; |
@@ -123,2 +123,4 @@ "use strict"; | ||
optional: new NumberSchema({ required: false }), | ||
// Note: Timestamp is limited to four-digit years: 0000–9999 | ||
timestamp: new NumberSchema({ required: true, min: -62167219125000, max: 253370764800000 }), | ||
}); |
{ | ||
"name": "schemaglobin", | ||
"description": "Validate user-entered data.", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"repository": "https://github.com/dhoulb/schemaglobin", | ||
@@ -6,0 +6,0 @@ "author": "Dave Houlbrooke <dave@shax.com>", |
@@ -506,2 +506,3 @@ # Schemaglobin: Validate unknown user input against schemas | ||
number.optional.validate(null); | ||
number.timestamp.validate(Date.now()); | ||
phone.required.validate("+44123456789"); | ||
@@ -508,0 +509,0 @@ phone.optional.validate(null); |
@@ -159,2 +159,4 @@ import { Schema, SchemaOptions, NullIfOptional } from "../types"; | ||
optional: NumberSchema<number, false>; | ||
/** An number representing a valid Unix timestamp in milliseconds, e.g. as returned by `Date.now()` */ | ||
timestamp: NumberSchema<number, true>; | ||
} = Object.assign( | ||
@@ -166,3 +168,5 @@ <T extends number, R extends boolean = false>(options: NumberOptions<T, R> = {}): NumberSchema<T, R> => | ||
optional: new NumberSchema({ required: false }), | ||
// Note: Timestamp is limited to four-digit years: 0000–9999 | ||
timestamp: new NumberSchema({ required: true, min: -62167219125000, max: 253370764800000 }), | ||
}, | ||
); |
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
211720
4511
536