@nhtio/validation 0.1.0-master-cb87a6f9 → 0.1.0-master-fe5983b7

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/index.mjs CHANGED
@@ -3768,16 +3768,65 @@ var require_extend$1 = __commonJSMin((exports) => {
3768
3768
  };
3769
3769
  };
3770
3770
  });
3771
+ var import_applyToDefaults, import_assert, import_bench, import_block, import_clone, import_contain, import_deepEqual, import_assertError, import_escapeHeaderAttribute, import_escapeHtml, import_escapeJson, import_escapeRegex, import_flatten, import_ignore, import_intersect, import_isPromise, import_merge, import_once, import_reach, import_reachTemplate, import_stringify, import_wait;
3772
+ var init_lib = __esmMin(() => {
3773
+ import_applyToDefaults = __toESM(require_applyToDefaults(), 1);
3774
+ import_assert = __toESM(require_assert$1(), 1);
3775
+ import_bench = __toESM(require_bench(), 1);
3776
+ import_block = __toESM(require_block(), 1);
3777
+ import_clone = __toESM(require_clone$1(), 1);
3778
+ import_contain = __toESM(require_contain(), 1);
3779
+ import_deepEqual = __toESM(require_deepEqual(), 1);
3780
+ import_assertError = __toESM(require_assertError(), 1);
3781
+ import_escapeHeaderAttribute = __toESM(require_escapeHeaderAttribute(), 1);
3782
+ import_escapeHtml = __toESM(require_escapeHtml(), 1);
3783
+ import_escapeJson = __toESM(require_escapeJson(), 1);
3784
+ import_escapeRegex = __toESM(require_escapeRegex(), 1);
3785
+ import_flatten = __toESM(require_flatten$1(), 1);
3786
+ import_ignore = __toESM(require_ignore(), 1);
3787
+ import_intersect = __toESM(require_intersect(), 1);
3788
+ import_isPromise = __toESM(require_isPromise(), 1);
3789
+ import_merge = __toESM(require_merge(), 1);
3790
+ import_once = __toESM(require_once(), 1);
3791
+ import_reach = __toESM(require_reach(), 1);
3792
+ import_reachTemplate = __toESM(require_reachTemplate(), 1);
3793
+ import_stringify = __toESM(require_stringify(), 1);
3794
+ import_wait = __toESM(require_wait(), 1);
3795
+ });
3771
3796
  var require_manifest = __commonJSMin((exports) => {
3772
3797
  init_dist$1();
3773
- const { assert: assert$46, clone: clone$14 } = require_lib$4();
3774
- const Common$19 = require_common$3();
3775
- const Messages$5 = require_messages();
3776
- const Ref$9 = require_ref$2();
3777
- const Template$5 = require_template();
3798
+ var import_schemas$1 = __toESM(require_schemas());
3799
+ var import_template$2 = __toESM(require_template());
3800
+ var import_ref$2 = __toESM(require_ref$2());
3801
+ var import_messages$2 = __toESM(require_messages());
3802
+ var import_common$2 = __toESM(require_common$3());
3803
+ init_lib();
3804
+ const Common$19 = import_common$2.default;
3805
+ const Messages$5 = import_messages$2.default;
3806
+ const Ref$9 = import_ref$2.default;
3807
+ const Template$5 = import_template$2.default;
3808
+ const ManifestDescriptionCache = new WeakMap();
3809
+ var ManifestItemCacheClass = class {
3810
+ #items = new WeakMap();
3811
+ get(item, options = {}) {
3812
+ const cached = this.#items.get(item);
3813
+ if (cached) return cached.get(options);
3814
+ }
3815
+ set(item, options = {}, value) {
3816
+ if (!this.#items.has(item)) this.#items.set(item, new WeakMap());
3817
+ this.#items.get(item).set(options, value);
3818
+ }
3819
+ setAndReturn(item, options = {}, value) {
3820
+ this.set(item, options, value);
3821
+ return value;
3822
+ }
3823
+ };
3824
+ const ManifestItemCache = new ManifestItemCacheClass();
3778
3825
  let Schemas$3;
3779
3826
  const internals$20 = {};
3780
3827
  exports.describe = function(schema$2) {
3828
+ const cached = ManifestDescriptionCache.get(schema$2);
3829
+ if (cached) return cached;
3781
3830
  const def = schema$2._definition;
3782
3831
  const desc$1 = {
3783
3832
  type: schema$2.type,
@@ -3787,7 +3836,7 @@ var require_manifest = __commonJSMin((exports) => {
3787
3836
  for (const flag in schema$2._flags) if (flag[0] !== "_") desc$1.flags[flag] = internals$20.describe(schema$2._flags[flag]);
3788
3837
  if (!Object.keys(desc$1.flags).length) delete desc$1.flags;
3789
3838
  if (schema$2._preferences) {
3790
- desc$1.preferences = clone$14(schema$2._preferences, { shallow: ["messages"] });
3839
+ desc$1.preferences = (0, import_clone.default)(schema$2._preferences, { shallow: ["messages"] });
3791
3840
  delete desc$1.preferences[Common$19.symbols.prefs];
3792
3841
  if (desc$1.preferences.messages) desc$1.preferences.messages = Messages$5.decompile(desc$1.preferences.messages);
3793
3842
  }
@@ -3812,7 +3861,7 @@ var require_manifest = __commonJSMin((exports) => {
3812
3861
  if (!desc$1.rules.length) delete desc$1.rules;
3813
3862
  for (const term in schema$2.$_terms) {
3814
3863
  if (term[0] === "_") continue;
3815
- assert$46(!desc$1[term], "Cannot describe schema due to internal name conflict with", term);
3864
+ (0, import_assert.default)(!desc$1[term], "Cannot describe schema due to internal name conflict with", term);
3816
3865
  const items = schema$2.$_terms[term];
3817
3866
  if (!items) continue;
3818
3867
  if (items instanceof Map) {
@@ -3823,7 +3872,7 @@ var require_manifest = __commonJSMin((exports) => {
3823
3872
  desc$1[term] = items.describe();
3824
3873
  continue;
3825
3874
  }
3826
- assert$46(def.terms[term], "Term", term, "missing configuration");
3875
+ (0, import_assert.default)(def.terms[term], "Term", term, "missing configuration");
3827
3876
  const manifest = def.terms[term].manifest;
3828
3877
  const mapped = typeof manifest === "object";
3829
3878
  if (!items.length && !mapped) continue;
@@ -3836,31 +3885,34 @@ var require_manifest = __commonJSMin((exports) => {
3836
3885
  continue;
3837
3886
  }
3838
3887
  if (manifest === "single") {
3839
- assert$46(normalized.length === 1, "Term", term, "contains more than one item");
3888
+ (0, import_assert.default)(normalized.length === 1, "Term", term, "contains more than one item");
3840
3889
  desc$1[term] = normalized[0];
3841
3890
  continue;
3842
3891
  }
3843
3892
  desc$1[term] = normalized;
3844
3893
  }
3845
3894
  internals$20.validate(schema$2.$_root, desc$1);
3895
+ ManifestDescriptionCache.set(schema$2, desc$1);
3846
3896
  return desc$1;
3847
3897
  };
3848
3898
  internals$20.describe = function(item, options = {}) {
3849
- if (Array.isArray(item)) return item.map(internals$20.describe);
3850
- if (item === Common$19.symbols.deepDefault) return { special: "deep" };
3851
- if (typeof item !== "object" || item === null) return item;
3852
- if (options.assign === "options") return clone$14(item);
3853
- if (Buffer$1 && Buffer$1.isBuffer(item)) return { buffer: item.toString("binary") };
3854
- if (item instanceof Date) return item.toISOString();
3855
- if (item instanceof Error) return item;
3899
+ const cached = ManifestItemCache.get(item, options);
3900
+ if (cached) return cached;
3901
+ if (Array.isArray(item)) return ManifestItemCache.setAndReturn(item, options, item.map(internals$20.describe));
3902
+ if (item === Common$19.symbols.deepDefault) return ManifestItemCache.setAndReturn(item, options, { special: "deep" });
3903
+ if (typeof item !== "object" || item === null) return ManifestItemCache.setAndReturn(item, options, item);
3904
+ if (options.assign === "options") return ManifestItemCache.setAndReturn(item, options, (0, import_clone.default)(item));
3905
+ if (Buffer$1 && Buffer$1.isBuffer(item)) return ManifestItemCache.setAndReturn(item, options, { buffer: item.toString("binary") });
3906
+ if (item instanceof Date) return ManifestItemCache.setAndReturn(item, options, item.toISOString());
3907
+ if (item instanceof Error) return ManifestItemCache.setAndReturn(item, options, item);
3856
3908
  if (item instanceof RegExp) {
3857
- if (options.assign === "regex") return item.toString();
3858
- return { regex: item.toString() };
3909
+ if (options.assign === "regex") return ManifestItemCache.setAndReturn(item, options, item.toString());
3910
+ return ManifestItemCache.setAndReturn(item, options, { regex: item.toString() });
3859
3911
  }
3860
- if (item[Common$19.symbols.literal]) return { function: item.literal };
3912
+ if (item[Common$19.symbols.literal]) return ManifestItemCache.setAndReturn(item, options, { function: item.literal });
3861
3913
  if (typeof item.describe === "function") {
3862
- if (options.assign === "ref") return item.describe().ref;
3863
- return item.describe();
3914
+ if (options.assign === "ref") return ManifestItemCache.setAndReturn(item, options, item.describe().ref);
3915
+ return ManifestItemCache.setAndReturn(item, options, item.describe());
3864
3916
  }
3865
3917
  const normalized = {};
3866
3918
  for (const key in item) {
@@ -3868,7 +3920,7 @@ var require_manifest = __commonJSMin((exports) => {
3868
3920
  if (value === void 0) continue;
3869
3921
  normalized[key] = internals$20.describe(value, { assign: key });
3870
3922
  }
3871
- return normalized;
3923
+ return ManifestItemCache.setAndReturn(item, options, normalized);
3872
3924
  };
3873
3925
  exports.build = function(joi, desc$1) {
3874
3926
  const builder = new internals$20.Builder(joi);
@@ -3884,14 +3936,14 @@ var require_manifest = __commonJSMin((exports) => {
3884
3936
  const def = schema$2._definition;
3885
3937
  if (desc$1.flags) for (const flag in desc$1.flags) {
3886
3938
  const setter = def.flags[flag] && def.flags[flag].setter || flag;
3887
- assert$46(typeof schema$2[setter] === "function", "Invalid flag", flag, "for type", desc$1.type);
3939
+ (0, import_assert.default)(typeof schema$2[setter] === "function", "Invalid flag", flag, "for type", desc$1.type);
3888
3940
  schema$2 = schema$2[setter](this.build(desc$1.flags[flag]));
3889
3941
  }
3890
3942
  if (desc$1.preferences) schema$2 = schema$2.preferences(this.build(desc$1.preferences));
3891
3943
  if (desc$1.allow) schema$2 = schema$2.allow(...this.build(desc$1.allow));
3892
3944
  if (desc$1.invalid) schema$2 = schema$2.invalid(...this.build(desc$1.invalid));
3893
3945
  if (desc$1.rules) for (const rule of desc$1.rules) {
3894
- assert$46(typeof schema$2[rule.name] === "function", "Invalid rule", rule.name, "for type", desc$1.type);
3946
+ (0, import_assert.default)(typeof schema$2[rule.name] === "function", "Invalid rule", rule.name, "for type", desc$1.type);
3895
3947
  const args$1 = [];
3896
3948
  if (rule.args) {
3897
3949
  const built = {};
@@ -3899,10 +3951,10 @@ var require_manifest = __commonJSMin((exports) => {
3899
3951
  const keys$10 = Object.keys(built);
3900
3952
  const definition = def.rules[rule.name].args;
3901
3953
  if (definition) {
3902
- assert$46(keys$10.length <= definition.length, "Invalid number of arguments for", desc$1.type, rule.name, "(expected up to", definition.length, ", found", keys$10.length, ")");
3954
+ (0, import_assert.default)(keys$10.length <= definition.length, "Invalid number of arguments for", desc$1.type, rule.name, "(expected up to", definition.length, ", found", keys$10.length, ")");
3903
3955
  for (const { name: name$2 } of definition) args$1.push(built[name$2]);
3904
3956
  } else {
3905
- assert$46(keys$10.length === 1, "Invalid number of arguments for", desc$1.type, rule.name, "(expected up to 1, found", keys$10.length, ")");
3957
+ (0, import_assert.default)(keys$10.length === 1, "Invalid number of arguments for", desc$1.type, rule.name, "(expected up to 1, found", keys$10.length, ")");
3906
3958
  args$1.push(built[keys$10[0]]);
3907
3959
  }
3908
3960
  }
@@ -3922,7 +3974,7 @@ var require_manifest = __commonJSMin((exports) => {
3922
3974
  "rules",
3923
3975
  "type"
3924
3976
  ].includes(key)) continue;
3925
- assert$46(def.terms[key], "Term", key, "missing configuration");
3977
+ (0, import_assert.default)(def.terms[key], "Term", key, "missing configuration");
3926
3978
  const manifest = def.terms[key].manifest;
3927
3979
  if (manifest === "schema") {
3928
3980
  terms[key] = desc$1[key].map((item) => this.parse(item));
@@ -3955,13 +4007,13 @@ var require_manifest = __commonJSMin((exports) => {
3955
4007
  if (desc$1 === null) return null;
3956
4008
  if (Array.isArray(desc$1)) return desc$1.map((item) => this.build(item));
3957
4009
  if (desc$1 instanceof Error) return desc$1;
3958
- if (options.assign === "options") return clone$14(desc$1);
4010
+ if (options.assign === "options") return (0, import_clone.default)(desc$1);
3959
4011
  if (options.assign === "regex") return internals$20.regex(desc$1);
3960
4012
  if (options.assign === "ref") return Ref$9.build(desc$1);
3961
4013
  if (typeof desc$1 !== "object") return desc$1;
3962
4014
  if (Object.keys(desc$1).length === 1) {
3963
4015
  if (desc$1.buffer) {
3964
- assert$46(Buffer$1, "Buffers are not supported");
4016
+ (0, import_assert.default)(Buffer$1, "Buffers are not supported");
3965
4017
  return Buffer$1 && Buffer$1.from(desc$1.buffer, "binary");
3966
4018
  }
3967
4019
  if (desc$1.function) return {
@@ -3972,10 +4024,10 @@ var require_manifest = __commonJSMin((exports) => {
3972
4024
  if (desc$1.ref) return Ref$9.build(desc$1.ref);
3973
4025
  if (desc$1.regex) return internals$20.regex(desc$1.regex);
3974
4026
  if (desc$1.special) {
3975
- assert$46(["deep"].includes(desc$1.special), "Unknown special value", desc$1.special);
4027
+ (0, import_assert.default)(["deep"].includes(desc$1.special), "Unknown special value", desc$1.special);
3976
4028
  return Common$19.symbols.deepDefault;
3977
4029
  }
3978
- if (desc$1.value) return clone$14(desc$1.value);
4030
+ if (desc$1.value) return (0, import_clone.default)(desc$1.value);
3979
4031
  }
3980
4032
  if (desc$1.type) return this.parse(desc$1);
3981
4033
  if (desc$1.template) return Template$5.build(desc$1);
@@ -3991,7 +4043,7 @@ var require_manifest = __commonJSMin((exports) => {
3991
4043
  return new RegExp(exp, flags);
3992
4044
  };
3993
4045
  internals$20.validate = function(joi, desc$1) {
3994
- Schemas$3 = Schemas$3 || require_schemas();
4046
+ Schemas$3 = Schemas$3 || import_schemas$1.default;
3995
4047
  joi.assert(desc$1, Schemas$3.description);
3996
4048
  };
3997
4049
  });
@@ -4010,7 +4062,7 @@ var require_lib$2 = __commonJSMin((exports) => {
4010
4062
  };
4011
4063
  });
4012
4064
  var require_trace = __commonJSMin((exports) => {
4013
- const { deepEqual: deepEqual$4 } = require_lib$4();
4065
+ const { deepEqual: deepEqual$3 } = require_lib$4();
4014
4066
  const Pinpoint = require_lib$2();
4015
4067
  const Errors$7 = require_errors$2();
4016
4068
  const internals$19 = {
@@ -4166,7 +4218,7 @@ var require_trace = __commonJSMin((exports) => {
4166
4218
  state.mainstay.debug.push(log$1);
4167
4219
  }
4168
4220
  value(state, by, from$2, to, name$2) {
4169
- if (!state.mainstay.debug || deepEqual$4(from$2, to)) return;
4221
+ if (!state.mainstay.debug || deepEqual$3(from$2, to)) return;
4170
4222
  const log$1 = {
4171
4223
  type: "value",
4172
4224
  by,
@@ -4225,7 +4277,7 @@ var require_trace = __commonJSMin((exports) => {
4225
4277
  return name$2;
4226
4278
  };
4227
4279
  internals$19.sub = function(paths, skipped) {
4228
- for (const path of paths) for (const skip of skipped) if (deepEqual$4(path.slice(0, skip.length), skip)) return true;
4280
+ for (const path of paths) for (const skip of skipped) if (deepEqual$3(path.slice(0, skip.length), skip)) return true;
4229
4281
  return false;
4230
4282
  };
4231
4283
  internals$19.debug = function(state, event) {
@@ -4236,7 +4288,7 @@ var require_trace = __commonJSMin((exports) => {
4236
4288
  };
4237
4289
  });
4238
4290
  var require_modify = __commonJSMin((exports) => {
4239
- const { assert: assert$45 } = require_lib$4();
4291
+ const { assert: assert$44 } = require_lib$4();
4240
4292
  const Common$18 = require_common$3();
4241
4293
  const Ref$8 = require_ref$2();
4242
4294
  const internals$18 = {};
@@ -4256,11 +4308,11 @@ var require_modify = __commonJSMin((exports) => {
4256
4308
  concat(source) {
4257
4309
  if (source._schemaChain) this._schemaChain = true;
4258
4310
  for (const [id, value] of source._byId.entries()) {
4259
- assert$45(!this._byKey.has(id), "Schema id conflicts with existing key:", id);
4311
+ assert$44(!this._byKey.has(id), "Schema id conflicts with existing key:", id);
4260
4312
  this._byId.set(id, value);
4261
4313
  }
4262
4314
  for (const [key, value] of source._byKey.entries()) {
4263
- assert$45(!this._byId.has(key), "Schema key conflicts with existing id:", key);
4315
+ assert$44(!this._byId.has(key), "Schema key conflicts with existing id:", key);
4264
4316
  this._byKey.set(key, value);
4265
4317
  }
4266
4318
  }
@@ -4272,7 +4324,7 @@ var require_modify = __commonJSMin((exports) => {
4272
4324
  id: tail$5.id,
4273
4325
  schema: adjuster(tail$5.schema)
4274
4326
  };
4275
- assert$45(Common$18.isSchema(adjusted.schema), "adjuster function failed to return a joi schema type");
4327
+ assert$44(Common$18.isSchema(adjusted.schema), "adjuster function failed to return a joi schema type");
4276
4328
  for (const node of chain) adjusted = {
4277
4329
  id: node.id,
4278
4330
  schema: internals$18.fork(node.schema, adjusted.id, adjusted.schema)
@@ -4291,7 +4343,7 @@ var require_modify = __commonJSMin((exports) => {
4291
4343
  reach(path, behind = []) {
4292
4344
  const current = path[0];
4293
4345
  const node = this._get(current);
4294
- assert$45(node, "Schema does not contain path", [...behind, ...path].join("."));
4346
+ assert$44(node, "Schema does not contain path", [...behind, ...path].join("."));
4295
4347
  const forward = path.slice(1);
4296
4348
  if (!forward.length) return node.schema;
4297
4349
  return node.schema._ids.reach(forward, [...behind, current]);
@@ -4302,16 +4354,16 @@ var require_modify = __commonJSMin((exports) => {
4302
4354
  const id = schema$2._flags.id;
4303
4355
  if (id) {
4304
4356
  const existing = this._byId.get(id);
4305
- assert$45(!existing || existing.schema === schema$2, "Cannot add different schemas with the same id:", id);
4306
- assert$45(!this._byKey.has(id), "Schema id conflicts with existing key:", id);
4357
+ assert$44(!existing || existing.schema === schema$2, "Cannot add different schemas with the same id:", id);
4358
+ assert$44(!this._byKey.has(id), "Schema id conflicts with existing key:", id);
4307
4359
  this._byId.set(id, {
4308
4360
  schema: schema$2,
4309
4361
  id
4310
4362
  });
4311
4363
  }
4312
4364
  if (key) {
4313
- assert$45(!this._byKey.has(key), "Schema already contains key:", key);
4314
- assert$45(!this._byId.has(key), "Schema key conflicts with existing id:", key);
4365
+ assert$44(!this._byKey.has(key), "Schema already contains key:", key);
4366
+ assert$44(!this._byId.has(key), "Schema key conflicts with existing id:", key);
4315
4367
  this._byKey.set(key, {
4316
4368
  schema: schema$2,
4317
4369
  id: key
@@ -4326,7 +4378,7 @@ var require_modify = __commonJSMin((exports) => {
4326
4378
  _collect(path, behind = [], nodes = []) {
4327
4379
  const current = path[0];
4328
4380
  const node = this._get(current);
4329
- assert$45(node, "Schema does not contain path", [...behind, ...path].join("."));
4381
+ assert$44(node, "Schema does not contain path", [...behind, ...path].join("."));
4330
4382
  nodes = [node, ...nodes];
4331
4383
  const forward = path.slice(1);
4332
4384
  if (!forward.length) return nodes;
@@ -4423,7 +4475,7 @@ var require_modify = __commonJSMin((exports) => {
4423
4475
  };
4424
4476
  });
4425
4477
  var require_state$1 = __commonJSMin((exports, module) => {
4426
- const { clone: clone$13, reach: reach$3 } = require_lib$4();
4478
+ const { clone: clone$12, reach: reach$2 } = require_lib$4();
4427
4479
  const Common$17 = require_common$3();
4428
4480
  const internals$17 = { value: Symbol("value") };
4429
4481
  module.exports = internals$17.State = class {
@@ -4450,7 +4502,7 @@ var require_state$1 = __commonJSMin((exports, module) => {
4450
4502
  this.mainstay.shadow.set(this.path, value, reason);
4451
4503
  }
4452
4504
  snapshot() {
4453
- if (this.mainstay.shadow) this._snapshot = clone$13(this.mainstay.shadow.node(this.path));
4505
+ if (this.mainstay.shadow) this._snapshot = clone$12(this.mainstay.shadow.node(this.path));
4454
4506
  this.mainstay.snapshot();
4455
4507
  }
4456
4508
  restore() {
@@ -4498,13 +4550,13 @@ var require_state$1 = __commonJSMin((exports, module) => {
4498
4550
  }
4499
4551
  node(path) {
4500
4552
  if (!this._values) return;
4501
- return reach$3(this._values, path, { iterables: true });
4553
+ return reach$2(this._values, path, { iterables: true });
4502
4554
  }
4503
4555
  override(path, node) {
4504
4556
  if (!this._values) return;
4505
4557
  const parents = path.slice(0, -1);
4506
4558
  const own = path[path.length - 1];
4507
- const parent = reach$3(this._values, parents, { iterables: true });
4559
+ const parent = reach$2(this._values, parents, { iterables: true });
4508
4560
  if (node) {
4509
4561
  parent.set(own, node);
4510
4562
  return;
@@ -4514,7 +4566,7 @@ var require_state$1 = __commonJSMin((exports, module) => {
4514
4566
  };
4515
4567
  });
4516
4568
  var require_validator = __commonJSMin((exports) => {
4517
- const { assert: assert$44, clone: clone$12, ignore: ignore$1, reach: reach$2 } = require_lib$4();
4569
+ const { assert: assert$43, clone: clone$11, ignore, reach: reach$1 } = require_lib$4();
4518
4570
  const Common$16 = require_common$3();
4519
4571
  const Errors$6 = require_errors$2();
4520
4572
  const State = require_state$1();
@@ -4522,12 +4574,12 @@ var require_validator = __commonJSMin((exports) => {
4522
4574
  exports.entry = function(value, schema$2, prefs) {
4523
4575
  let settings = Common$16.defaults;
4524
4576
  if (prefs) {
4525
- assert$44(prefs.warnings === void 0, "Cannot override warnings preference in synchronous validation");
4526
- assert$44(prefs.artifacts === void 0, "Cannot override artifacts preference in synchronous validation");
4577
+ assert$43(prefs.warnings === void 0, "Cannot override warnings preference in synchronous validation");
4578
+ assert$43(prefs.artifacts === void 0, "Cannot override artifacts preference in synchronous validation");
4527
4579
  settings = Common$16.preferences(Common$16.defaults, prefs);
4528
4580
  }
4529
4581
  const result = internals$16.entry(value, schema$2, settings);
4530
- assert$44(!result.mainstay.externals.length, "Schema with external rules must use validateAsync()");
4582
+ assert$43(!result.mainstay.externals.length, "Schema with external rules must use validateAsync()");
4531
4583
  const outcome = { value: result.value };
4532
4584
  if (result.error) outcome.error = result.error;
4533
4585
  if (result.mainstay.warnings.length) outcome.warning = Errors$6.details(result.mainstay.warnings);
@@ -4554,7 +4606,7 @@ var require_validator = __commonJSMin((exports) => {
4554
4606
  let key;
4555
4607
  let parent;
4556
4608
  const ancestors = path.length ? [root$11] : [];
4557
- const original = path.length ? reach$2(value, path) : value;
4609
+ const original = path.length ? reach$1(value, path) : value;
4558
4610
  if (path.length) {
4559
4611
  key = path[path.length - 1];
4560
4612
  let current = root$11;
@@ -4669,7 +4721,7 @@ var require_validator = __commonJSMin((exports) => {
4669
4721
  internals$16.tracer = function(schema$2, prefs) {
4670
4722
  if (schema$2.$_root._tracer) return { tracer: schema$2.$_root._tracer._register(schema$2) };
4671
4723
  if (prefs.debug) {
4672
- assert$44(schema$2.$_root.trace, "Debug mode not supported");
4724
+ assert$43(schema$2.$_root.trace, "Debug mode not supported");
4673
4725
  return {
4674
4726
  tracer: schema$2.$_root.trace()._register(schema$2),
4675
4727
  cleanup: true
@@ -4859,7 +4911,7 @@ var require_validator = __commonJSMin((exports) => {
4859
4911
  if (errors.length && schema$2._flags.error) if (typeof schema$2._flags.error === "function") {
4860
4912
  errors = schema$2._flags.error(errors);
4861
4913
  if (!Array.isArray(errors)) errors = [errors];
4862
- for (const error of errors) assert$44(error instanceof Error || error instanceof Errors$6.Report, "error() must return an Error object");
4914
+ for (const error of errors) assert$43(error instanceof Error || error instanceof Errors$6.Report, "error() must return an Error object");
4863
4915
  } else errors = [schema$2._flags.error];
4864
4916
  if (value === void 0) {
4865
4917
  const defaulted = internals$16.default("default", value, errors, helpers$8);
@@ -4911,7 +4963,7 @@ var require_validator = __commonJSMin((exports) => {
4911
4963
  state.mainstay.tracer.log(schema$2, state, "rule", flag, "full");
4912
4964
  if (!source) return source;
4913
4965
  if (typeof source === "function") {
4914
- const args$1 = source.length ? [clone$12(state.ancestors[0]), helpers$8] : [];
4966
+ const args$1 = source.length ? [clone$11(state.ancestors[0]), helpers$8] : [];
4915
4967
  try {
4916
4968
  return source(...args$1);
4917
4969
  } catch (err$1) {
@@ -4922,7 +4974,7 @@ var require_validator = __commonJSMin((exports) => {
4922
4974
  if (typeof source !== "object") return source;
4923
4975
  if (source[Common$16.symbols.literal]) return source.literal;
4924
4976
  if (Common$16.isResolvable(source)) return source.resolve(value, state, prefs);
4925
- return clone$12(source);
4977
+ return clone$11(source);
4926
4978
  };
4927
4979
  internals$16.trim = function(value, schema$2) {
4928
4980
  if (typeof value !== "string") return value;
@@ -4932,12 +4984,12 @@ var require_validator = __commonJSMin((exports) => {
4932
4984
  };
4933
4985
  internals$16.ignore = {
4934
4986
  active: false,
4935
- debug: ignore$1,
4936
- entry: ignore$1,
4937
- filter: ignore$1,
4938
- log: ignore$1,
4939
- resolve: ignore$1,
4940
- value: ignore$1
4987
+ debug: ignore,
4988
+ entry: ignore,
4989
+ filter: ignore,
4990
+ log: ignore,
4991
+ resolve: ignore,
4992
+ value: ignore
4941
4993
  };
4942
4994
  internals$16.errorsArray = function() {
4943
4995
  const errors = [];
@@ -4946,7 +4998,7 @@ var require_validator = __commonJSMin((exports) => {
4946
4998
  };
4947
4999
  });
4948
5000
  var require_values$1 = __commonJSMin((exports, module) => {
4949
- const { assert: assert$43, deepEqual: deepEqual$3 } = require_lib$4();
5001
+ const { assert: assert$42, deepEqual: deepEqual$2 } = require_lib$4();
4950
5002
  const Common$15 = require_common$3();
4951
5003
  const internals$15 = {};
4952
5004
  module.exports = internals$15.Values = class {
@@ -5001,7 +5053,7 @@ var require_values$1 = __commonJSMin((exports, module) => {
5001
5053
  }
5002
5054
  if (!this._refs.size && typeof value !== "object") return false;
5003
5055
  if (typeof value === "object") {
5004
- for (const item of this._values) if (deepEqual$3(item, value)) return { value: item };
5056
+ for (const item of this._values) if (deepEqual$2(item, value)) return { value: item };
5005
5057
  }
5006
5058
  if (state) for (const ref of this._refs) {
5007
5059
  const resolved = ref.resolve(value, state, prefs, null, { in: true });
@@ -5014,7 +5066,7 @@ var require_values$1 = __commonJSMin((exports, module) => {
5014
5066
  value: item,
5015
5067
  ref
5016
5068
  };
5017
- } else if (deepEqual$3(item, value)) return {
5069
+ } else if (deepEqual$2(item, value)) return {
5018
5070
  value: item,
5019
5071
  ref
5020
5072
  };
@@ -5039,7 +5091,7 @@ var require_values$1 = __commonJSMin((exports, module) => {
5039
5091
  return set;
5040
5092
  }
5041
5093
  concat(source) {
5042
- assert$43(!source._override, "Cannot concat override set of values");
5094
+ assert$42(!source._override, "Cannot concat override set of values");
5043
5095
  const set = new internals$15.Values([...this._values, ...source._values], [...this._refs, ...source._refs]);
5044
5096
  set._override = this._override;
5045
5097
  return set;
@@ -5063,7 +5115,7 @@ var require_values$1 = __commonJSMin((exports, module) => {
5063
5115
  };
5064
5116
  });
5065
5117
  var require_base$2 = __commonJSMin((exports, module) => {
5066
- const { assert: assert$42, clone: clone$11, deepEqual: deepEqual$2, merge: merge$3 } = require_lib$4();
5118
+ const { assert: assert$41, clone: clone$10, deepEqual: deepEqual$1, merge: merge$2 } = require_lib$4();
5067
5119
  const Cache$2 = require_cache();
5068
5120
  const Common$14 = require_common$3();
5069
5121
  const Compile$6 = require_compile();
@@ -5101,7 +5153,7 @@ var require_base$2 = __commonJSMin((exports, module) => {
5101
5153
  };
5102
5154
  }
5103
5155
  describe() {
5104
- assert$42(typeof Manifest$2.describe === "function", "Manifest functionality disabled");
5156
+ assert$41(typeof Manifest$2.describe === "function", "Manifest functionality disabled");
5105
5157
  return Manifest$2.describe(this);
5106
5158
  }
5107
5159
  allow(...values$3) {
@@ -5109,13 +5161,13 @@ var require_base$2 = __commonJSMin((exports, module) => {
5109
5161
  return this._values(values$3, "_valids");
5110
5162
  }
5111
5163
  alter(targets) {
5112
- assert$42(targets && typeof targets === "object" && !Array.isArray(targets), "Invalid targets argument");
5113
- assert$42(!this._inRuleset(), "Cannot set alterations inside a ruleset");
5164
+ assert$41(targets && typeof targets === "object" && !Array.isArray(targets), "Invalid targets argument");
5165
+ assert$41(!this._inRuleset(), "Cannot set alterations inside a ruleset");
5114
5166
  const obj = this.clone();
5115
5167
  obj.$_terms.alterations = obj.$_terms.alterations || [];
5116
5168
  for (const target in targets) {
5117
5169
  const adjuster = targets[target];
5118
- assert$42(typeof adjuster === "function", "Alteration adjuster for", target, "must be a function");
5170
+ assert$41(typeof adjuster === "function", "Alteration adjuster for", target, "must be a function");
5119
5171
  obj.$_terms.alterations.push({
5120
5172
  target,
5121
5173
  adjuster
@@ -5125,20 +5177,20 @@ var require_base$2 = __commonJSMin((exports, module) => {
5125
5177
  return obj;
5126
5178
  }
5127
5179
  artifact(id) {
5128
- assert$42(id !== void 0, "Artifact cannot be undefined");
5129
- assert$42(!this._cache, "Cannot set an artifact with a rule cache");
5180
+ assert$41(id !== void 0, "Artifact cannot be undefined");
5181
+ assert$41(!this._cache, "Cannot set an artifact with a rule cache");
5130
5182
  return this.$_setFlag("artifact", id);
5131
5183
  }
5132
5184
  cast(to) {
5133
- assert$42(to === false || typeof to === "string", "Invalid to value");
5134
- assert$42(to === false || this._definition.cast[to], "Type", this.type, "does not support casting to", to);
5185
+ assert$41(to === false || typeof to === "string", "Invalid to value");
5186
+ assert$41(to === false || this._definition.cast[to], "Type", this.type, "does not support casting to", to);
5135
5187
  return this.$_setFlag("cast", to === false ? void 0 : to);
5136
5188
  }
5137
5189
  default(value, options) {
5138
5190
  return this._default("default", value, options);
5139
5191
  }
5140
5192
  description(desc$1) {
5141
- assert$42(desc$1 && typeof desc$1 === "string", "Description must be a non-empty string");
5193
+ assert$41(desc$1 && typeof desc$1 === "string", "Description must be a non-empty string");
5142
5194
  return this.$_setFlag("description", desc$1);
5143
5195
  }
5144
5196
  empty(schema$2) {
@@ -5147,12 +5199,12 @@ var require_base$2 = __commonJSMin((exports, module) => {
5147
5199
  return obj.$_setFlag("empty", schema$2, { clone: false });
5148
5200
  }
5149
5201
  error(err$1) {
5150
- assert$42(err$1, "Missing error");
5151
- assert$42(err$1 instanceof Error || typeof err$1 === "function", "Must provide a valid Error object or a function");
5202
+ assert$41(err$1, "Missing error");
5203
+ assert$41(err$1 instanceof Error || typeof err$1 === "function", "Must provide a valid Error object or a function");
5152
5204
  return this.$_setFlag("error", err$1);
5153
5205
  }
5154
5206
  example(example, options = {}) {
5155
- assert$42(example !== void 0, "Missing example");
5207
+ assert$41(example !== void 0, "Missing example");
5156
5208
  Common$14.assertOptions(options, ["override"]);
5157
5209
  return this._inner("examples", example, {
5158
5210
  single: true,
@@ -5161,12 +5213,12 @@ var require_base$2 = __commonJSMin((exports, module) => {
5161
5213
  }
5162
5214
  external(method$1, description$2) {
5163
5215
  if (typeof method$1 === "object") {
5164
- assert$42(!description$2, "Cannot combine options with description");
5216
+ assert$41(!description$2, "Cannot combine options with description");
5165
5217
  description$2 = method$1.description;
5166
5218
  method$1 = method$1.method;
5167
5219
  }
5168
- assert$42(typeof method$1 === "function", "Method must be a function");
5169
- assert$42(description$2 === void 0 || description$2 && typeof description$2 === "string", "Description must be a non-empty string");
5220
+ assert$41(typeof method$1 === "function", "Method must be a function");
5221
+ assert$41(description$2 === void 0 || description$2 && typeof description$2 === "string", "Description must be a non-empty string");
5170
5222
  return this._inner("externals", {
5171
5223
  method: method$1,
5172
5224
  description: description$2
@@ -5180,46 +5232,46 @@ var require_base$2 = __commonJSMin((exports, module) => {
5180
5232
  }
5181
5233
  id(id) {
5182
5234
  if (!id) return this.$_setFlag("id", void 0);
5183
- assert$42(typeof id === "string", "id must be a non-empty string");
5184
- assert$42(/^[^\.]+$/.test(id), "id cannot contain period character");
5235
+ assert$41(typeof id === "string", "id must be a non-empty string");
5236
+ assert$41(/^[^\.]+$/.test(id), "id cannot contain period character");
5185
5237
  return this.$_setFlag("id", id);
5186
5238
  }
5187
5239
  invalid(...values$3) {
5188
5240
  return this._values(values$3, "_invalids");
5189
5241
  }
5190
5242
  label(name$2) {
5191
- assert$42(name$2 && typeof name$2 === "string", "Label name must be a non-empty string");
5243
+ assert$41(name$2 && typeof name$2 === "string", "Label name must be a non-empty string");
5192
5244
  return this.$_setFlag("label", name$2);
5193
5245
  }
5194
5246
  meta(meta) {
5195
- assert$42(meta !== void 0, "Meta cannot be undefined");
5247
+ assert$41(meta !== void 0, "Meta cannot be undefined");
5196
5248
  return this._inner("metas", meta, { single: true });
5197
5249
  }
5198
5250
  note(...notes) {
5199
- assert$42(notes.length, "Missing notes");
5200
- for (const note of notes) assert$42(note && typeof note === "string", "Notes must be non-empty strings");
5251
+ assert$41(notes.length, "Missing notes");
5252
+ for (const note of notes) assert$41(note && typeof note === "string", "Notes must be non-empty strings");
5201
5253
  return this._inner("notes", notes);
5202
5254
  }
5203
5255
  only(mode = true) {
5204
- assert$42(typeof mode === "boolean", "Invalid mode:", mode);
5256
+ assert$41(typeof mode === "boolean", "Invalid mode:", mode);
5205
5257
  return this.$_setFlag("only", mode);
5206
5258
  }
5207
5259
  optional() {
5208
5260
  return this.presence("optional");
5209
5261
  }
5210
5262
  prefs(prefs) {
5211
- assert$42(prefs, "Missing preferences");
5212
- assert$42(prefs.context === void 0, "Cannot override context");
5213
- assert$42(prefs.externals === void 0, "Cannot override externals");
5214
- assert$42(prefs.warnings === void 0, "Cannot override warnings");
5215
- assert$42(prefs.debug === void 0, "Cannot override debug");
5263
+ assert$41(prefs, "Missing preferences");
5264
+ assert$41(prefs.context === void 0, "Cannot override context");
5265
+ assert$41(prefs.externals === void 0, "Cannot override externals");
5266
+ assert$41(prefs.warnings === void 0, "Cannot override warnings");
5267
+ assert$41(prefs.debug === void 0, "Cannot override debug");
5216
5268
  Common$14.checkPreferences(prefs);
5217
5269
  const obj = this.clone();
5218
5270
  obj._preferences = Common$14.preferences(obj._preferences, prefs);
5219
5271
  return obj;
5220
5272
  }
5221
5273
  presence(mode) {
5222
- assert$42([
5274
+ assert$41([
5223
5275
  "optional",
5224
5276
  "required",
5225
5277
  "forbidden"
@@ -5230,7 +5282,7 @@ var require_base$2 = __commonJSMin((exports, module) => {
5230
5282
  return this.$_setFlag("result", enabled ? "raw" : void 0);
5231
5283
  }
5232
5284
  result(mode) {
5233
- assert$42(["raw", "strip"].includes(mode), "Unknown result mode", mode);
5285
+ assert$41(["raw", "strip"].includes(mode), "Unknown result mode", mode);
5234
5286
  return this.$_setFlag("result", mode);
5235
5287
  }
5236
5288
  required() {
@@ -5246,12 +5298,12 @@ var require_base$2 = __commonJSMin((exports, module) => {
5246
5298
  return this.$_setFlag("result", enabled ? "strip" : void 0);
5247
5299
  }
5248
5300
  tag(...tags$1) {
5249
- assert$42(tags$1.length, "Missing tags");
5250
- for (const tag of tags$1) assert$42(tag && typeof tag === "string", "Tags must be non-empty strings");
5301
+ assert$41(tags$1.length, "Missing tags");
5302
+ for (const tag of tags$1) assert$41(tag && typeof tag === "string", "Tags must be non-empty strings");
5251
5303
  return this._inner("tags", tags$1);
5252
5304
  }
5253
5305
  unit(name$2) {
5254
- assert$42(name$2 && typeof name$2 === "string", "Unit name must be a non-empty string");
5306
+ assert$41(name$2 && typeof name$2 === "string", "Unit name must be a non-empty string");
5255
5307
  return this.$_setFlag("unit", name$2);
5256
5308
  }
5257
5309
  valid(...values$3) {
@@ -5267,17 +5319,17 @@ var require_base$2 = __commonJSMin((exports, module) => {
5267
5319
  if (!["any", "link"].includes(obj.type)) {
5268
5320
  const conditions = when.is ? [when] : when.switch;
5269
5321
  for (const item of conditions) {
5270
- assert$42(!item.then || item.then.type === "any" || item.then.type === obj.type, "Cannot combine", obj.type, "with", item.then && item.then.type);
5271
- assert$42(!item.otherwise || item.otherwise.type === "any" || item.otherwise.type === obj.type, "Cannot combine", obj.type, "with", item.otherwise && item.otherwise.type);
5322
+ assert$41(!item.then || item.then.type === "any" || item.then.type === obj.type, "Cannot combine", obj.type, "with", item.then && item.then.type);
5323
+ assert$41(!item.otherwise || item.otherwise.type === "any" || item.otherwise.type === obj.type, "Cannot combine", obj.type, "with", item.otherwise && item.otherwise.type);
5272
5324
  }
5273
5325
  }
5274
5326
  obj.$_terms.whens.push(when);
5275
5327
  return obj.$_mutateRebuild();
5276
5328
  }
5277
5329
  cache(cache$2) {
5278
- assert$42(!this._inRuleset(), "Cannot set caching inside a ruleset");
5279
- assert$42(!this._cache, "Cannot override schema cache");
5280
- assert$42(this._flags.artifact === void 0, "Cannot cache a rule with an artifact");
5330
+ assert$41(!this._inRuleset(), "Cannot set caching inside a ruleset");
5331
+ assert$41(!this._cache, "Cannot override schema cache");
5332
+ assert$41(this._flags.artifact === void 0, "Cannot cache a rule with an artifact");
5281
5333
  const obj = this.clone();
5282
5334
  obj._cache = cache$2 || Cache$2.provider.provision();
5283
5335
  obj.$_temp.ruleset = false;
@@ -5288,10 +5340,10 @@ var require_base$2 = __commonJSMin((exports, module) => {
5288
5340
  return this._assign(obj);
5289
5341
  }
5290
5342
  concat(source) {
5291
- assert$42(Common$14.isSchema(source), "Invalid schema object");
5292
- assert$42(this.type === "any" || source.type === "any" || source.type === this.type, "Cannot merge type", this.type, "with another type:", source.type);
5293
- assert$42(!this._inRuleset(), "Cannot concatenate onto a schema with open ruleset");
5294
- assert$42(!source._inRuleset(), "Cannot concatenate a schema with open ruleset");
5343
+ assert$41(Common$14.isSchema(source), "Invalid schema object");
5344
+ assert$41(this.type === "any" || source.type === "any" || source.type === this.type, "Cannot merge type", this.type, "with another type:", source.type);
5345
+ assert$41(!this._inRuleset(), "Cannot concatenate onto a schema with open ruleset");
5346
+ assert$41(!source._inRuleset(), "Cannot concatenate a schema with open ruleset");
5295
5347
  let obj = this.clone();
5296
5348
  if (this.type === "any" && source.type !== "any") {
5297
5349
  const tmpObj = source.clone();
@@ -5315,13 +5367,13 @@ var require_base$2 = __commonJSMin((exports, module) => {
5315
5367
  obj._flags.empty = obj._flags.empty.concat(source._flags.empty);
5316
5368
  const flags = Object.assign({}, source._flags);
5317
5369
  delete flags.empty;
5318
- merge$3(obj._flags, flags);
5370
+ merge$2(obj._flags, flags);
5319
5371
  } else if (source._flags.empty) {
5320
5372
  obj._flags.empty = source._flags.empty;
5321
5373
  const flags = Object.assign({}, source._flags);
5322
5374
  delete flags.empty;
5323
- merge$3(obj._flags, flags);
5324
- } else merge$3(obj._flags, source._flags);
5375
+ merge$2(obj._flags, flags);
5376
+ } else merge$2(obj._flags, source._flags);
5325
5377
  for (const key in source.$_terms) {
5326
5378
  const terms = source.$_terms[key];
5327
5379
  if (!terms) {
@@ -5338,7 +5390,7 @@ var require_base$2 = __commonJSMin((exports, module) => {
5338
5390
  return obj.$_mutateRebuild();
5339
5391
  }
5340
5392
  extend(options) {
5341
- assert$42(!options.base, "Cannot extend type with another base");
5393
+ assert$41(!options.base, "Cannot extend type with another base");
5342
5394
  return Extend$2.type(this, options);
5343
5395
  }
5344
5396
  extract(path) {
@@ -5346,7 +5398,7 @@ var require_base$2 = __commonJSMin((exports, module) => {
5346
5398
  return this._ids.reach(path);
5347
5399
  }
5348
5400
  fork(paths, adjuster) {
5349
- assert$42(!this._inRuleset(), "Cannot fork inside a ruleset");
5401
+ assert$41(!this._inRuleset(), "Cannot fork inside a ruleset");
5350
5402
  let obj = this;
5351
5403
  for (let path of [].concat(paths)) {
5352
5404
  path = Array.isArray(path) ? path : path.split(".");
@@ -5370,16 +5422,16 @@ var require_base$2 = __commonJSMin((exports, module) => {
5370
5422
  rule(options) {
5371
5423
  const def = this._definition;
5372
5424
  Common$14.assertOptions(options, Object.keys(def.modifiers));
5373
- assert$42(this.$_temp.ruleset !== false, "Cannot apply rules to empty ruleset or the last rule added does not support rule properties");
5425
+ assert$41(this.$_temp.ruleset !== false, "Cannot apply rules to empty ruleset or the last rule added does not support rule properties");
5374
5426
  const start = this.$_temp.ruleset === null ? this._rules.length - 1 : this.$_temp.ruleset;
5375
- assert$42(start >= 0 && start < this._rules.length, "Cannot apply rules to empty ruleset");
5427
+ assert$41(start >= 0 && start < this._rules.length, "Cannot apply rules to empty ruleset");
5376
5428
  const obj = this.clone();
5377
5429
  for (let i$4 = start; i$4 < obj._rules.length; ++i$4) {
5378
5430
  const original = obj._rules[i$4];
5379
- const rule = clone$11(original);
5431
+ const rule = clone$10(original);
5380
5432
  for (const name$2 in options) {
5381
5433
  def.modifiers[name$2](rule, options[name$2]);
5382
- assert$42(rule.name === original.name, "Cannot change rule name");
5434
+ assert$41(rule.name === original.name, "Cannot change rule name");
5383
5435
  }
5384
5436
  obj._rules[i$4] = rule;
5385
5437
  if (obj._singleRules.get(rule.name) === original) obj._singleRules.set(rule.name, rule);
@@ -5388,7 +5440,7 @@ var require_base$2 = __commonJSMin((exports, module) => {
5388
5440
  return obj.$_mutateRebuild();
5389
5441
  }
5390
5442
  get ruleset() {
5391
- assert$42(!this._inRuleset(), "Cannot start a new ruleset without closing the previous one");
5443
+ assert$41(!this._inRuleset(), "Cannot start a new ruleset without closing the previous one");
5392
5444
  const obj = this.clone();
5393
5445
  obj.$_temp.ruleset = obj._rules.length;
5394
5446
  return obj;
@@ -5398,12 +5450,12 @@ var require_base$2 = __commonJSMin((exports, module) => {
5398
5450
  }
5399
5451
  tailor(targets) {
5400
5452
  targets = [].concat(targets);
5401
- assert$42(!this._inRuleset(), "Cannot tailor inside a ruleset");
5453
+ assert$41(!this._inRuleset(), "Cannot tailor inside a ruleset");
5402
5454
  let obj = this;
5403
5455
  if (this.$_terms.alterations) {
5404
5456
  for (const { target, adjuster } of this.$_terms.alterations) if (targets.includes(target)) {
5405
5457
  obj = adjuster(obj);
5406
- assert$42(Common$14.isSchema(obj), "Alteration adjuster for", target, "failed to return a schema object");
5458
+ assert$41(Common$14.isSchema(obj), "Alteration adjuster for", target, "failed to return a schema object");
5407
5459
  }
5408
5460
  }
5409
5461
  obj = obj.$_modify({
@@ -5424,18 +5476,18 @@ var require_base$2 = __commonJSMin((exports, module) => {
5424
5476
  }
5425
5477
  $_addRule(options) {
5426
5478
  if (typeof options === "string") options = { name: options };
5427
- assert$42(options && typeof options === "object", "Invalid options");
5428
- assert$42(options.name && typeof options.name === "string", "Invalid rule name");
5429
- for (const key in options) assert$42(key[0] !== "_", "Cannot set private rule properties");
5479
+ assert$41(options && typeof options === "object", "Invalid options");
5480
+ assert$41(options.name && typeof options.name === "string", "Invalid rule name");
5481
+ for (const key in options) assert$41(key[0] !== "_", "Cannot set private rule properties");
5430
5482
  const rule = Object.assign({}, options);
5431
5483
  rule._resolve = [];
5432
5484
  rule.method = rule.method || rule.name;
5433
5485
  const definition = this._definition.rules[rule.method];
5434
5486
  const args$1 = rule.args;
5435
- assert$42(definition, "Unknown rule", rule.method);
5487
+ assert$41(definition, "Unknown rule", rule.method);
5436
5488
  const obj = this.clone();
5437
5489
  if (args$1) {
5438
- assert$42(Object.keys(args$1).length === 1 || Object.keys(args$1).length === this._definition.rules[rule.name].args.length, "Invalid rule definition for", this.type, rule.name);
5490
+ assert$41(Object.keys(args$1).length === 1 || Object.keys(args$1).length === this._definition.rules[rule.name].args.length, "Invalid rule definition for", this.type, rule.name);
5439
5491
  for (const key in args$1) {
5440
5492
  let arg = args$1[key];
5441
5493
  if (definition.argsByName) {
@@ -5450,7 +5502,7 @@ var require_base$2 = __commonJSMin((exports, module) => {
5450
5502
  }
5451
5503
  if (resolver.assert) {
5452
5504
  const error = Common$14.validateArg(arg, key, resolver);
5453
- assert$42(!error, error, "or reference");
5505
+ assert$41(!error, error, "or reference");
5454
5506
  }
5455
5507
  }
5456
5508
  }
@@ -5507,7 +5559,7 @@ var require_base$2 = __commonJSMin((exports, module) => {
5507
5559
  return Modify.schema(this, options) || this;
5508
5560
  }
5509
5561
  $_mutateRebuild() {
5510
- assert$42(!this._inRuleset(), "Cannot add this rule inside a ruleset");
5562
+ assert$41(!this._inRuleset(), "Cannot add this rule inside a ruleset");
5511
5563
  this._refs.reset();
5512
5564
  this._ids.reset();
5513
5565
  const each$5 = (item, { source, name: name$2, path, key }) => {
@@ -5536,10 +5588,10 @@ var require_base$2 = __commonJSMin((exports, module) => {
5536
5588
  return this._refs.roots();
5537
5589
  }
5538
5590
  $_setFlag(name$2, value, options = {}) {
5539
- assert$42(name$2[0] === "_" || !this._inRuleset(), "Cannot set flag inside a ruleset");
5591
+ assert$41(name$2[0] === "_" || !this._inRuleset(), "Cannot set flag inside a ruleset");
5540
5592
  const flag = this._definition.flags[name$2] || {};
5541
- if (deepEqual$2(value, flag.default)) value = void 0;
5542
- if (deepEqual$2(value, this._flags[name$2])) return this;
5593
+ if (deepEqual$1(value, flag.default)) value = void 0;
5594
+ if (deepEqual$1(value, this._flags[name$2])) return this;
5543
5595
  const obj = options.clone !== false ? this.clone() : this;
5544
5596
  if (value !== void 0) {
5545
5597
  obj._flags[name$2] = value;
@@ -5564,7 +5616,7 @@ var require_base$2 = __commonJSMin((exports, module) => {
5564
5616
  target._valids = this._valids && this._valids.clone();
5565
5617
  target._invalids = this._invalids && this._invalids.clone();
5566
5618
  target._rules = this._rules.slice();
5567
- target._singleRules = clone$11(this._singleRules, { shallow: true });
5619
+ target._singleRules = clone$10(this._singleRules, { shallow: true });
5568
5620
  target._refs = this._refs.clone();
5569
5621
  target._flags = Object.assign({}, this._flags);
5570
5622
  target._cache = null;
@@ -5586,8 +5638,8 @@ var require_base$2 = __commonJSMin((exports, module) => {
5586
5638
  }
5587
5639
  _default(flag, value, options = {}) {
5588
5640
  Common$14.assertOptions(options, "literal");
5589
- assert$42(value !== void 0, "Missing", flag, "value");
5590
- assert$42(typeof value === "function" || !options.literal, "Only function value supports literal option");
5641
+ assert$41(value !== void 0, "Missing", flag, "value");
5642
+ assert$41(typeof value === "function" || !options.literal, "Only function value supports literal option");
5591
5643
  if (typeof value === "function" && options.literal) value = {
5592
5644
  [Common$14.symbols.literal]: true,
5593
5645
  literal: value
@@ -5648,7 +5700,7 @@ var require_base$2 = __commonJSMin((exports, module) => {
5648
5700
  };
5649
5701
  }
5650
5702
  _inner(type, values$3, options = {}) {
5651
- assert$42(!this._inRuleset(), `Cannot set ${type} inside a ruleset`);
5703
+ assert$41(!this._inRuleset(), `Cannot set ${type} inside a ruleset`);
5652
5704
  const obj = this.clone();
5653
5705
  if (!obj.$_terms[type] || options.override) obj.$_terms[type] = [];
5654
5706
  if (options.single) obj.$_terms[type].push(values$3);
@@ -5688,13 +5740,13 @@ var require_base$2 = __commonJSMin((exports, module) => {
5688
5740
  if (!obj[key]) return obj;
5689
5741
  if (override) obj[key].override();
5690
5742
  for (const value of values$3) {
5691
- assert$42(value !== void 0, "Cannot call allow/valid/invalid with undefined");
5692
- assert$42(value !== Common$14.symbols.override, "Override must be the first value");
5743
+ assert$41(value !== void 0, "Cannot call allow/valid/invalid with undefined");
5744
+ assert$41(value !== Common$14.symbols.override, "Override must be the first value");
5693
5745
  const other = key === "_invalids" ? "_valids" : "_invalids";
5694
5746
  if (obj[other]) {
5695
5747
  obj[other].remove(value);
5696
5748
  if (!obj[other].length) {
5697
- assert$42(key === "_valids" || !obj._flags.only, "Setting invalid value", value, "leaves schema rejecting all values due to previous valid rule");
5749
+ assert$41(key === "_valids" || !obj._flags.only, "Setting invalid value", value, "leaves schema rejecting all values due to previous valid rule");
5698
5750
  obj[other] = null;
5699
5751
  }
5700
5752
  }
@@ -5741,7 +5793,7 @@ var require_base$2 = __commonJSMin((exports, module) => {
5741
5793
  module.exports = new internals$14.Base();
5742
5794
  });
5743
5795
  var require_any = __commonJSMin((exports, module) => {
5744
- const { assert: assert$41 } = require_lib$4();
5796
+ const { assert: assert$40 } = require_lib$4();
5745
5797
  const Base$3 = require_base$2();
5746
5798
  const Common$13 = require_common$3();
5747
5799
  const Messages$3 = require_messages();
@@ -5761,8 +5813,8 @@ var require_any = __commonJSMin((exports, module) => {
5761
5813
  rules: {
5762
5814
  custom: {
5763
5815
  method(method$1, description$2) {
5764
- assert$41(typeof method$1 === "function", "Method must be a function");
5765
- assert$41(description$2 === void 0 || description$2 && typeof description$2 === "string", "Description must be a non-empty string");
5816
+ assert$40(typeof method$1 === "function", "Method must be a function");
5817
+ assert$40(description$2 === void 0 || description$2 && typeof description$2 === "string", "Description must be a non-empty string");
5766
5818
  return this.$_addRule({
5767
5819
  name: "custom",
5768
5820
  args: {
@@ -5785,7 +5837,7 @@ var require_any = __commonJSMin((exports, module) => {
5785
5837
  return this.prefs({ messages: messages$3 });
5786
5838
  } },
5787
5839
  shared: { method(schema$2) {
5788
- assert$41(Common$13.isSchema(schema$2) && schema$2._flags.id, "Schema must be a schema with an id");
5840
+ assert$40(Common$13.isSchema(schema$2) && schema$2._flags.id, "Schema must be a schema with an id");
5789
5841
  const obj = this.clone();
5790
5842
  obj.$_terms.shared = obj.$_terms.shared || [];
5791
5843
  obj.$_terms.shared.push(schema$2);
@@ -5794,7 +5846,7 @@ var require_any = __commonJSMin((exports, module) => {
5794
5846
  } },
5795
5847
  warning: {
5796
5848
  method(code$2, local) {
5797
- assert$41(code$2 && typeof code$2 === "string", "Invalid warning code");
5849
+ assert$40(code$2 && typeof code$2 === "string", "Invalid warning code");
5798
5850
  return this.$_addRule({
5799
5851
  name: "warning",
5800
5852
  args: {
@@ -5878,7 +5930,7 @@ var require_any = __commonJSMin((exports, module) => {
5878
5930
  });
5879
5931
  });
5880
5932
  var require_alternatives = __commonJSMin((exports, module) => {
5881
- const { assert: assert$40, merge: merge$2 } = require_lib$4();
5933
+ const { assert: assert$39, merge: merge$1 } = require_lib$4();
5882
5934
  const Any$9 = require_any();
5883
5935
  const Common$12 = require_common$3();
5884
5936
  const Compile$5 = require_compile();
@@ -5930,7 +5982,7 @@ var require_alternatives = __commonJSMin((exports, module) => {
5930
5982
  return v$1.schema.type === "object" || v$1.schema.type === "alternatives" && isAnyObj(v$1.schema);
5931
5983
  });
5932
5984
  };
5933
- return isAnyObj(schema$2) ? { value: matched.reduce((acc, v$1) => merge$2(acc, v$1, { mergeArrays: false })) } : { value: matched[matched.length - 1] };
5985
+ return isAnyObj(schema$2) ? { value: matched.reduce((acc, v$1) => merge$1(acc, v$1, { mergeArrays: false })) } : { value: matched[matched.length - 1] };
5934
5986
  }
5935
5987
  const errors = [];
5936
5988
  for (let i$4 = 0; i$4 < schema$2.$_terms.matches.length; ++i$4) {
@@ -5965,9 +6017,9 @@ var require_alternatives = __commonJSMin((exports, module) => {
5965
6017
  },
5966
6018
  rules: {
5967
6019
  conditional: { method(condition, options) {
5968
- assert$40(!this._flags._endedSwitch, "Unreachable condition");
5969
- assert$40(!this._flags.match, "Cannot combine match mode", this._flags.match, "with conditional rule");
5970
- assert$40(options.break === void 0, "Cannot use break option with alternatives conditional");
6020
+ assert$39(!this._flags._endedSwitch, "Unreachable condition");
6021
+ assert$39(!this._flags.match, "Cannot combine match mode", this._flags.match, "with conditional rule");
6022
+ assert$39(options.break === void 0, "Cannot use break option with alternatives conditional");
5971
6023
  const obj = this.clone();
5972
6024
  const match$2 = Compile$5.when(obj, condition, options);
5973
6025
  const conditions = match$2.is ? [match$2] : match$2.switch;
@@ -5979,18 +6031,18 @@ var require_alternatives = __commonJSMin((exports, module) => {
5979
6031
  return obj.$_mutateRebuild();
5980
6032
  } },
5981
6033
  match: { method(mode) {
5982
- assert$40([
6034
+ assert$39([
5983
6035
  "any",
5984
6036
  "one",
5985
6037
  "all"
5986
6038
  ].includes(mode), "Invalid alternatives match mode", mode);
5987
- if (mode !== "any") for (const match$2 of this.$_terms.matches) assert$40(match$2.schema, "Cannot combine match mode", mode, "with conditional rules");
6039
+ if (mode !== "any") for (const match$2 of this.$_terms.matches) assert$39(match$2.schema, "Cannot combine match mode", mode, "with conditional rules");
5988
6040
  return this.$_setFlag("match", mode);
5989
6041
  } },
5990
6042
  try: { method(...schemas) {
5991
- assert$40(schemas.length, "Missing alternative schemas");
6043
+ assert$39(schemas.length, "Missing alternative schemas");
5992
6044
  Common$12.verifyFlat(schemas, "try");
5993
- assert$40(!this._flags._endedSwitch, "Unreachable condition");
6045
+ assert$39(!this._flags._endedSwitch, "Unreachable condition");
5994
6046
  const obj = this.clone();
5995
6047
  for (const schema$2 of schemas) obj.$_terms.matches.push({ schema: obj.$_compile(schema$2) });
5996
6048
  return obj.$_mutateRebuild();
@@ -6088,7 +6140,7 @@ var require_alternatives = __commonJSMin((exports, module) => {
6088
6140
  };
6089
6141
  });
6090
6142
  var require_array = __commonJSMin((exports, module) => {
6091
- const { assert: assert$39, deepEqual: deepEqual$1, reach: reach$1 } = require_lib$4();
6143
+ const { assert: assert$38, deepEqual, reach } = require_lib$4();
6092
6144
  const Any$8 = require_any();
6093
6145
  const Common$11 = require_common$3();
6094
6146
  const Compile$4 = require_compile();
@@ -6384,7 +6436,7 @@ var require_array = __commonJSMin((exports, module) => {
6384
6436
  } },
6385
6437
  single: { method(enabled) {
6386
6438
  const value = enabled === void 0 ? true : !!enabled;
6387
- assert$39(!value || !this._flags._arrayItems, "Cannot specify single rule when array has array items");
6439
+ assert$38(!value || !this._flags._arrayItems, "Cannot specify single rule when array has array items");
6388
6440
  return this.$_setFlag("single", value);
6389
6441
  } },
6390
6442
  sort: {
@@ -6393,7 +6445,7 @@ var require_array = __commonJSMin((exports, module) => {
6393
6445
  const settings = { order: options.order || "ascending" };
6394
6446
  if (options.by) {
6395
6447
  settings.by = Compile$4.ref(options.by, { ancestor: 0 });
6396
- assert$39(!settings.by.ancestor, "Cannot sort by ancestor");
6448
+ assert$38(!settings.by.ancestor, "Cannot sort by ancestor");
6397
6449
  }
6398
6450
  return this.$_addRule({
6399
6451
  name: "sort",
@@ -6419,7 +6471,7 @@ var require_array = __commonJSMin((exports, module) => {
6419
6471
  } },
6420
6472
  unique: {
6421
6473
  method(comparator, options = {}) {
6422
- assert$39(!comparator || typeof comparator === "function" || typeof comparator === "string", "comparator must be a function or a string");
6474
+ assert$38(!comparator || typeof comparator === "function" || typeof comparator === "string", "comparator must be a function or a string");
6423
6475
  Common$11.assertOptions(options, ["ignoreUndefined", "separator"]);
6424
6476
  const rule = {
6425
6477
  name: "unique",
@@ -6445,12 +6497,12 @@ var require_array = __commonJSMin((exports, module) => {
6445
6497
  function: new Map(),
6446
6498
  custom: new Map()
6447
6499
  };
6448
- const compare$16 = comparator || deepEqual$1;
6500
+ const compare$16 = comparator || deepEqual;
6449
6501
  const ignoreUndefined = options.ignoreUndefined;
6450
6502
  for (let i$4 = 0; i$4 < value.length; ++i$4) {
6451
- const item = path ? reach$1(value[i$4], path) : value[i$4];
6503
+ const item = path ? reach(value[i$4], path) : value[i$4];
6452
6504
  const records = comparator ? found.custom : found[typeof item];
6453
- assert$39(records, "Failed to find unique map container for type", typeof item);
6505
+ assert$38(records, "Failed to find unique map container for type", typeof item);
6454
6506
  if (records instanceof Map) {
6455
6507
  const entries = records.entries();
6456
6508
  let current;
@@ -6578,7 +6630,7 @@ var require_array = __commonJSMin((exports, module) => {
6578
6630
  };
6579
6631
  internals$12.validateSingle = function(type, obj) {
6580
6632
  if (type.type === "array" || type._flags._arrayItems) {
6581
- assert$39(!obj._flags.single, "Cannot specify array item with single rule enabled");
6633
+ assert$38(!obj._flags.single, "Cannot specify array item with single rule enabled");
6582
6634
  obj.$_setFlag("_arrayItems", true, { clone: false });
6583
6635
  }
6584
6636
  };
@@ -6617,7 +6669,7 @@ var require_array = __commonJSMin((exports, module) => {
6617
6669
  };
6618
6670
  });
6619
6671
  var require_boolean = __commonJSMin((exports, module) => {
6620
- const { assert: assert$38 } = require_lib$4();
6672
+ const { assert: assert$37 } = require_lib$4();
6621
6673
  const Any$7 = require_any();
6622
6674
  const Common$10 = require_common$3();
6623
6675
  const Values = require_values$1();
@@ -6660,7 +6712,7 @@ var require_boolean = __commonJSMin((exports, module) => {
6660
6712
  obj.$_terms.truthy = obj.$_terms.truthy || new Values();
6661
6713
  for (let i$4 = 0; i$4 < values$3.length; ++i$4) {
6662
6714
  const value = values$3[i$4];
6663
- assert$38(value !== void 0, "Cannot call truthy with undefined");
6715
+ assert$37(value !== void 0, "Cannot call truthy with undefined");
6664
6716
  obj.$_terms.truthy.add(value);
6665
6717
  }
6666
6718
  return obj;
@@ -6671,7 +6723,7 @@ var require_boolean = __commonJSMin((exports, module) => {
6671
6723
  obj.$_terms.falsy = obj.$_terms.falsy || new Values();
6672
6724
  for (let i$4 = 0; i$4 < values$3.length; ++i$4) {
6673
6725
  const value = values$3[i$4];
6674
- assert$38(value !== void 0, "Cannot call falsy with undefined");
6726
+ assert$37(value !== void 0, "Cannot call falsy with undefined");
6675
6727
  obj.$_terms.falsy.add(value);
6676
6728
  }
6677
6729
  return obj;
@@ -6703,7 +6755,7 @@ var require_boolean = __commonJSMin((exports, module) => {
6703
6755
  });
6704
6756
  });
6705
6757
  var require_date = __commonJSMin((exports, module) => {
6706
- const { assert: assert$37 } = require_lib$4();
6758
+ const { assert: assert$36 } = require_lib$4();
6707
6759
  const Any$6 = require_any();
6708
6760
  const Common$9 = require_common$3();
6709
6761
  const Template$4 = require_template();
@@ -6753,7 +6805,7 @@ var require_date = __commonJSMin((exports, module) => {
6753
6805
  }]
6754
6806
  },
6755
6807
  format: { method(format) {
6756
- assert$37([
6808
+ assert$36([
6757
6809
  "iso",
6758
6810
  "javascript",
6759
6811
  "unix"
@@ -6796,7 +6848,7 @@ var require_date = __commonJSMin((exports, module) => {
6796
6848
  });
6797
6849
  } },
6798
6850
  timestamp: { method(type = "javascript") {
6799
- assert$37(["javascript", "unix"].includes(type), "\"type\" must be one of \"javascript, unix\"");
6851
+ assert$36(["javascript", "unix"].includes(type), "\"type\" must be one of \"javascript, unix\"");
6800
6852
  return this.format(type);
6801
6853
  } }
6802
6854
  },
@@ -6850,7 +6902,7 @@ var require_date = __commonJSMin((exports, module) => {
6850
6902
  };
6851
6903
  });
6852
6904
  var require_lib$1 = __commonJSMin((exports) => {
6853
- const { assert: assert$36 } = require_lib$4();
6905
+ const { assert: assert$35 } = require_lib$4();
6854
6906
  const internals$9 = {};
6855
6907
  exports.Sorter = class {
6856
6908
  constructor() {
@@ -6863,10 +6915,10 @@ var require_lib$1 = __commonJSMin((exports) => {
6863
6915
  const after = [].concat(options.after ?? []);
6864
6916
  const group = options.group ?? "?";
6865
6917
  const sort$2 = options.sort ?? 0;
6866
- assert$36(!before.includes(group), `Item cannot come before itself: ${group}`);
6867
- assert$36(!before.includes("?"), "Item cannot come before unassociated items");
6868
- assert$36(!after.includes(group), `Item cannot come after itself: ${group}`);
6869
- assert$36(!after.includes("?"), "Item cannot come after unassociated items");
6918
+ assert$35(!before.includes(group), `Item cannot come before itself: ${group}`);
6919
+ assert$35(!before.includes("?"), "Item cannot come before unassociated items");
6920
+ assert$35(!after.includes(group), `Item cannot come after itself: ${group}`);
6921
+ assert$35(!after.includes("?"), "Item cannot come after unassociated items");
6870
6922
  if (!Array.isArray(nodes)) nodes = [nodes];
6871
6923
  for (const node of nodes) {
6872
6924
  const item = {
@@ -6881,7 +6933,7 @@ var require_lib$1 = __commonJSMin((exports) => {
6881
6933
  }
6882
6934
  if (!options.manual) {
6883
6935
  const valid$2 = this._sort();
6884
- assert$36(valid$2, "item", group !== "?" ? `added into group ${group}` : "", "created a dependencies error");
6936
+ assert$35(valid$2, "item", group !== "?" ? `added into group ${group}` : "", "created a dependencies error");
6885
6937
  }
6886
6938
  return this.nodes;
6887
6939
  }
@@ -6891,12 +6943,12 @@ var require_lib$1 = __commonJSMin((exports) => {
6891
6943
  this._items.sort(internals$9.mergeSort);
6892
6944
  for (let i$4 = 0; i$4 < this._items.length; ++i$4) this._items[i$4].seq = i$4;
6893
6945
  const valid$2 = this._sort();
6894
- assert$36(valid$2, "merge created a dependencies error");
6946
+ assert$35(valid$2, "merge created a dependencies error");
6895
6947
  return this.nodes;
6896
6948
  }
6897
6949
  sort() {
6898
6950
  const valid$2 = this._sort();
6899
- assert$36(valid$2, "sort created a dependencies error");
6951
+ assert$35(valid$2, "sort created a dependencies error");
6900
6952
  return this.nodes;
6901
6953
  }
6902
6954
  _sort() {
@@ -6973,7 +7025,7 @@ var require_lib$1 = __commonJSMin((exports) => {
6973
7025
  };
6974
7026
  });
6975
7027
  var require_keys$1 = __commonJSMin((exports, module) => {
6976
- const { applyToDefaults: applyToDefaults$1, assert: assert$35, clone: Clone } = require_lib$4();
7028
+ const { applyToDefaults, assert: assert$34, clone: Clone } = require_lib$4();
6977
7029
  const Topo = require_lib$1();
6978
7030
  const Any$5 = require_any();
6979
7031
  const Common$8 = require_common$3();
@@ -7074,7 +7126,7 @@ var require_keys$1 = __commonJSMin((exports, module) => {
7074
7126
  assert: {
7075
7127
  method(subject, schema$2, message) {
7076
7128
  if (!Template$3.isTemplate(subject)) subject = Compile$3.ref(subject);
7077
- assert$35(message === void 0 || typeof message === "string", "Message must be a string");
7129
+ assert$34(message === void 0 || typeof message === "string", "Message must be a string");
7078
7130
  schema$2 = this.$_compile(schema$2, { appendPath: true });
7079
7131
  const obj = this.$_addRule({
7080
7132
  name: "assert",
@@ -7106,7 +7158,7 @@ var require_keys$1 = __commonJSMin((exports, module) => {
7106
7158
  },
7107
7159
  instance: {
7108
7160
  method(constructor, name$2) {
7109
- assert$35(typeof constructor === "function", "constructor must be a function");
7161
+ assert$34(typeof constructor === "function", "constructor must be a function");
7110
7162
  name$2 = name$2 || constructor.name;
7111
7163
  return this.$_addRule({
7112
7164
  name: "instance",
@@ -7126,8 +7178,8 @@ var require_keys$1 = __commonJSMin((exports, module) => {
7126
7178
  args: ["constructor", "name"]
7127
7179
  },
7128
7180
  keys: { method(schema$2) {
7129
- assert$35(schema$2 === void 0 || typeof schema$2 === "object", "Object schema must be a valid object");
7130
- assert$35(!Common$8.isSchema(schema$2), "Object schema cannot be a joi schema");
7181
+ assert$34(schema$2 === void 0 || typeof schema$2 === "object", "Object schema must be a valid object");
7182
+ assert$34(!Common$8.isSchema(schema$2), "Object schema cannot be a joi schema");
7131
7183
  const obj = this.clone();
7132
7184
  if (!schema$2) obj.$_terms.keys = null;
7133
7185
  else if (!Object.keys(schema$2).length) obj.$_terms.keys = new internals$8.Keys();
@@ -7192,9 +7244,9 @@ var require_keys$1 = __commonJSMin((exports, module) => {
7192
7244
  pattern: { method(pattern, schema$2, options = {}) {
7193
7245
  const isRegExp$3 = pattern instanceof RegExp;
7194
7246
  if (!isRegExp$3) pattern = this.$_compile(pattern, { appendPath: true });
7195
- assert$35(schema$2 !== void 0, "Invalid rule");
7247
+ assert$34(schema$2 !== void 0, "Invalid rule");
7196
7248
  Common$8.assertOptions(options, ["fallthrough", "matches"]);
7197
- if (isRegExp$3) assert$35(!pattern.flags.includes("g") && !pattern.flags.includes("y"), "pattern should not use global or sticky mode");
7249
+ if (isRegExp$3) assert$34(!pattern.flags.includes("g") && !pattern.flags.includes("y"), "pattern should not use global or sticky mode");
7198
7250
  schema$2 = this.$_compile(schema$2, { appendPath: true });
7199
7251
  const obj = this.clone();
7200
7252
  obj.$_terms.patterns = obj.$_terms.patterns || [];
@@ -7232,9 +7284,9 @@ var require_keys$1 = __commonJSMin((exports, module) => {
7232
7284
  }
7233
7285
  },
7234
7286
  rename: { method(from$2, to, options = {}) {
7235
- assert$35(typeof from$2 === "string" || from$2 instanceof RegExp, "Rename missing the from argument");
7236
- assert$35(typeof to === "string" || to instanceof Template$3, "Invalid rename to argument");
7237
- assert$35(to !== from$2, "Cannot rename key to same name:", from$2);
7287
+ assert$34(typeof from$2 === "string" || from$2 instanceof RegExp, "Rename missing the from argument");
7288
+ assert$34(typeof to === "string" || to instanceof Template$3, "Invalid rename to argument");
7289
+ assert$34(to !== from$2, "Cannot rename key to same name:", from$2);
7238
7290
  Common$8.assertOptions(options, [
7239
7291
  "alias",
7240
7292
  "ignoreUndefined",
@@ -7243,12 +7295,12 @@ var require_keys$1 = __commonJSMin((exports, module) => {
7243
7295
  ]);
7244
7296
  const obj = this.clone();
7245
7297
  obj.$_terms.renames = obj.$_terms.renames || [];
7246
- for (const rename of obj.$_terms.renames) assert$35(rename.from !== from$2, "Cannot rename the same key multiple times");
7298
+ for (const rename of obj.$_terms.renames) assert$34(rename.from !== from$2, "Cannot rename the same key multiple times");
7247
7299
  if (to instanceof Template$3) obj.$_mutateRegister(to);
7248
7300
  obj.$_terms.renames.push({
7249
7301
  from: from$2,
7250
7302
  to,
7251
- options: applyToDefaults$1(internals$8.renameDefaults, options)
7303
+ options: applyToDefaults(internals$8.renameDefaults, options)
7252
7304
  });
7253
7305
  return obj;
7254
7306
  } },
@@ -7360,14 +7412,14 @@ var require_keys$1 = __commonJSMin((exports, module) => {
7360
7412
  return clone$20;
7361
7413
  };
7362
7414
  internals$8.dependency = function(schema$2, rel, key, peers, options) {
7363
- assert$35(key === null || typeof key === "string", rel, "key must be a strings");
7415
+ assert$34(key === null || typeof key === "string", rel, "key must be a strings");
7364
7416
  if (!options) options = peers.length > 1 && typeof peers[peers.length - 1] === "object" ? peers.pop() : {};
7365
7417
  Common$8.assertOptions(options, ["separator", "isPresent"]);
7366
7418
  peers = [].concat(peers);
7367
7419
  const separator = Common$8.default(options.separator, ".");
7368
7420
  const paths = [];
7369
7421
  for (const peer of peers) {
7370
- assert$35(typeof peer === "string", rel, "peers must be strings");
7422
+ assert$34(typeof peer === "string", rel, "peers must be strings");
7371
7423
  paths.push(Compile$3.ref(peer, {
7372
7424
  separator,
7373
7425
  ancestor: 0,
@@ -7664,7 +7716,7 @@ var require_keys$1 = __commonJSMin((exports, module) => {
7664
7716
  };
7665
7717
  });
7666
7718
  var require_function = __commonJSMin((exports, module) => {
7667
- const { assert: assert$34 } = require_lib$4();
7719
+ const { assert: assert$33 } = require_lib$4();
7668
7720
  const Keys$1 = require_keys$1();
7669
7721
  module.exports = Keys$1.extend({
7670
7722
  type: "function",
@@ -7672,7 +7724,7 @@ var require_function = __commonJSMin((exports, module) => {
7672
7724
  rules: {
7673
7725
  arity: {
7674
7726
  method(n$4) {
7675
- assert$34(Number.isSafeInteger(n$4) && n$4 >= 0, "n must be a positive integer");
7727
+ assert$33(Number.isSafeInteger(n$4) && n$4 >= 0, "n must be a positive integer");
7676
7728
  return this.$_addRule({
7677
7729
  name: "arity",
7678
7730
  args: { n: n$4 }
@@ -7694,7 +7746,7 @@ var require_function = __commonJSMin((exports, module) => {
7694
7746
  },
7695
7747
  minArity: {
7696
7748
  method(n$4) {
7697
- assert$34(Number.isSafeInteger(n$4) && n$4 > 0, "n must be a strict positive integer");
7749
+ assert$33(Number.isSafeInteger(n$4) && n$4 > 0, "n must be a strict positive integer");
7698
7750
  return this.$_addRule({
7699
7751
  name: "minArity",
7700
7752
  args: { n: n$4 }
@@ -7707,7 +7759,7 @@ var require_function = __commonJSMin((exports, module) => {
7707
7759
  },
7708
7760
  maxArity: {
7709
7761
  method(n$4) {
7710
- assert$34(Number.isSafeInteger(n$4) && n$4 >= 0, "n must be a positive integer");
7762
+ assert$33(Number.isSafeInteger(n$4) && n$4 >= 0, "n must be a positive integer");
7711
7763
  return this.$_addRule({
7712
7764
  name: "maxArity",
7713
7765
  args: { n: n$4 }
@@ -7728,7 +7780,7 @@ var require_function = __commonJSMin((exports, module) => {
7728
7780
  });
7729
7781
  });
7730
7782
  var require_link = __commonJSMin((exports, module) => {
7731
- const { assert: assert$33 } = require_lib$4();
7783
+ const { assert: assert$32 } = require_lib$4();
7732
7784
  const Any$4 = require_any();
7733
7785
  const Common$7 = require_common$3();
7734
7786
  const Compile$2 = require_compile();
@@ -7746,7 +7798,7 @@ var require_link = __commonJSMin((exports, module) => {
7746
7798
  return schema$2.ref(ref);
7747
7799
  },
7748
7800
  validate(value, { schema: schema$2, state, prefs }) {
7749
- assert$33(schema$2.$_terms.link, "Uninitialized link schema");
7801
+ assert$32(schema$2.$_terms.link, "Uninitialized link schema");
7750
7802
  const linked = internals$7.generate(schema$2, value, state, prefs);
7751
7803
  const ref = schema$2.$_terms.link[0].ref;
7752
7804
  return linked.$_validate(value, state.nest(linked, `link:${ref.display}:${linked.type}`), prefs);
@@ -7756,10 +7808,10 @@ var require_link = __commonJSMin((exports, module) => {
7756
7808
  },
7757
7809
  rules: {
7758
7810
  ref: { method(ref) {
7759
- assert$33(!this.$_terms.link, "Cannot reinitialize schema");
7811
+ assert$32(!this.$_terms.link, "Cannot reinitialize schema");
7760
7812
  ref = Compile$2.ref(ref);
7761
- assert$33(ref.type === "value" || ref.type === "local", "Invalid reference type:", ref.type);
7762
- assert$33(ref.type === "local" || ref.ancestor === "root" || ref.ancestor > 0, "Link cannot reference itself");
7813
+ assert$32(ref.type === "value" || ref.type === "local", "Invalid reference type:", ref.type);
7814
+ assert$32(ref.type === "local" || ref.ancestor === "root" || ref.ancestor > 0, "Link cannot reference itself");
7763
7815
  const obj = this.clone();
7764
7816
  obj.$_terms.link = [{ ref }];
7765
7817
  return obj;
@@ -7769,16 +7821,16 @@ var require_link = __commonJSMin((exports, module) => {
7769
7821
  } }
7770
7822
  },
7771
7823
  overrides: { concat(source) {
7772
- assert$33(this.$_terms.link, "Uninitialized link schema");
7773
- assert$33(Common$7.isSchema(source), "Invalid schema object");
7774
- assert$33(source.type !== "link", "Cannot merge type link with another link");
7824
+ assert$32(this.$_terms.link, "Uninitialized link schema");
7825
+ assert$32(Common$7.isSchema(source), "Invalid schema object");
7826
+ assert$32(source.type !== "link", "Cannot merge type link with another link");
7775
7827
  const obj = this.clone();
7776
7828
  if (!obj.$_terms.whens) obj.$_terms.whens = [];
7777
7829
  obj.$_terms.whens.push({ concat: source });
7778
7830
  return obj.$_mutateRebuild();
7779
7831
  } },
7780
7832
  manifest: { build(obj, desc$1) {
7781
- assert$33(desc$1.link, "Invalid link description missing link");
7833
+ assert$32(desc$1.link, "Invalid link description missing link");
7782
7834
  return obj.ref(desc$1.link);
7783
7835
  } }
7784
7836
  });
@@ -7828,11 +7880,11 @@ var require_link = __commonJSMin((exports, module) => {
7828
7880
  };
7829
7881
  internals$7.assert = function(condition, message, ref, schema$2, state, prefs) {
7830
7882
  if (condition) return;
7831
- assert$33(false, `"${Errors$2.label(schema$2._flags, state, prefs)}" contains link reference "${ref.display}" ${message}`);
7883
+ assert$32(false, `"${Errors$2.label(schema$2._flags, state, prefs)}" contains link reference "${ref.display}" ${message}`);
7832
7884
  };
7833
7885
  });
7834
7886
  var require_number = __commonJSMin((exports, module) => {
7835
- const { assert: assert$32 } = require_lib$4();
7887
+ const { assert: assert$31 } = require_lib$4();
7836
7888
  const Any$3 = require_any();
7837
7889
  const Common$6 = require_common$3();
7838
7890
  const internals$6 = {
@@ -8008,7 +8060,7 @@ var require_number = __commonJSMin((exports, module) => {
8008
8060
  } },
8009
8061
  precision: {
8010
8062
  method(limit) {
8011
- assert$32(Number.isSafeInteger(limit), "limit must be an integer");
8063
+ assert$31(Number.isSafeInteger(limit), "limit must be an integer");
8012
8064
  return this.$_addRule({
8013
8065
  name: "precision",
8014
8066
  args: { limit }
@@ -8027,7 +8079,7 @@ var require_number = __commonJSMin((exports, module) => {
8027
8079
  },
8028
8080
  sign: {
8029
8081
  method(sign$2) {
8030
- assert$32(["negative", "positive"].includes(sign$2), "Invalid sign", sign$2);
8082
+ assert$31(["negative", "positive"].includes(sign$2), "Invalid sign", sign$2);
8031
8083
  return this.$_addRule({
8032
8084
  name: "sign",
8033
8085
  args: { sign: sign$2 }
@@ -8039,7 +8091,7 @@ var require_number = __commonJSMin((exports, module) => {
8039
8091
  }
8040
8092
  },
8041
8093
  unsafe: { method(enabled = true) {
8042
- assert$32(typeof enabled === "boolean", "enabled must be a boolean");
8094
+ assert$31(typeof enabled === "boolean", "enabled must be a boolean");
8043
8095
  return this.$_setFlag("unsafe", enabled);
8044
8096
  } }
8045
8097
  },
@@ -9373,10 +9425,10 @@ var require_types = __commonJSMin((exports) => {
9373
9425
  exports.isArgumentsObject = isArgumentsObject;
9374
9426
  exports.isGeneratorFunction = isGeneratorFunction;
9375
9427
  exports.isTypedArray = isTypedArray$7;
9376
- function isPromise$2(input) {
9428
+ function isPromise$1(input) {
9377
9429
  return typeof Promise !== "undefined" && input instanceof Promise || input !== null && typeof input === "object" && typeof input.then === "function" && typeof input.catch === "function";
9378
9430
  }
9379
- exports.isPromise = isPromise$2;
9431
+ exports.isPromise = isPromise$1;
9380
9432
  function isArrayBufferView$1(value) {
9381
9433
  if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) return ArrayBuffer.isView(value);
9382
9434
  return isTypedArray$7(value) || isDataView(value);
@@ -10060,31 +10112,6 @@ var init_email = __esmMin(() => {
10060
10112
  "(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"
10061
10113
  ].join("|"));
10062
10114
  });
10063
- var import_applyToDefaults, import_assert, import_bench, import_block, import_clone, import_contain, import_deepEqual, import_assertError, import_escapeHeaderAttribute, import_escapeHtml, import_escapeJson, import_escapeRegex, import_flatten, import_ignore, import_intersect, import_isPromise, import_merge, import_once, import_reach, import_reachTemplate, import_stringify, import_wait;
10064
- var init_lib = __esmMin(() => {
10065
- import_applyToDefaults = __toESM(require_applyToDefaults(), 1);
10066
- import_assert = __toESM(require_assert$1(), 1);
10067
- import_bench = __toESM(require_bench(), 1);
10068
- import_block = __toESM(require_block(), 1);
10069
- import_clone = __toESM(require_clone$1(), 1);
10070
- import_contain = __toESM(require_contain(), 1);
10071
- import_deepEqual = __toESM(require_deepEqual(), 1);
10072
- import_assertError = __toESM(require_assertError(), 1);
10073
- import_escapeHeaderAttribute = __toESM(require_escapeHeaderAttribute(), 1);
10074
- import_escapeHtml = __toESM(require_escapeHtml(), 1);
10075
- import_escapeJson = __toESM(require_escapeJson(), 1);
10076
- import_escapeRegex = __toESM(require_escapeRegex(), 1);
10077
- import_flatten = __toESM(require_flatten$1(), 1);
10078
- import_ignore = __toESM(require_ignore(), 1);
10079
- import_intersect = __toESM(require_intersect(), 1);
10080
- import_isPromise = __toESM(require_isPromise(), 1);
10081
- import_merge = __toESM(require_merge(), 1);
10082
- import_once = __toESM(require_once(), 1);
10083
- import_reach = __toESM(require_reach(), 1);
10084
- import_reachTemplate = __toESM(require_reachTemplate(), 1);
10085
- import_stringify = __toESM(require_stringify(), 1);
10086
- import_wait = __toESM(require_wait(), 1);
10087
- });
10088
10115
  function generate$1() {
10089
10116
  const rfc3986$1 = {};
10090
10117
  const hexDigit = "\\dA-Fa-f";
@@ -13707,20 +13734,6 @@ Object.defineProperty(import_errors$1.default, "template", { value: function(val
13707
13734
  if (!messages$3[code$2]) return messages$3["*"];
13708
13735
  return messages$3[code$2];
13709
13736
  } });
13710
- var import_manifest$1 = __toESM(require_manifest());
13711
- const ManifestDescriptionCache = new WeakMap();
13712
- const originalDescribe = import_manifest$1.default.describe;
13713
- Object.defineProperty(import_manifest$1.default, "describe", {
13714
- value: function(schema$2) {
13715
- const cached = ManifestDescriptionCache.get(schema$2);
13716
- if (cached) return cached;
13717
- const result = originalDescribe.call(this, schema$2);
13718
- ManifestDescriptionCache.set(schema$2, result);
13719
- return result;
13720
- },
13721
- writable: true,
13722
- configurable: true
13723
- });
13724
13737
  const json = (root$11) => {
13725
13738
  return root$11;
13726
13739
  };
@@ -45706,14 +45719,6 @@ var RootFactory = class RootFactory {
45706
45719
  static generate(root$11, schema$2, args$1) {
45707
45720
  (0, import_assert.default)(root$11, "Must be invoked on a Joi instance.");
45708
45721
  const cloned = schema$2.clone();
45709
- const originalDescribe$1 = cloned.describe.bind(cloned);
45710
- cloned.describe = function() {
45711
- const cached = RootFactory.$_cachedDescriptions.get(this);
45712
- if (cached) return cached;
45713
- const result = originalDescribe$1();
45714
- RootFactory.$_cachedDescriptions.set(this, result);
45715
- return result;
45716
- };
45717
45722
  cloned.$_root = root$11;
45718
45723
  if (!cloned._definition.args || !args$1.length) return cloned;
45719
45724
  return cloned._definition.args(cloned, ...args$1);
@@ -143180,7 +143185,7 @@ const encode = (schema$2, options = {}) => {
143180
143185
  });
143181
143186
  }
143182
143187
  const json$1 = JSON.stringify({
143183
- version: "0.1.0-master-cb87a6f9",
143188
+ version: "0.1.0-master-fe5983b7",
143184
143189
  schema: description$2
143185
143190
  }, (key, value) => {
143186
143191
  if (typeof value === "bigint") return value.toString();
@@ -143228,9 +143233,9 @@ const decode = (base64, options = {}) => {
143228
143233
  });
143229
143234
  if (!isPlainObject(description$2) || !("version" in description$2) || !("schema" in description$2) || typeof description$2.version !== "string" || !isPlainObject(description$2.schema)) throw new TypeError("Not a valid encoded schema");
143230
143235
  const { version: schemaVersion, schema: schema$2 } = description$2;
143231
- if (import_semver.valid("0.1.0-master-cb87a6f9")) {
143236
+ if (import_semver.valid("0.1.0-master-fe5983b7")) {
143232
143237
  if (!import_semver.valid(import_semver.coerce(schemaVersion))) throw new TypeError(`Invalid schema version: ${schemaVersion}`);
143233
- if (import_semver.gt(import_semver.coerce(schemaVersion), "0.1.0-master-cb87a6f9")) throw new TypeError(`Schema version ${schemaVersion} is not compatible with current version 0.1.0-master-cb87a6f9`);
143238
+ if (import_semver.gt(import_semver.coerce(schemaVersion), "0.1.0-master-fe5983b7")) throw new TypeError(`Schema version ${schemaVersion} is not compatible with current version 0.1.0-master-fe5983b7`);
143234
143239
  }
143235
143240
  return validator.build(schema$2);
143236
143241
  };
@@ -144684,7 +144689,7 @@ init_esm();
144684
144689
  var import_lib = __toESM(require_lib$3());
144685
144690
  var import_lib$1 = __toESM(require_lib$2());
144686
144691
  var import_lib$2 = __toESM(require_lib());
144687
- const version = "0.1.0-master-cb87a6f9";
144692
+ const version = "0.1.0-master-fe5983b7";
144688
144693
  var ValidationError = import_lib$2.ValidationError;
144689
144694
  var location = import_lib$1.location;
144690
144695
  export { ValidationError, esm_exports as address, decode, encode, import_lib as formula, location, tlds, validator, version };