@serum-enterprises/schema 2.0.1-beta.1 → 2.0.1-beta.2

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/build/Schema.js CHANGED
@@ -135,7 +135,7 @@ class BooleanValidator extends Schema {
135
135
  this.#nullable = { flag: false };
136
136
  this.#equals = { flag: false, value: false };
137
137
  }
138
- nullable(flag) {
138
+ nullable(flag = true) {
139
139
  this.#nullable = { flag };
140
140
  return this;
141
141
  }
@@ -209,7 +209,7 @@ class NumberValidator extends Schema {
209
209
  this.#min = { flag: false, value: 0 };
210
210
  this.#max = { flag: false, value: 0 };
211
211
  }
212
- nullable(flag) {
212
+ nullable(flag = true) {
213
213
  this.#nullable = { flag };
214
214
  return this;
215
215
  }
@@ -300,7 +300,7 @@ class StringValidator extends Schema {
300
300
  this.#min = { flag: false, value: 0 };
301
301
  this.#max = { flag: false, value: 0 };
302
302
  }
303
- nullable(flag) {
303
+ nullable(flag = true) {
304
304
  this.#nullable = { flag };
305
305
  return this;
306
306
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serum-enterprises/schema",
3
- "version": "2.0.1-beta.1",
3
+ "version": "2.0.1-beta.2",
4
4
  "engines": {
5
5
  "node": ">=14.0.0"
6
6
  },
package/src/Schema.ts CHANGED
@@ -129,7 +129,7 @@ class BooleanValidator extends Schema {
129
129
  this.#equals = { flag: false, value: false };
130
130
  }
131
131
 
132
- nullable(flag: boolean): this {
132
+ nullable(flag: boolean = true): this {
133
133
  this.#nullable = { flag };
134
134
 
135
135
  return this;
@@ -230,7 +230,7 @@ class NumberValidator extends Schema {
230
230
  this.#max = { flag: false, value: 0 };
231
231
  }
232
232
 
233
- nullable(flag: boolean): this {
233
+ nullable(flag: boolean = true): this {
234
234
  this.#nullable = { flag };
235
235
 
236
236
  return this;
@@ -358,7 +358,7 @@ class StringValidator extends Schema {
358
358
  this.#max = { flag: false, value: 0 };
359
359
  }
360
360
 
361
- nullable(flag: boolean): this {
361
+ nullable(flag: boolean = true): this {
362
362
  this.#nullable = { flag };
363
363
 
364
364
  return this;
package/types/Schema.d.ts CHANGED
@@ -28,7 +28,7 @@ declare class BooleanValidator extends Schema {
28
28
  #private;
29
29
  static fromJSON(schema: JSON.JSON, path?: string): Result<BooleanValidator, SchemaError>;
30
30
  constructor();
31
- nullable(flag: boolean): this;
31
+ nullable(flag?: boolean): this;
32
32
  equals(value: boolean): this;
33
33
  validate(data: unknown, path?: string): Result<unknown, ValidationError>;
34
34
  toJSON(): JSON.Object;
@@ -37,7 +37,7 @@ declare class NumberValidator extends Schema {
37
37
  #private;
38
38
  static fromJSON(schema: JSON.JSON, path?: string): Result<NumberValidator, SchemaError>;
39
39
  constructor();
40
- nullable(flag: boolean): this;
40
+ nullable(flag?: boolean): this;
41
41
  equals(value: number): this;
42
42
  integer(flag?: boolean): this;
43
43
  min(value: number): this;
@@ -49,7 +49,7 @@ declare class StringValidator extends Schema {
49
49
  #private;
50
50
  static fromJSON(schema: JSON.JSON, path?: string): Result<StringValidator, SchemaError>;
51
51
  constructor();
52
- nullable(flag: boolean): this;
52
+ nullable(flag?: boolean): this;
53
53
  equals(value: string): this;
54
54
  min(value: number): this;
55
55
  max(value: number): this;