@tstdl/base 0.91.34 → 0.91.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.91.34",
3
+ "version": "0.91.35",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,12 +1,9 @@
1
- import type { JsonPath } from '../../json-path/json-path.js';
2
1
  import { type SchemaPropertyDecorator, type SchemaPropertyDecoratorOptions } from '../decorators/index.js';
3
- import type { SchemaTestOptions, SchemaTestResult } from '../schema.js';
4
2
  import { SimpleSchema, type SimpleSchemaOptions } from './simple.js';
5
3
  export type BooleanSchemaOptions = SimpleSchemaOptions;
6
4
  export declare class BooleanSchema extends SimpleSchema<boolean> {
7
5
  readonly name = "boolean";
8
6
  constructor(options?: BooleanSchemaOptions);
9
- _test(value: any, path: JsonPath, options: SchemaTestOptions): SchemaTestResult<boolean>;
10
7
  }
11
8
  export declare function boolean(options?: BooleanSchemaOptions): BooleanSchema;
12
9
  export declare function BooleanProperty(options?: BooleanSchemaOptions & SchemaPropertyDecoratorOptions): SchemaPropertyDecorator;
@@ -1,6 +1,4 @@
1
- import { SchemaError } from '../../schema/schema.error.js';
2
1
  import { isBoolean, isString } from '../../utils/type-guards.js';
3
- import { typeOf } from '../../utils/type-of.js';
4
2
  import { Property } from '../decorators/index.js';
5
3
  import { SimpleSchema } from './simple.js';
6
4
  export class BooleanSchema extends SimpleSchema {
@@ -30,12 +28,6 @@ export class BooleanSchema extends SimpleSchema {
30
28
  }
31
29
  });
32
30
  }
33
- _test(value, path, options) {
34
- if (isBoolean(value)) {
35
- return { valid: true, value };
36
- }
37
- return { valid: false, error: SchemaError.expectedButGot('boolean', typeOf(value), path, { fast: options.fastErrors }) };
38
- }
39
31
  }
40
32
  export function boolean(options) {
41
33
  return new BooleanSchema(options);