@dzeio/schema 0.3.0 → 0.3.1

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/dist/Schema.d.mts CHANGED
@@ -157,7 +157,7 @@ declare class SchemaArray<Type extends SchemaItem> extends SchemaItem<Array<Sche
157
157
  * split a string into an array
158
158
  * @param [separator] default:`,` the separator to use
159
159
  */
160
- split(separator?: string): void;
160
+ split(separator?: string): this;
161
161
  parse(input: unknown, options?: {
162
162
  fast?: boolean;
163
163
  }): ValidationResult<Array<SchemaInfer<Type>>>;
package/dist/Schema.d.ts CHANGED
@@ -157,7 +157,7 @@ declare class SchemaArray<Type extends SchemaItem> extends SchemaItem<Array<Sche
157
157
  * split a string into an array
158
158
  * @param [separator] default:`,` the separator to use
159
159
  */
160
- split(separator?: string): void;
160
+ split(separator?: string): this;
161
161
  parse(input: unknown, options?: {
162
162
  fast?: boolean;
163
163
  }): ValidationResult<Array<SchemaInfer<Type>>>;
package/dist/Schema.js CHANGED
@@ -224,12 +224,9 @@ var SchemaArray = class extends SchemaItem {
224
224
  this.postProcess.push((input) => input.filter((it, idx) => input.indexOf(it) === idx));
225
225
  return this;
226
226
  }
227
- /**
228
- * split a string into an array
229
- * @param [separator] default:`,` the separator to use
230
- */
231
227
  split(separator = ",") {
232
228
  this.addPreProcess((it) => typeof it === "string" ? it.split(separator) : it);
229
+ return this;
233
230
  }
234
231
  parse(input, options) {
235
232
  const { valid, object, errors = [] } = super.parse(input, options);
@@ -284,6 +281,9 @@ var SchemaArray = class extends SchemaItem {
284
281
  __decorateClass([
285
282
  parceable()
286
283
  ], SchemaArray.prototype, "unique", 1);
284
+ __decorateClass([
285
+ parceable()
286
+ ], SchemaArray.prototype, "split", 1);
287
287
 
288
288
  // src/items/boolean.ts
289
289
  var SchemaBoolean = class extends SchemaItem {
package/dist/Schema.mjs CHANGED
@@ -181,12 +181,9 @@ var SchemaArray = class extends SchemaItem {
181
181
  this.postProcess.push((input) => input.filter((it, idx) => input.indexOf(it) === idx));
182
182
  return this;
183
183
  }
184
- /**
185
- * split a string into an array
186
- * @param [separator] default:`,` the separator to use
187
- */
188
184
  split(separator = ",") {
189
185
  this.addPreProcess((it) => typeof it === "string" ? it.split(separator) : it);
186
+ return this;
190
187
  }
191
188
  parse(input, options) {
192
189
  const { valid, object, errors = [] } = super.parse(input, options);
@@ -241,6 +238,9 @@ var SchemaArray = class extends SchemaItem {
241
238
  __decorateClass([
242
239
  parceable()
243
240
  ], SchemaArray.prototype, "unique", 1);
241
+ __decorateClass([
242
+ parceable()
243
+ ], SchemaArray.prototype, "split", 1);
244
244
 
245
245
  // src/items/boolean.ts
246
246
  var SchemaBoolean = class extends SchemaItem {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dzeio/schema",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "dependencies": {
5
5
  "@dzeio/object-util": "^1.8.3"
6
6
  },