@reventlessdev/trait-attachments 1.0.0-alpha.5 → 1.0.0-alpha.51
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 +6 -4
- package/package.json +7 -7
- package/src/Attachments.res +46 -21
- package/src/Attachments_Conformance.res +59 -23
- package/src/Attachments_Conformance.res.mjs +57 -28
- package/src/Attachments_Rules.res +64 -21
- package/src/Attachments_Rules.res.mjs +22 -1
- package/src/Attachments_Scaffold.res +333 -263
- package/src/Attachments_Scaffold.res.mjs +72 -35
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
3
|
import * as Sury from "sury";
|
|
4
|
+
import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
|
|
4
5
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
5
6
|
import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.js";
|
|
6
7
|
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
@@ -84,6 +85,8 @@ function evolve(t, fact) {
|
|
|
84
85
|
fact.altText
|
|
85
86
|
]])
|
|
86
87
|
};
|
|
88
|
+
case "EffectiveChanged" :
|
|
89
|
+
return t;
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
92
|
|
|
@@ -112,7 +115,7 @@ function setAltText(t, ref, altText) {
|
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
117
|
|
|
115
|
-
function
|
|
118
|
+
function decideFacts(t, cardinalityOpt, op) {
|
|
116
119
|
let cardinality = cardinalityOpt !== undefined ? cardinalityOpt : "Many";
|
|
117
120
|
if (typeof op !== "object") {
|
|
118
121
|
return {
|
|
@@ -209,6 +212,23 @@ function decide(t, cardinalityOpt, op) {
|
|
|
209
212
|
}
|
|
210
213
|
}
|
|
211
214
|
|
|
215
|
+
function decide(t, cardinalityOpt, op) {
|
|
216
|
+
let cardinality = cardinalityOpt !== undefined ? cardinalityOpt : "Many";
|
|
217
|
+
let e = decideFacts(t, cardinality, op);
|
|
218
|
+
if (e.TAG !== "Ok") {
|
|
219
|
+
return e;
|
|
220
|
+
}
|
|
221
|
+
let facts = e._0;
|
|
222
|
+
let after = Stdlib_Array.reduce(facts, t, evolve);
|
|
223
|
+
return {
|
|
224
|
+
TAG: "Ok",
|
|
225
|
+
_0: Primitive_object.equal(effectivePrimary(t), effectivePrimary(after)) ? facts : facts.concat([{
|
|
226
|
+
TAG: "EffectiveChanged",
|
|
227
|
+
ref: effectivePrimary(after)
|
|
228
|
+
}])
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
212
232
|
export {
|
|
213
233
|
cardinalitySchema,
|
|
214
234
|
empty,
|
|
@@ -218,6 +238,7 @@ export {
|
|
|
218
238
|
primaryFirst,
|
|
219
239
|
evolve,
|
|
220
240
|
setAltText,
|
|
241
|
+
decideFacts,
|
|
221
242
|
decide,
|
|
222
243
|
}
|
|
223
244
|
/* cardinalitySchema Not a pure module */
|