@feathersjs/typebox
Advanced tools
Comparing version 5.0.9 to 5.0.10
@@ -6,2 +6,8 @@ # Change Log | ||
## [5.0.10](https://github.com/feathersjs/feathers/compare/v5.0.9...v5.0.10) (2023-10-03) | ||
### Bug Fixes | ||
- **typebox:** Allow default value in StringEnum ([#3281](https://github.com/feathersjs/feathers/issues/3281)) ([25af09a](https://github.com/feathersjs/feathers/commit/25af09ad065e72768bf88bc8b529b68f2ca4da17)) | ||
## [5.0.9](https://github.com/feathersjs/feathers/compare/v5.0.8...v5.0.9) (2023-09-27) | ||
@@ -8,0 +14,0 @@ |
@@ -34,3 +34,5 @@ import { TObject, TInteger, TOptional, TSchema, ObjectOptions, TIntersect, TUnion } from '@sinclair/typebox'; | ||
*/ | ||
export declare function StringEnum<T extends string[]>(allowedValues: [...T]): import("@sinclair/typebox").TUnsafe<T[number]>; | ||
export declare function StringEnum<T extends string[]>(allowedValues: [...T], options?: { | ||
default: T[number]; | ||
}): import("@sinclair/typebox").TUnsafe<T[number]>; | ||
/** | ||
@@ -37,0 +39,0 @@ * Creates the `$sort` Feathers query syntax schema for an object schema |
@@ -48,4 +48,4 @@ "use strict"; | ||
*/ | ||
function StringEnum(allowedValues) { | ||
return typebox_1.Type.Unsafe({ type: 'string', enum: allowedValues }); | ||
function StringEnum(allowedValues, options) { | ||
return typebox_1.Type.Unsafe({ type: 'string', enum: allowedValues, ...options }); | ||
} | ||
@@ -52,0 +52,0 @@ exports.StringEnum = StringEnum; |
{ | ||
"name": "@feathersjs/typebox", | ||
"description": "TypeBox integration for @feathersjs/schema", | ||
"version": "5.0.9", | ||
"version": "5.0.10", | ||
"homepage": "https://feathersjs.com", | ||
@@ -57,8 +57,8 @@ "main": "lib/", | ||
"dependencies": { | ||
"@feathersjs/schema": "^5.0.9", | ||
"@feathersjs/schema": "^5.0.10", | ||
"@sinclair/typebox": "^0.25.0" | ||
}, | ||
"devDependencies": { | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "^20.7.0", | ||
"@types/mocha": "^10.0.2", | ||
"@types/node": "^20.8.2", | ||
"mocha": "^10.2.0", | ||
@@ -68,3 +68,3 @@ "shx": "^0.3.4", | ||
}, | ||
"gitHead": "64ee98dadf02dac34f31e3cb7b6b10e1f7405bfa" | ||
"gitHead": "463dedcd35b16e43bc55e04df877ca82ed38dcea" | ||
} |
@@ -52,4 +52,4 @@ import { | ||
*/ | ||
export function StringEnum<T extends string[]>(allowedValues: [...T]) { | ||
return Type.Unsafe<T[number]>({ type: 'string', enum: allowedValues }) | ||
export function StringEnum<T extends string[]>(allowedValues: [...T], options?: { default: T[number] }) { | ||
return Type.Unsafe<T[number]>({ type: 'string', enum: allowedValues, ...options }) | ||
} | ||
@@ -56,0 +56,0 @@ |
Sorry, the diff of this file is not supported yet
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
54946
778
Updated@feathersjs/schema@^5.0.10