@mattrglobal/verifier-sdk-web 2.1.1-unstable.9 → 2.1.1-unstable.90
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/README.md +41 -0
- package/dist/lib/verifier-js-no-deps.cjs.js +1 -1
- package/dist/lib/verifier-js-no-deps.cjs.js.map +1 -1
- package/dist/lib/verifier-js.cjs.js +243 -365
- package/dist/lib/verifier-js.cjs.js.map +1 -1
- package/dist/typings/verifier/requestCredentialsDigitalCredentialsApi.d.ts +4 -2
- package/dist/typings/verifier/types/verifier-web-sdk.d.ts +4 -2
- package/dist/verifier-js.development.js +243 -365
- package/dist/verifier-js.development.js.map +1 -1
- package/dist/verifier-js.production.esm.js +3 -3
- package/dist/verifier-js.production.esm.js.map +1 -1
- package/dist/verifier-js.production.js +3 -3
- package/dist/verifier-js.production.js.map +1 -1
- package/package.json +3 -3
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
* Do Not Translate or Localize
|
|
8
8
|
*
|
|
9
9
|
* Bundle of @mattrglobal/verifier-sdk-web
|
|
10
|
-
* Generated: 2025-
|
|
10
|
+
* Generated: 2025-12-11
|
|
11
11
|
* Version: 2.1.0
|
|
12
12
|
* Dependencies:
|
|
13
13
|
*
|
|
14
14
|
* neverthrow -- 4.3.0
|
|
15
15
|
*
|
|
16
|
-
* valibot -- 1.
|
|
16
|
+
* valibot -- 1.2.0
|
|
17
17
|
*
|
|
18
18
|
* is-mobile -- 4.0.0
|
|
19
19
|
*/
|
|
@@ -546,46 +546,40 @@
|
|
|
546
546
|
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
|
-
var store;
|
|
550
|
-
function getGlobalConfig(
|
|
551
|
-
var
|
|
549
|
+
var store$4;
|
|
550
|
+
function getGlobalConfig(config$1) {
|
|
551
|
+
var _config$1$lang, _store$, _config$1$abortEarly, _store$2, _config$1$abortPipeEa, _store$3;
|
|
552
552
|
return {
|
|
553
|
-
lang: (
|
|
554
|
-
message:
|
|
555
|
-
abortEarly: (
|
|
556
|
-
abortPipeEarly: (
|
|
553
|
+
lang: (_config$1$lang = config$1 === null || config$1 === void 0 ? void 0 : config$1.lang) !== null && _config$1$lang !== void 0 ? _config$1$lang : (_store$ = store$4) === null || _store$ === void 0 ? void 0 : _store$.lang,
|
|
554
|
+
message: config$1 === null || config$1 === void 0 ? void 0 : config$1.message,
|
|
555
|
+
abortEarly: (_config$1$abortEarly = config$1 === null || config$1 === void 0 ? void 0 : config$1.abortEarly) !== null && _config$1$abortEarly !== void 0 ? _config$1$abortEarly : (_store$2 = store$4) === null || _store$2 === void 0 ? void 0 : _store$2.abortEarly,
|
|
556
|
+
abortPipeEarly: (_config$1$abortPipeEa = config$1 === null || config$1 === void 0 ? void 0 : config$1.abortPipeEarly) !== null && _config$1$abortPipeEa !== void 0 ? _config$1$abortPipeEa : (_store$3 = store$4) === null || _store$3 === void 0 ? void 0 : _store$3.abortPipeEarly
|
|
557
557
|
};
|
|
558
558
|
}
|
|
559
|
-
var
|
|
559
|
+
var store$3;
|
|
560
560
|
function getGlobalMessage(lang) {
|
|
561
|
-
var
|
|
562
|
-
return (
|
|
561
|
+
var _store$4;
|
|
562
|
+
return (_store$4 = store$3) === null || _store$4 === void 0 ? void 0 : _store$4.get(lang);
|
|
563
563
|
}
|
|
564
|
-
var
|
|
564
|
+
var store$2;
|
|
565
565
|
function getSchemaMessage(lang) {
|
|
566
|
-
var
|
|
567
|
-
return (
|
|
566
|
+
var _store$6;
|
|
567
|
+
return (_store$6 = store$2) === null || _store$6 === void 0 ? void 0 : _store$6.get(lang);
|
|
568
568
|
}
|
|
569
|
-
var
|
|
569
|
+
var store$1;
|
|
570
570
|
function getSpecificMessage(reference, lang) {
|
|
571
|
-
var
|
|
572
|
-
return (
|
|
571
|
+
var _store$8;
|
|
572
|
+
return (_store$8 = store$1) === null || _store$8 === void 0 || (_store$8 = _store$8.get(reference)) === null || _store$8 === void 0 ? void 0 : _store$8.get(lang);
|
|
573
573
|
}
|
|
574
574
|
function _stringify(input) {
|
|
575
|
+
var _ref, _Object$getPrototypeO;
|
|
575
576
|
var type = _typeof(input);
|
|
576
|
-
if (type === "string")
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
if (type === "number" || type === "bigint" || type === "boolean") {
|
|
580
|
-
return "".concat(input);
|
|
581
|
-
}
|
|
582
|
-
if (type === "object" || type === "function") {
|
|
583
|
-
var _ref, _Object$getPrototypeO;
|
|
584
|
-
return (_ref = input && ((_Object$getPrototypeO = Object.getPrototypeOf(input)) === null || _Object$getPrototypeO === void 0 || (_Object$getPrototypeO = _Object$getPrototypeO.constructor) === null || _Object$getPrototypeO === void 0 ? void 0 : _Object$getPrototypeO.name)) !== null && _ref !== void 0 ? _ref : "null";
|
|
585
|
-
}
|
|
577
|
+
if (type === "string") return '"'.concat(input, '"');
|
|
578
|
+
if (type === "number" || type === "bigint" || type === "boolean") return "".concat(input);
|
|
579
|
+
if (type === "object" || type === "function") return (_ref = input && ((_Object$getPrototypeO = Object.getPrototypeOf(input)) === null || _Object$getPrototypeO === void 0 || (_Object$getPrototypeO = _Object$getPrototypeO.constructor) === null || _Object$getPrototypeO === void 0 ? void 0 : _Object$getPrototypeO.name)) !== null && _ref !== void 0 ? _ref : "null";
|
|
586
580
|
return type;
|
|
587
581
|
}
|
|
588
|
-
function _addIssue(context, label, dataset,
|
|
582
|
+
function _addIssue(context, label, dataset, config$1, other) {
|
|
589
583
|
var _ref2, _other$expected, _other$received, _ref3, _ref4, _ref5, _ref6, _other$message;
|
|
590
584
|
var input = other && "input" in other ? other.input : dataset.value;
|
|
591
585
|
var expected = (_ref2 = (_other$expected = other === null || other === void 0 ? void 0 : other.expected) !== null && _other$expected !== void 0 ? _other$expected : context.expects) !== null && _ref2 !== void 0 ? _ref2 : null;
|
|
@@ -600,65 +594,53 @@
|
|
|
600
594
|
requirement: context.requirement,
|
|
601
595
|
path: other === null || other === void 0 ? void 0 : other.path,
|
|
602
596
|
issues: other === null || other === void 0 ? void 0 : other.issues,
|
|
603
|
-
lang:
|
|
604
|
-
abortEarly:
|
|
605
|
-
abortPipeEarly:
|
|
597
|
+
lang: config$1.lang,
|
|
598
|
+
abortEarly: config$1.abortEarly,
|
|
599
|
+
abortPipeEarly: config$1.abortPipeEarly
|
|
606
600
|
};
|
|
607
601
|
var isSchema = context.kind === "schema";
|
|
608
|
-
var
|
|
609
|
-
if (
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
if (isSchema) {
|
|
613
|
-
dataset.typed = false;
|
|
614
|
-
}
|
|
615
|
-
if (dataset.issues) {
|
|
616
|
-
dataset.issues.push(issue);
|
|
617
|
-
} else {
|
|
618
|
-
dataset.issues = [ issue ];
|
|
619
|
-
}
|
|
602
|
+
var message$1 = (_ref3 = (_ref4 = (_ref5 = (_ref6 = (_other$message = other === null || other === void 0 ? void 0 : other.message) !== null && _other$message !== void 0 ? _other$message : context.message) !== null && _ref6 !== void 0 ? _ref6 : getSpecificMessage(context.reference, issue.lang)) !== null && _ref5 !== void 0 ? _ref5 : isSchema ? getSchemaMessage(issue.lang) : null) !== null && _ref4 !== void 0 ? _ref4 : config$1.message) !== null && _ref3 !== void 0 ? _ref3 : getGlobalMessage(issue.lang);
|
|
603
|
+
if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1;
|
|
604
|
+
if (isSchema) dataset.typed = false;
|
|
605
|
+
if (dataset.issues) dataset.issues.push(issue); else dataset.issues = [ issue ];
|
|
620
606
|
}
|
|
621
607
|
function _getStandardProps(context) {
|
|
622
608
|
return {
|
|
623
609
|
version: 1,
|
|
624
610
|
vendor: "valibot",
|
|
625
|
-
validate: function validate(
|
|
611
|
+
validate: function validate(value$1) {
|
|
626
612
|
return context["~run"]({
|
|
627
|
-
value:
|
|
613
|
+
value: value$1
|
|
628
614
|
}, getGlobalConfig());
|
|
629
615
|
}
|
|
630
616
|
};
|
|
631
617
|
}
|
|
632
|
-
function _isValidObjectKey(
|
|
633
|
-
return Object.hasOwn(
|
|
618
|
+
function _isValidObjectKey(object$1, key) {
|
|
619
|
+
return Object.hasOwn(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor";
|
|
634
620
|
}
|
|
635
|
-
function _joinExpects(
|
|
621
|
+
function _joinExpects(values$1, separator) {
|
|
636
622
|
var _list$;
|
|
637
|
-
var list = _toConsumableArray(new Set(
|
|
638
|
-
if (list.length > 1)
|
|
639
|
-
return "(".concat(list.join(" ".concat(separator, " ")), ")");
|
|
640
|
-
}
|
|
623
|
+
var list = _toConsumableArray(new Set(values$1));
|
|
624
|
+
if (list.length > 1) return "(".concat(list.join(" ".concat(separator, " ")), ")");
|
|
641
625
|
return (_list$ = list[0]) !== null && _list$ !== void 0 ? _list$ : "never";
|
|
642
626
|
}
|
|
643
|
-
function nonEmpty(
|
|
627
|
+
function nonEmpty(message$1) {
|
|
644
628
|
return {
|
|
645
629
|
kind: "validation",
|
|
646
630
|
type: "non_empty",
|
|
647
631
|
reference: nonEmpty,
|
|
648
632
|
async: false,
|
|
649
633
|
expects: "!0",
|
|
650
|
-
message:
|
|
651
|
-
"~run": function run(dataset,
|
|
652
|
-
if (dataset.typed && dataset.value.length === 0) {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
});
|
|
656
|
-
}
|
|
634
|
+
message: message$1,
|
|
635
|
+
"~run": function run(dataset, config$1) {
|
|
636
|
+
if (dataset.typed && dataset.value.length === 0) _addIssue(this, "length", dataset, config$1, {
|
|
637
|
+
received: "0"
|
|
638
|
+
});
|
|
657
639
|
return dataset;
|
|
658
640
|
}
|
|
659
641
|
};
|
|
660
642
|
}
|
|
661
|
-
function url(
|
|
643
|
+
function url(message$1) {
|
|
662
644
|
return {
|
|
663
645
|
kind: "validation",
|
|
664
646
|
type: "url",
|
|
@@ -669,24 +651,22 @@
|
|
|
669
651
|
try {
|
|
670
652
|
new URL(input);
|
|
671
653
|
return true;
|
|
672
|
-
} catch (
|
|
654
|
+
} catch (_unused5) {
|
|
673
655
|
return false;
|
|
674
656
|
}
|
|
675
657
|
},
|
|
676
|
-
message:
|
|
677
|
-
"~run": function run(dataset,
|
|
678
|
-
if (dataset.typed && !this.requirement(dataset.value))
|
|
679
|
-
_addIssue(this, "URL", dataset, config2);
|
|
680
|
-
}
|
|
658
|
+
message: message$1,
|
|
659
|
+
"~run": function run(dataset, config$1) {
|
|
660
|
+
if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "URL", dataset, config$1);
|
|
681
661
|
return dataset;
|
|
682
662
|
}
|
|
683
663
|
};
|
|
684
664
|
}
|
|
685
|
-
function getFallback(schema, dataset,
|
|
686
|
-
return typeof schema.fallback === "function" ? schema.fallback(dataset,
|
|
665
|
+
function getFallback(schema, dataset, config$1) {
|
|
666
|
+
return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback;
|
|
687
667
|
}
|
|
688
|
-
function getDefault(schema, dataset,
|
|
689
|
-
return typeof schema["default"] === "function" ? schema["default"](dataset,
|
|
668
|
+
function getDefault(schema, dataset, config$1) {
|
|
669
|
+
return typeof schema["default"] === "function" ? schema["default"](dataset, config$1) : schema["default"];
|
|
690
670
|
}
|
|
691
671
|
function any() {
|
|
692
672
|
return {
|
|
@@ -704,7 +684,7 @@
|
|
|
704
684
|
}
|
|
705
685
|
};
|
|
706
686
|
}
|
|
707
|
-
function array(item,
|
|
687
|
+
function array(item, message$1) {
|
|
708
688
|
return {
|
|
709
689
|
kind: "schema",
|
|
710
690
|
type: "array",
|
|
@@ -712,87 +692,73 @@
|
|
|
712
692
|
expects: "Array",
|
|
713
693
|
async: false,
|
|
714
694
|
item: item,
|
|
715
|
-
message:
|
|
695
|
+
message: message$1,
|
|
716
696
|
get "~standard"() {
|
|
717
697
|
return _getStandardProps(this);
|
|
718
698
|
},
|
|
719
|
-
"~run": function run(dataset,
|
|
699
|
+
"~run": function run(dataset, config$1) {
|
|
720
700
|
var input = dataset.value;
|
|
721
701
|
if (Array.isArray(input)) {
|
|
722
702
|
dataset.typed = true;
|
|
723
703
|
dataset.value = [];
|
|
724
704
|
for (var key = 0; key < input.length; key++) {
|
|
725
|
-
var
|
|
705
|
+
var value$1 = input[key];
|
|
726
706
|
var itemDataset = this.item["~run"]({
|
|
727
|
-
value:
|
|
728
|
-
},
|
|
707
|
+
value: value$1
|
|
708
|
+
}, config$1);
|
|
729
709
|
if (itemDataset.issues) {
|
|
730
710
|
var pathItem = {
|
|
731
711
|
type: "array",
|
|
732
712
|
origin: "value",
|
|
733
713
|
input: input,
|
|
734
714
|
key: key,
|
|
735
|
-
value:
|
|
715
|
+
value: value$1
|
|
736
716
|
};
|
|
737
|
-
var
|
|
717
|
+
var _iterator15 = _createForOfIteratorHelper(itemDataset.issues), _step15;
|
|
738
718
|
try {
|
|
739
|
-
for (
|
|
719
|
+
for (_iterator15.s(); !(_step15 = _iterator15.n()).done; ) {
|
|
740
720
|
var _dataset$issues;
|
|
741
|
-
var issue =
|
|
742
|
-
if (issue.path)
|
|
743
|
-
issue.path.unshift(pathItem);
|
|
744
|
-
} else {
|
|
745
|
-
issue.path = [ pathItem ];
|
|
746
|
-
}
|
|
721
|
+
var issue = _step15.value;
|
|
722
|
+
if (issue.path) issue.path.unshift(pathItem); else issue.path = [ pathItem ];
|
|
747
723
|
(_dataset$issues = dataset.issues) === null || _dataset$issues === void 0 || _dataset$issues.push(issue);
|
|
748
724
|
}
|
|
749
725
|
} catch (err) {
|
|
750
|
-
|
|
726
|
+
_iterator15.e(err);
|
|
751
727
|
} finally {
|
|
752
|
-
|
|
753
|
-
}
|
|
754
|
-
if (!dataset.issues) {
|
|
755
|
-
dataset.issues = itemDataset.issues;
|
|
728
|
+
_iterator15.f();
|
|
756
729
|
}
|
|
757
|
-
if (
|
|
730
|
+
if (!dataset.issues) dataset.issues = itemDataset.issues;
|
|
731
|
+
if (config$1.abortEarly) {
|
|
758
732
|
dataset.typed = false;
|
|
759
733
|
break;
|
|
760
734
|
}
|
|
761
735
|
}
|
|
762
|
-
if (!itemDataset.typed)
|
|
763
|
-
dataset.typed = false;
|
|
764
|
-
}
|
|
736
|
+
if (!itemDataset.typed) dataset.typed = false;
|
|
765
737
|
dataset.value.push(itemDataset.value);
|
|
766
738
|
}
|
|
767
|
-
} else
|
|
768
|
-
_addIssue(this, "type", dataset, config2);
|
|
769
|
-
}
|
|
739
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
770
740
|
return dataset;
|
|
771
741
|
}
|
|
772
742
|
};
|
|
773
743
|
}
|
|
774
|
-
function _boolean(
|
|
744
|
+
function _boolean(message$1) {
|
|
775
745
|
return {
|
|
776
746
|
kind: "schema",
|
|
777
747
|
type: "boolean",
|
|
778
748
|
reference: _boolean,
|
|
779
749
|
expects: "boolean",
|
|
780
750
|
async: false,
|
|
781
|
-
message:
|
|
751
|
+
message: message$1,
|
|
782
752
|
get "~standard"() {
|
|
783
753
|
return _getStandardProps(this);
|
|
784
754
|
},
|
|
785
|
-
"~run": function run(dataset,
|
|
786
|
-
if (typeof dataset.value === "boolean")
|
|
787
|
-
dataset.typed = true;
|
|
788
|
-
} else {
|
|
789
|
-
_addIssue(this, "type", dataset, config2);
|
|
790
|
-
}
|
|
755
|
+
"~run": function run(dataset, config$1) {
|
|
756
|
+
if (typeof dataset.value === "boolean") dataset.typed = true; else _addIssue(this, "type", dataset, config$1);
|
|
791
757
|
return dataset;
|
|
792
758
|
}
|
|
793
759
|
};
|
|
794
760
|
}
|
|
795
|
-
function literal(literal_,
|
|
761
|
+
function literal(literal_, message$1) {
|
|
796
762
|
return {
|
|
797
763
|
kind: "schema",
|
|
798
764
|
type: "literal",
|
|
@@ -800,54 +766,46 @@
|
|
|
800
766
|
expects: _stringify(literal_),
|
|
801
767
|
async: false,
|
|
802
768
|
literal: literal_,
|
|
803
|
-
message:
|
|
769
|
+
message: message$1,
|
|
804
770
|
get "~standard"() {
|
|
805
771
|
return _getStandardProps(this);
|
|
806
772
|
},
|
|
807
|
-
"~run": function run(dataset,
|
|
808
|
-
if (dataset.value === this.literal)
|
|
809
|
-
dataset.typed = true;
|
|
810
|
-
} else {
|
|
811
|
-
_addIssue(this, "type", dataset, config2);
|
|
812
|
-
}
|
|
773
|
+
"~run": function run(dataset, config$1) {
|
|
774
|
+
if (dataset.value === this.literal) dataset.typed = true; else _addIssue(this, "type", dataset, config$1);
|
|
813
775
|
return dataset;
|
|
814
776
|
}
|
|
815
777
|
};
|
|
816
778
|
}
|
|
817
|
-
function number(
|
|
779
|
+
function number(message$1) {
|
|
818
780
|
return {
|
|
819
781
|
kind: "schema",
|
|
820
782
|
type: "number",
|
|
821
783
|
reference: number,
|
|
822
784
|
expects: "number",
|
|
823
785
|
async: false,
|
|
824
|
-
message:
|
|
786
|
+
message: message$1,
|
|
825
787
|
get "~standard"() {
|
|
826
788
|
return _getStandardProps(this);
|
|
827
789
|
},
|
|
828
|
-
"~run": function run(dataset,
|
|
829
|
-
if (typeof dataset.value === "number" && !isNaN(dataset.value))
|
|
830
|
-
dataset.typed = true;
|
|
831
|
-
} else {
|
|
832
|
-
_addIssue(this, "type", dataset, config2);
|
|
833
|
-
}
|
|
790
|
+
"~run": function run(dataset, config$1) {
|
|
791
|
+
if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true; else _addIssue(this, "type", dataset, config$1);
|
|
834
792
|
return dataset;
|
|
835
793
|
}
|
|
836
794
|
};
|
|
837
795
|
}
|
|
838
|
-
function object(
|
|
796
|
+
function object(entries$1, message$1) {
|
|
839
797
|
return {
|
|
840
798
|
kind: "schema",
|
|
841
799
|
type: "object",
|
|
842
800
|
reference: object,
|
|
843
801
|
expects: "Object",
|
|
844
802
|
async: false,
|
|
845
|
-
entries:
|
|
846
|
-
message:
|
|
803
|
+
entries: entries$1,
|
|
804
|
+
message: message$1,
|
|
847
805
|
get "~standard"() {
|
|
848
806
|
return _getStandardProps(this);
|
|
849
807
|
},
|
|
850
|
-
"~run": function run(dataset,
|
|
808
|
+
"~run": function run(dataset, config$1) {
|
|
851
809
|
var input = dataset.value;
|
|
852
810
|
if (input && _typeof(input) === "object") {
|
|
853
811
|
dataset.typed = true;
|
|
@@ -855,51 +813,41 @@
|
|
|
855
813
|
for (var key in this.entries) {
|
|
856
814
|
var valueSchema = this.entries[key];
|
|
857
815
|
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema["default"] !== void 0) {
|
|
858
|
-
var
|
|
816
|
+
var value$1 = key in input ? input[key] : getDefault(valueSchema);
|
|
859
817
|
var valueDataset = valueSchema["~run"]({
|
|
860
|
-
value:
|
|
861
|
-
},
|
|
818
|
+
value: value$1
|
|
819
|
+
}, config$1);
|
|
862
820
|
if (valueDataset.issues) {
|
|
863
821
|
var pathItem = {
|
|
864
822
|
type: "object",
|
|
865
823
|
origin: "value",
|
|
866
824
|
input: input,
|
|
867
825
|
key: key,
|
|
868
|
-
value:
|
|
826
|
+
value: value$1
|
|
869
827
|
};
|
|
870
|
-
var
|
|
828
|
+
var _iterator31 = _createForOfIteratorHelper(valueDataset.issues), _step31;
|
|
871
829
|
try {
|
|
872
|
-
for (
|
|
830
|
+
for (_iterator31.s(); !(_step31 = _iterator31.n()).done; ) {
|
|
873
831
|
var _dataset$issues13;
|
|
874
|
-
var issue =
|
|
875
|
-
if (issue.path)
|
|
876
|
-
issue.path.unshift(pathItem);
|
|
877
|
-
} else {
|
|
878
|
-
issue.path = [ pathItem ];
|
|
879
|
-
}
|
|
832
|
+
var issue = _step31.value;
|
|
833
|
+
if (issue.path) issue.path.unshift(pathItem); else issue.path = [ pathItem ];
|
|
880
834
|
(_dataset$issues13 = dataset.issues) === null || _dataset$issues13 === void 0 || _dataset$issues13.push(issue);
|
|
881
835
|
}
|
|
882
836
|
} catch (err) {
|
|
883
|
-
|
|
837
|
+
_iterator31.e(err);
|
|
884
838
|
} finally {
|
|
885
|
-
|
|
886
|
-
}
|
|
887
|
-
if (!dataset.issues) {
|
|
888
|
-
dataset.issues = valueDataset.issues;
|
|
839
|
+
_iterator31.f();
|
|
889
840
|
}
|
|
890
|
-
if (
|
|
841
|
+
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
842
|
+
if (config$1.abortEarly) {
|
|
891
843
|
dataset.typed = false;
|
|
892
844
|
break;
|
|
893
845
|
}
|
|
894
846
|
}
|
|
895
|
-
if (!valueDataset.typed)
|
|
896
|
-
dataset.typed = false;
|
|
897
|
-
}
|
|
847
|
+
if (!valueDataset.typed) dataset.typed = false;
|
|
898
848
|
dataset.value[key] = valueDataset.value;
|
|
899
|
-
} else if (valueSchema.fallback !== void 0) {
|
|
900
|
-
|
|
901
|
-
} else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
902
|
-
_addIssue(this, "key", dataset, config2, {
|
|
849
|
+
} else if (valueSchema.fallback !== void 0) dataset.value[key] = getFallback(valueSchema); else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
850
|
+
_addIssue(this, "key", dataset, config$1, {
|
|
903
851
|
input: void 0,
|
|
904
852
|
expected: '"'.concat(key, '"'),
|
|
905
853
|
path: [ {
|
|
@@ -910,14 +858,10 @@
|
|
|
910
858
|
value: input[key]
|
|
911
859
|
} ]
|
|
912
860
|
});
|
|
913
|
-
if (
|
|
914
|
-
break;
|
|
915
|
-
}
|
|
861
|
+
if (config$1.abortEarly) break;
|
|
916
862
|
}
|
|
917
863
|
}
|
|
918
|
-
} else
|
|
919
|
-
_addIssue(this, "type", dataset, config2);
|
|
920
|
-
}
|
|
864
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
921
865
|
return dataset;
|
|
922
866
|
}
|
|
923
867
|
};
|
|
@@ -934,21 +878,19 @@
|
|
|
934
878
|
get "~standard"() {
|
|
935
879
|
return _getStandardProps(this);
|
|
936
880
|
},
|
|
937
|
-
"~run": function run(dataset,
|
|
881
|
+
"~run": function run(dataset, config$1) {
|
|
938
882
|
if (dataset.value === void 0) {
|
|
939
|
-
if (this["default"] !== void 0)
|
|
940
|
-
dataset.value = getDefault(this, dataset, config2);
|
|
941
|
-
}
|
|
883
|
+
if (this["default"] !== void 0) dataset.value = getDefault(this, dataset, config$1);
|
|
942
884
|
if (dataset.value === void 0) {
|
|
943
885
|
dataset.typed = true;
|
|
944
886
|
return dataset;
|
|
945
887
|
}
|
|
946
888
|
}
|
|
947
|
-
return this.wrapped["~run"](dataset,
|
|
889
|
+
return this.wrapped["~run"](dataset, config$1);
|
|
948
890
|
}
|
|
949
891
|
};
|
|
950
892
|
}
|
|
951
|
-
function picklist(options,
|
|
893
|
+
function picklist(options, message$1) {
|
|
952
894
|
return {
|
|
953
895
|
kind: "schema",
|
|
954
896
|
type: "picklist",
|
|
@@ -956,21 +898,17 @@
|
|
|
956
898
|
expects: _joinExpects(options.map(_stringify), "|"),
|
|
957
899
|
async: false,
|
|
958
900
|
options: options,
|
|
959
|
-
message:
|
|
901
|
+
message: message$1,
|
|
960
902
|
get "~standard"() {
|
|
961
903
|
return _getStandardProps(this);
|
|
962
904
|
},
|
|
963
|
-
"~run": function run(dataset,
|
|
964
|
-
if (this.options.includes(dataset.value))
|
|
965
|
-
dataset.typed = true;
|
|
966
|
-
} else {
|
|
967
|
-
_addIssue(this, "type", dataset, config2);
|
|
968
|
-
}
|
|
905
|
+
"~run": function run(dataset, config$1) {
|
|
906
|
+
if (this.options.includes(dataset.value)) dataset.typed = true; else _addIssue(this, "type", dataset, config$1);
|
|
969
907
|
return dataset;
|
|
970
908
|
}
|
|
971
909
|
};
|
|
972
910
|
}
|
|
973
|
-
function record(key,
|
|
911
|
+
function record(key, value$1, message$1) {
|
|
974
912
|
return {
|
|
975
913
|
kind: "schema",
|
|
976
914
|
type: "record",
|
|
@@ -978,115 +916,99 @@
|
|
|
978
916
|
expects: "Object",
|
|
979
917
|
async: false,
|
|
980
918
|
key: key,
|
|
981
|
-
value:
|
|
982
|
-
message:
|
|
919
|
+
value: value$1,
|
|
920
|
+
message: message$1,
|
|
983
921
|
get "~standard"() {
|
|
984
922
|
return _getStandardProps(this);
|
|
985
923
|
},
|
|
986
|
-
"~run": function run(dataset,
|
|
924
|
+
"~run": function run(dataset, config$1) {
|
|
987
925
|
var input = dataset.value;
|
|
988
926
|
if (input && _typeof(input) === "object") {
|
|
989
927
|
dataset.typed = true;
|
|
990
928
|
dataset.value = {};
|
|
991
|
-
for (var entryKey in input) {
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
(_dataset$issues19 = dataset.issues) === null || _dataset$issues19 === void 0 || _dataset$issues19.push(issue);
|
|
1012
|
-
}
|
|
1013
|
-
} catch (err) {
|
|
1014
|
-
_iterator39.e(err);
|
|
1015
|
-
} finally {
|
|
1016
|
-
_iterator39.f();
|
|
1017
|
-
}
|
|
1018
|
-
if (!dataset.issues) {
|
|
1019
|
-
dataset.issues = keyDataset.issues;
|
|
1020
|
-
}
|
|
1021
|
-
if (config2.abortEarly) {
|
|
1022
|
-
dataset.typed = false;
|
|
1023
|
-
break;
|
|
929
|
+
for (var entryKey in input) if (_isValidObjectKey(input, entryKey)) {
|
|
930
|
+
var entryValue = input[entryKey];
|
|
931
|
+
var keyDataset = this.key["~run"]({
|
|
932
|
+
value: entryKey
|
|
933
|
+
}, config$1);
|
|
934
|
+
if (keyDataset.issues) {
|
|
935
|
+
var pathItem = {
|
|
936
|
+
type: "object",
|
|
937
|
+
origin: "key",
|
|
938
|
+
input: input,
|
|
939
|
+
key: entryKey,
|
|
940
|
+
value: entryValue
|
|
941
|
+
};
|
|
942
|
+
var _iterator40 = _createForOfIteratorHelper(keyDataset.issues), _step40;
|
|
943
|
+
try {
|
|
944
|
+
for (_iterator40.s(); !(_step40 = _iterator40.n()).done; ) {
|
|
945
|
+
var _dataset$issues19;
|
|
946
|
+
var issue = _step40.value;
|
|
947
|
+
issue.path = [ pathItem ];
|
|
948
|
+
(_dataset$issues19 = dataset.issues) === null || _dataset$issues19 === void 0 || _dataset$issues19.push(issue);
|
|
1024
949
|
}
|
|
950
|
+
} catch (err) {
|
|
951
|
+
_iterator40.e(err);
|
|
952
|
+
} finally {
|
|
953
|
+
_iterator40.f();
|
|
954
|
+
}
|
|
955
|
+
if (!dataset.issues) dataset.issues = keyDataset.issues;
|
|
956
|
+
if (config$1.abortEarly) {
|
|
957
|
+
dataset.typed = false;
|
|
958
|
+
break;
|
|
1025
959
|
}
|
|
1026
|
-
|
|
960
|
+
}
|
|
961
|
+
var valueDataset = this.value["~run"]({
|
|
962
|
+
value: entryValue
|
|
963
|
+
}, config$1);
|
|
964
|
+
if (valueDataset.issues) {
|
|
965
|
+
var _pathItem5 = {
|
|
966
|
+
type: "object",
|
|
967
|
+
origin: "value",
|
|
968
|
+
input: input,
|
|
969
|
+
key: entryKey,
|
|
1027
970
|
value: entryValue
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
};
|
|
1037
|
-
var _iterator40 = _createForOfIteratorHelper(valueDataset.issues), _step40;
|
|
1038
|
-
try {
|
|
1039
|
-
for (_iterator40.s(); !(_step40 = _iterator40.n()).done; ) {
|
|
1040
|
-
var _dataset$issues20;
|
|
1041
|
-
var _issue5 = _step40.value;
|
|
1042
|
-
if (_issue5.path) {
|
|
1043
|
-
_issue5.path.unshift(_pathItem5);
|
|
1044
|
-
} else {
|
|
1045
|
-
_issue5.path = [ _pathItem5 ];
|
|
1046
|
-
}
|
|
1047
|
-
(_dataset$issues20 = dataset.issues) === null || _dataset$issues20 === void 0 || _dataset$issues20.push(_issue5);
|
|
1048
|
-
}
|
|
1049
|
-
} catch (err) {
|
|
1050
|
-
_iterator40.e(err);
|
|
1051
|
-
} finally {
|
|
1052
|
-
_iterator40.f();
|
|
1053
|
-
}
|
|
1054
|
-
if (!dataset.issues) {
|
|
1055
|
-
dataset.issues = valueDataset.issues;
|
|
1056
|
-
}
|
|
1057
|
-
if (config2.abortEarly) {
|
|
1058
|
-
dataset.typed = false;
|
|
1059
|
-
break;
|
|
971
|
+
};
|
|
972
|
+
var _iterator41 = _createForOfIteratorHelper(valueDataset.issues), _step41;
|
|
973
|
+
try {
|
|
974
|
+
for (_iterator41.s(); !(_step41 = _iterator41.n()).done; ) {
|
|
975
|
+
var _dataset$issues20;
|
|
976
|
+
var _issue5 = _step41.value;
|
|
977
|
+
if (_issue5.path) _issue5.path.unshift(_pathItem5); else _issue5.path = [ _pathItem5 ];
|
|
978
|
+
(_dataset$issues20 = dataset.issues) === null || _dataset$issues20 === void 0 || _dataset$issues20.push(_issue5);
|
|
1060
979
|
}
|
|
980
|
+
} catch (err) {
|
|
981
|
+
_iterator41.e(err);
|
|
982
|
+
} finally {
|
|
983
|
+
_iterator41.f();
|
|
1061
984
|
}
|
|
1062
|
-
if (!
|
|
985
|
+
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
986
|
+
if (config$1.abortEarly) {
|
|
1063
987
|
dataset.typed = false;
|
|
1064
|
-
|
|
1065
|
-
if (keyDataset.typed) {
|
|
1066
|
-
dataset.value[keyDataset.value] = valueDataset.value;
|
|
988
|
+
break;
|
|
1067
989
|
}
|
|
1068
990
|
}
|
|
991
|
+
if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;
|
|
992
|
+
if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;
|
|
1069
993
|
}
|
|
1070
|
-
} else
|
|
1071
|
-
_addIssue(this, "type", dataset, config2);
|
|
1072
|
-
}
|
|
994
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
1073
995
|
return dataset;
|
|
1074
996
|
}
|
|
1075
997
|
};
|
|
1076
998
|
}
|
|
1077
|
-
function strictObject(
|
|
999
|
+
function strictObject(entries$1, message$1) {
|
|
1078
1000
|
return {
|
|
1079
1001
|
kind: "schema",
|
|
1080
1002
|
type: "strict_object",
|
|
1081
1003
|
reference: strictObject,
|
|
1082
1004
|
expects: "Object",
|
|
1083
1005
|
async: false,
|
|
1084
|
-
entries:
|
|
1085
|
-
message:
|
|
1006
|
+
entries: entries$1,
|
|
1007
|
+
message: message$1,
|
|
1086
1008
|
get "~standard"() {
|
|
1087
1009
|
return _getStandardProps(this);
|
|
1088
1010
|
},
|
|
1089
|
-
"~run": function run(dataset,
|
|
1011
|
+
"~run": function run(dataset, config$1) {
|
|
1090
1012
|
var input = dataset.value;
|
|
1091
1013
|
if (input && _typeof(input) === "object") {
|
|
1092
1014
|
dataset.typed = true;
|
|
@@ -1094,51 +1016,41 @@
|
|
|
1094
1016
|
for (var key in this.entries) {
|
|
1095
1017
|
var valueSchema = this.entries[key];
|
|
1096
1018
|
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema["default"] !== void 0) {
|
|
1097
|
-
var
|
|
1019
|
+
var value$1 = key in input ? input[key] : getDefault(valueSchema);
|
|
1098
1020
|
var valueDataset = valueSchema["~run"]({
|
|
1099
|
-
value:
|
|
1100
|
-
},
|
|
1021
|
+
value: value$1
|
|
1022
|
+
}, config$1);
|
|
1101
1023
|
if (valueDataset.issues) {
|
|
1102
1024
|
var pathItem = {
|
|
1103
1025
|
type: "object",
|
|
1104
1026
|
origin: "value",
|
|
1105
1027
|
input: input,
|
|
1106
1028
|
key: key,
|
|
1107
|
-
value:
|
|
1029
|
+
value: value$1
|
|
1108
1030
|
};
|
|
1109
|
-
var
|
|
1031
|
+
var _iterator49 = _createForOfIteratorHelper(valueDataset.issues), _step49;
|
|
1110
1032
|
try {
|
|
1111
|
-
for (
|
|
1033
|
+
for (_iterator49.s(); !(_step49 = _iterator49.n()).done; ) {
|
|
1112
1034
|
var _dataset$issues25;
|
|
1113
|
-
var issue =
|
|
1114
|
-
if (issue.path)
|
|
1115
|
-
issue.path.unshift(pathItem);
|
|
1116
|
-
} else {
|
|
1117
|
-
issue.path = [ pathItem ];
|
|
1118
|
-
}
|
|
1035
|
+
var issue = _step49.value;
|
|
1036
|
+
if (issue.path) issue.path.unshift(pathItem); else issue.path = [ pathItem ];
|
|
1119
1037
|
(_dataset$issues25 = dataset.issues) === null || _dataset$issues25 === void 0 || _dataset$issues25.push(issue);
|
|
1120
1038
|
}
|
|
1121
1039
|
} catch (err) {
|
|
1122
|
-
|
|
1040
|
+
_iterator49.e(err);
|
|
1123
1041
|
} finally {
|
|
1124
|
-
|
|
1125
|
-
}
|
|
1126
|
-
if (!dataset.issues) {
|
|
1127
|
-
dataset.issues = valueDataset.issues;
|
|
1042
|
+
_iterator49.f();
|
|
1128
1043
|
}
|
|
1129
|
-
if (
|
|
1044
|
+
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
1045
|
+
if (config$1.abortEarly) {
|
|
1130
1046
|
dataset.typed = false;
|
|
1131
1047
|
break;
|
|
1132
1048
|
}
|
|
1133
1049
|
}
|
|
1134
|
-
if (!valueDataset.typed)
|
|
1135
|
-
dataset.typed = false;
|
|
1136
|
-
}
|
|
1050
|
+
if (!valueDataset.typed) dataset.typed = false;
|
|
1137
1051
|
dataset.value[key] = valueDataset.value;
|
|
1138
|
-
} else if (valueSchema.fallback !== void 0) {
|
|
1139
|
-
|
|
1140
|
-
} else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
1141
|
-
_addIssue(this, "key", dataset, config2, {
|
|
1052
|
+
} else if (valueSchema.fallback !== void 0) dataset.value[key] = getFallback(valueSchema); else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
1053
|
+
_addIssue(this, "key", dataset, config$1, {
|
|
1142
1054
|
input: void 0,
|
|
1143
1055
|
expected: '"'.concat(key, '"'),
|
|
1144
1056
|
path: [ {
|
|
@@ -1149,53 +1061,43 @@
|
|
|
1149
1061
|
value: input[key]
|
|
1150
1062
|
} ]
|
|
1151
1063
|
});
|
|
1152
|
-
if (
|
|
1153
|
-
break;
|
|
1154
|
-
}
|
|
1064
|
+
if (config$1.abortEarly) break;
|
|
1155
1065
|
}
|
|
1156
1066
|
}
|
|
1157
|
-
if (!dataset.issues || !
|
|
1158
|
-
for (var _key9 in input) {
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
break;
|
|
1172
|
-
}
|
|
1067
|
+
if (!dataset.issues || !config$1.abortEarly) {
|
|
1068
|
+
for (var _key9 in input) if (!(_key9 in this.entries)) {
|
|
1069
|
+
_addIssue(this, "key", dataset, config$1, {
|
|
1070
|
+
input: _key9,
|
|
1071
|
+
expected: "never",
|
|
1072
|
+
path: [ {
|
|
1073
|
+
type: "object",
|
|
1074
|
+
origin: "key",
|
|
1075
|
+
input: input,
|
|
1076
|
+
key: _key9,
|
|
1077
|
+
value: input[_key9]
|
|
1078
|
+
} ]
|
|
1079
|
+
});
|
|
1080
|
+
break;
|
|
1173
1081
|
}
|
|
1174
1082
|
}
|
|
1175
|
-
} else
|
|
1176
|
-
_addIssue(this, "type", dataset, config2);
|
|
1177
|
-
}
|
|
1083
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
1178
1084
|
return dataset;
|
|
1179
1085
|
}
|
|
1180
1086
|
};
|
|
1181
1087
|
}
|
|
1182
|
-
function string(
|
|
1088
|
+
function string(message$1) {
|
|
1183
1089
|
return {
|
|
1184
1090
|
kind: "schema",
|
|
1185
1091
|
type: "string",
|
|
1186
1092
|
reference: string,
|
|
1187
1093
|
expects: "string",
|
|
1188
1094
|
async: false,
|
|
1189
|
-
message:
|
|
1095
|
+
message: message$1,
|
|
1190
1096
|
get "~standard"() {
|
|
1191
1097
|
return _getStandardProps(this);
|
|
1192
1098
|
},
|
|
1193
|
-
"~run": function run(dataset,
|
|
1194
|
-
if (typeof dataset.value === "string")
|
|
1195
|
-
dataset.typed = true;
|
|
1196
|
-
} else {
|
|
1197
|
-
_addIssue(this, "type", dataset, config2);
|
|
1198
|
-
}
|
|
1099
|
+
"~run": function run(dataset, config$1) {
|
|
1100
|
+
if (typeof dataset.value === "string") dataset.typed = true; else _addIssue(this, "type", dataset, config$1);
|
|
1199
1101
|
return dataset;
|
|
1200
1102
|
}
|
|
1201
1103
|
};
|
|
@@ -1203,26 +1105,22 @@
|
|
|
1203
1105
|
function _subIssues(datasets) {
|
|
1204
1106
|
var issues;
|
|
1205
1107
|
if (datasets) {
|
|
1206
|
-
var
|
|
1108
|
+
var _iterator64 = _createForOfIteratorHelper(datasets), _step64;
|
|
1207
1109
|
try {
|
|
1208
|
-
for (
|
|
1209
|
-
var
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
(_issues = issues).push.apply(_issues, _toConsumableArray(dataset.issues));
|
|
1213
|
-
} else {
|
|
1214
|
-
issues = dataset.issues;
|
|
1215
|
-
}
|
|
1110
|
+
for (_iterator64.s(); !(_step64 = _iterator64.n()).done; ) {
|
|
1111
|
+
var _issues;
|
|
1112
|
+
var dataset = _step64.value;
|
|
1113
|
+
if (issues) (_issues = issues).push.apply(_issues, _toConsumableArray(dataset.issues)); else issues = dataset.issues;
|
|
1216
1114
|
}
|
|
1217
1115
|
} catch (err) {
|
|
1218
|
-
|
|
1116
|
+
_iterator64.e(err);
|
|
1219
1117
|
} finally {
|
|
1220
|
-
|
|
1118
|
+
_iterator64.f();
|
|
1221
1119
|
}
|
|
1222
1120
|
}
|
|
1223
1121
|
return issues;
|
|
1224
1122
|
}
|
|
1225
|
-
function union(options,
|
|
1123
|
+
function union(options, message$1) {
|
|
1226
1124
|
return {
|
|
1227
1125
|
kind: "schema",
|
|
1228
1126
|
type: "union",
|
|
@@ -1232,64 +1130,46 @@
|
|
|
1232
1130
|
})), "|"),
|
|
1233
1131
|
async: false,
|
|
1234
1132
|
options: options,
|
|
1235
|
-
message:
|
|
1133
|
+
message: message$1,
|
|
1236
1134
|
get "~standard"() {
|
|
1237
1135
|
return _getStandardProps(this);
|
|
1238
1136
|
},
|
|
1239
|
-
"~run": function run(dataset,
|
|
1137
|
+
"~run": function run(dataset, config$1) {
|
|
1240
1138
|
var _untypedDatasets;
|
|
1241
1139
|
var validDataset;
|
|
1242
1140
|
var typedDatasets;
|
|
1243
1141
|
var untypedDatasets;
|
|
1244
|
-
var
|
|
1142
|
+
var _iterator65 = _createForOfIteratorHelper(this.options), _step65;
|
|
1245
1143
|
try {
|
|
1246
|
-
for (
|
|
1247
|
-
var schema =
|
|
1144
|
+
for (_iterator65.s(); !(_step65 = _iterator65.n()).done; ) {
|
|
1145
|
+
var schema = _step65.value;
|
|
1248
1146
|
var optionDataset = schema["~run"]({
|
|
1249
1147
|
value: dataset.value
|
|
1250
|
-
},
|
|
1148
|
+
}, config$1);
|
|
1251
1149
|
if (optionDataset.typed) {
|
|
1252
1150
|
if (optionDataset.issues) {
|
|
1253
|
-
if (typedDatasets)
|
|
1254
|
-
typedDatasets.push(optionDataset);
|
|
1255
|
-
} else {
|
|
1256
|
-
typedDatasets = [ optionDataset ];
|
|
1257
|
-
}
|
|
1151
|
+
if (typedDatasets) typedDatasets.push(optionDataset); else typedDatasets = [ optionDataset ];
|
|
1258
1152
|
} else {
|
|
1259
1153
|
validDataset = optionDataset;
|
|
1260
1154
|
break;
|
|
1261
1155
|
}
|
|
1262
|
-
} else
|
|
1263
|
-
if (untypedDatasets) {
|
|
1264
|
-
untypedDatasets.push(optionDataset);
|
|
1265
|
-
} else {
|
|
1266
|
-
untypedDatasets = [ optionDataset ];
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1156
|
+
} else if (untypedDatasets) untypedDatasets.push(optionDataset); else untypedDatasets = [ optionDataset ];
|
|
1269
1157
|
}
|
|
1270
1158
|
} catch (err) {
|
|
1271
|
-
|
|
1159
|
+
_iterator65.e(err);
|
|
1272
1160
|
} finally {
|
|
1273
|
-
|
|
1274
|
-
}
|
|
1275
|
-
if (validDataset) {
|
|
1276
|
-
return validDataset;
|
|
1161
|
+
_iterator65.f();
|
|
1277
1162
|
}
|
|
1163
|
+
if (validDataset) return validDataset;
|
|
1278
1164
|
if (typedDatasets) {
|
|
1279
|
-
if (typedDatasets.length === 1)
|
|
1280
|
-
|
|
1281
|
-
}
|
|
1282
|
-
_addIssue(this, "type", dataset, config2, {
|
|
1165
|
+
if (typedDatasets.length === 1) return typedDatasets[0];
|
|
1166
|
+
_addIssue(this, "type", dataset, config$1, {
|
|
1283
1167
|
issues: _subIssues(typedDatasets)
|
|
1284
1168
|
});
|
|
1285
1169
|
dataset.typed = true;
|
|
1286
|
-
} else if (((_untypedDatasets = untypedDatasets) === null || _untypedDatasets === void 0 ? void 0 : _untypedDatasets.length) === 1) {
|
|
1287
|
-
|
|
1288
|
-
}
|
|
1289
|
-
_addIssue(this, "type", dataset, config2, {
|
|
1290
|
-
issues: _subIssues(untypedDatasets)
|
|
1291
|
-
});
|
|
1292
|
-
}
|
|
1170
|
+
} else if (((_untypedDatasets = untypedDatasets) === null || _untypedDatasets === void 0 ? void 0 : _untypedDatasets.length) === 1) return untypedDatasets[0]; else _addIssue(this, "type", dataset, config$1, {
|
|
1171
|
+
issues: _subIssues(untypedDatasets)
|
|
1172
|
+
});
|
|
1293
1173
|
return dataset;
|
|
1294
1174
|
}
|
|
1295
1175
|
};
|
|
@@ -1311,35 +1191,33 @@
|
|
|
1311
1191
|
};
|
|
1312
1192
|
}
|
|
1313
1193
|
function pipe() {
|
|
1314
|
-
for (var _len3 = arguments.length,
|
|
1315
|
-
|
|
1194
|
+
for (var _len3 = arguments.length, pipe$1 = new Array(_len3), _key13 = 0; _key13 < _len3; _key13++) {
|
|
1195
|
+
pipe$1[_key13] = arguments[_key13];
|
|
1316
1196
|
}
|
|
1317
|
-
return _objectSpread2(_objectSpread2({},
|
|
1318
|
-
pipe:
|
|
1197
|
+
return _objectSpread2(_objectSpread2({}, pipe$1[0]), {}, {
|
|
1198
|
+
pipe: pipe$1,
|
|
1319
1199
|
get "~standard"() {
|
|
1320
1200
|
return _getStandardProps(this);
|
|
1321
1201
|
},
|
|
1322
|
-
"~run": function run(dataset,
|
|
1323
|
-
for (var _i2 = 0, _pipe =
|
|
1324
|
-
var item = _pipe[_i2];
|
|
1202
|
+
"~run": function run(dataset, config$1) {
|
|
1203
|
+
for (var _i2 = 0, _pipe$ = pipe$1; _i2 < _pipe$.length; _i2++) {
|
|
1204
|
+
var item = _pipe$[_i2];
|
|
1325
1205
|
if (item.kind !== "metadata") {
|
|
1326
1206
|
if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
|
|
1327
1207
|
dataset.typed = false;
|
|
1328
1208
|
break;
|
|
1329
1209
|
}
|
|
1330
|
-
if (!dataset.issues || !
|
|
1331
|
-
dataset = item["~run"](dataset, config2);
|
|
1332
|
-
}
|
|
1210
|
+
if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1);
|
|
1333
1211
|
}
|
|
1334
1212
|
}
|
|
1335
1213
|
return dataset;
|
|
1336
1214
|
}
|
|
1337
1215
|
});
|
|
1338
1216
|
}
|
|
1339
|
-
function safeParse(schema, input,
|
|
1217
|
+
function safeParse(schema, input, config$1) {
|
|
1340
1218
|
var dataset = schema["~run"]({
|
|
1341
1219
|
value: input
|
|
1342
|
-
}, getGlobalConfig(
|
|
1220
|
+
}, getGlobalConfig(config$1));
|
|
1343
1221
|
return {
|
|
1344
1222
|
typed: dataset.typed,
|
|
1345
1223
|
success: !dataset.issues,
|