@sinclair/typebox
Advanced tools
Comparing version 0.8.0 to 0.8.1
{ | ||
"name": "@sinclair/typebox", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"description": "JSONSchema Type Builder with Static Type Resolution for TypeScript", | ||
@@ -16,3 +16,3 @@ "author": "sinclairzx81", | ||
"build": "smoke-task build", | ||
"test": "npm run spec" | ||
"test": "smoke-task spec" | ||
}, | ||
@@ -19,0 +19,0 @@ "devDependencies": { |
@@ -191,2 +191,7 @@ <div align='center'> | ||
</tr> | ||
<tr> | ||
<td>Guid</td> | ||
<td><code>const T = Type.Guid()</code></td> | ||
<td><code>type T = string</code></td> | ||
</tr> | ||
</tbody> | ||
@@ -283,2 +288,7 @@ </table> | ||
</tr> | ||
<tr> | ||
<td>Guid</td> | ||
<td><code>const T = Type.Guid()</code></td> | ||
<td><code>{ type: 'string', format: '<guid-regex>' }</code></td> | ||
</tr> | ||
</tbody> | ||
@@ -285,0 +295,0 @@ </table> |
@@ -362,3 +362,5 @@ interface TFunction8<T0 extends TSchema, T1 extends TSchema, T2 extends TSchema, T3 extends TSchema, T4 extends TSchema, T5 extends TSchema, T6 extends TSchema, T7 extends TSchema, U extends TSchema> { | ||
static Range(minimum: number, maximum: number): TRange; | ||
/** Creates a Pattern type to validate UUID-4. */ | ||
static Guid(): TPattern; | ||
} | ||
export {}; |
@@ -145,3 +145,9 @@ "use strict"; | ||
} | ||
// #endregion | ||
// #region Experimental | ||
/** Creates a Pattern type to validate UUID-4. */ | ||
static Guid() { | ||
return this.Pattern(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/); | ||
} | ||
} | ||
exports.Type = Type; |
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
50234
530
467