Socket
Socket
Sign inDemoInstall

@sinclair/typebox

Package Overview
Dependencies
Maintainers
1
Versions
324
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sinclair/typebox - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

4

package.json
{
"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;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc