simpl-schema
Advanced tools
Comparing version 3.4.0 to 3.4.1
@@ -13,2 +13,3 @@ "use strict"; | ||
if (typeof Set === 'function' && allowedValues instanceof Set) { | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion | ||
isAllowed = allowedValues.has(this.value); | ||
@@ -15,0 +16,0 @@ } |
@@ -11,4 +11,4 @@ import MongoObject from 'mongo-object'; | ||
} | ||
export declare type AllowedValues = any[] | Set<any>; | ||
export declare type ValueOrFunctionThatReturnsValue<T> = T | (() => T); | ||
export type AllowedValues = any[] | Set<any>; | ||
export type ValueOrFunctionThatReturnsValue<T> = T | (() => T); | ||
export interface AutoValueFunction { | ||
@@ -23,4 +23,4 @@ (this: AutoValueContext, obj: any): any; | ||
} | ||
export declare type CustomAutoValueContext = Record<string, unknown>; | ||
export declare type CustomValidatorContext = Record<string, unknown>; | ||
export type CustomAutoValueContext = Record<string, unknown>; | ||
export type CustomValidatorContext = Record<string, unknown>; | ||
export interface CleanOptions { | ||
@@ -90,3 +90,3 @@ /** | ||
} | ||
export declare type GetErrorMessageFn = (error: ValidationError, label: string | null) => string | undefined; | ||
export type GetErrorMessageFn = (error: ValidationError, label: string | null) => string | undefined; | ||
export interface SimpleSchemaOptions { | ||
@@ -134,11 +134,11 @@ clean?: CleanOptions; | ||
} | ||
export declare type SchemaKeyDefinition = StandardSchemaKeyDefinition | SchemaKeyDefinitionWithOneType; | ||
export declare type SchemaKeyDefinitionWithShorthand = StandardSchemaKeyDefinition | SchemaKeyDefinitionWithOneType | SupportedTypes | RegExpConstructor | SimpleSchemaGroup | SupportedTypes[]; | ||
export declare type PartialSchemaKeyDefinitionWithShorthand = StandardSchemaKeyDefinition | Partial<SchemaKeyDefinitionWithOneType> | SupportedTypes | RegExpConstructor | SimpleSchemaGroup | SupportedTypes[]; | ||
export declare type SchemaDefinition = Record<string, SchemaKeyDefinition>; | ||
export declare type SchemaDefinitionWithShorthand = Record<string, SchemaKeyDefinitionWithShorthand>; | ||
export declare type PartialSchemaDefinitionWithShorthand = Record<string, PartialSchemaKeyDefinitionWithShorthand>; | ||
export declare type ResolvedSchemaDefinition = Record<string, StandardSchemaKeyDefinition>; | ||
export declare type AnyClass = new (...args: any[]) => any; | ||
export declare type SupportedTypes = ArrayConstructor | BooleanConstructor | DateConstructor | NumberConstructor | StringConstructor | ObjectConstructor | '___Any___' | typeof SimpleSchema.Integer | SimpleSchema | AnyClass | RegExp; | ||
export type SchemaKeyDefinition = StandardSchemaKeyDefinition | SchemaKeyDefinitionWithOneType; | ||
export type SchemaKeyDefinitionWithShorthand = StandardSchemaKeyDefinition | SchemaKeyDefinitionWithOneType | SupportedTypes | RegExpConstructor | SimpleSchemaGroup | SupportedTypes[]; | ||
export type PartialSchemaKeyDefinitionWithShorthand = StandardSchemaKeyDefinition | Partial<SchemaKeyDefinitionWithOneType> | SupportedTypes | RegExpConstructor | SimpleSchemaGroup | SupportedTypes[]; | ||
export type SchemaDefinition = Record<string, SchemaKeyDefinition>; | ||
export type SchemaDefinitionWithShorthand = Record<string, SchemaKeyDefinitionWithShorthand>; | ||
export type PartialSchemaDefinitionWithShorthand = Record<string, PartialSchemaKeyDefinitionWithShorthand>; | ||
export type ResolvedSchemaDefinition = Record<string, StandardSchemaKeyDefinition>; | ||
export type AnyClass = new (...args: any[]) => any; | ||
export type SupportedTypes = ArrayConstructor | BooleanConstructor | DateConstructor | NumberConstructor | StringConstructor | ObjectConstructor | '___Any___' | typeof SimpleSchema.Integer | SimpleSchema | AnyClass | RegExp; | ||
export interface ValidationError { | ||
@@ -213,5 +213,5 @@ message?: string; | ||
} | ||
export declare type FunctionPropContext = Omit<ValidatorContext, 'addValidationErrors' | 'valueShouldBeChecked'>; | ||
export declare type DocValidatorFunction = (this: DocValidatorContext, obj: Record<string, unknown>) => ValidationError[]; | ||
export declare type ValidatorFunction = (this: ValidatorContext) => void | undefined | boolean | string | ValidationErrorResult; | ||
export declare type ObjectToValidate = Record<string | number | symbol, unknown> | AnyClass; | ||
export type FunctionPropContext = Omit<ValidatorContext, 'addValidationErrors' | 'valueShouldBeChecked'>; | ||
export type DocValidatorFunction = (this: DocValidatorContext, obj: Record<string, unknown>) => ValidationError[]; | ||
export type ValidatorFunction = (this: ValidatorContext) => void | undefined | boolean | string | ValidationErrorResult; | ||
export type ObjectToValidate = Record<string | number | symbol, unknown> | AnyClass; |
@@ -11,2 +11,3 @@ import { SimpleSchema } from '../SimpleSchema.js'; | ||
if (typeof Set === 'function' && allowedValues instanceof Set) { | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion | ||
isAllowed = allowedValues.has(this.value); | ||
@@ -13,0 +14,0 @@ } |
{ | ||
"name": "simpl-schema", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"description": "A schema validation package that supports direct validation of MongoDB update modifier objects.", | ||
@@ -42,3 +42,4 @@ "author": "Eric Dobbertin <eric@dairystatedesigns.com>", | ||
"prepublishOnly": "npm run build", | ||
"test": "mocha" | ||
"test": "mocha", | ||
"test:watch": "npm test -- --watch" | ||
}, | ||
@@ -48,5 +49,5 @@ "devDependencies": { | ||
"@types/json-schema": "^7.0.11", | ||
"@types/mocha": "^9.1.1", | ||
"@typescript-eslint/eslint-plugin": "^5.30.7", | ||
"@typescript-eslint/parser": "^5.30.7", | ||
"@types/mocha": "^10.0.1", | ||
"@typescript-eslint/eslint-plugin": "^5.48.0", | ||
"@typescript-eslint/parser": "^5.48.0", | ||
"eslint": "^8.20.0", | ||
@@ -60,12 +61,12 @@ "eslint-config-standard-with-typescript": "^22.0.0", | ||
"eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0", | ||
"expect": "^29.0.3", | ||
"mocha": "^10.0.0", | ||
"expect": "^29.3.1", | ||
"mocha": "^10.2.0", | ||
"semantic-release": "^19.0.5", | ||
"ts-node": "^10.9.1", | ||
"ts-standard": "^11.0.0", | ||
"typescript": "^4.7.4" | ||
"typescript": "^4.9.4" | ||
}, | ||
"dependencies": { | ||
"clone": "^2.1.2", | ||
"mongo-object": "^3.0.0" | ||
"mongo-object": "^3.0.1" | ||
}, | ||
@@ -72,0 +73,0 @@ "release": { |
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
333933
6428
Updatedmongo-object@^3.0.1