@sourcemeta/blaze 16.8.0 → 16.9.0
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/describe.mjs +12 -5
- package/index.mjs +262 -262
- package/package.json +1 -1
package/describe.mjs
CHANGED
|
@@ -422,8 +422,8 @@ function formatList(items, conjunction) {
|
|
|
422
422
|
export function describe(valid, instruction, evaluatePath,
|
|
423
423
|
instanceLocation, instance, annotation) {
|
|
424
424
|
const opcode = instruction[0];
|
|
425
|
-
const value = instruction[
|
|
426
|
-
const children = instruction[
|
|
425
|
+
const value = instruction[6];
|
|
426
|
+
const children = instruction[7];
|
|
427
427
|
const keyword = extractKeyword(evaluatePath);
|
|
428
428
|
const target = resolveTarget(instance, instanceLocation);
|
|
429
429
|
const targetType = jsonTypeOf(target);
|
|
@@ -1042,6 +1042,13 @@ export function describe(valid, instruction, evaluatePath,
|
|
|
1042
1042
|
}
|
|
1043
1043
|
|
|
1044
1044
|
if (opcode === ASSERTION_NOT_TYPE_STRICT_ANY) {
|
|
1045
|
+
// Draft 3 permits a negative `maxLength`, which we compile into a check
|
|
1046
|
+
// that the value is not a string, as no string is that short
|
|
1047
|
+
if (keyword === 'maxLength') {
|
|
1048
|
+
return 'The value was expected to be of a type other than string, as no ' +
|
|
1049
|
+
'string is short enough to satisfy a negative maximum length';
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1045
1052
|
return describeNotTypesCheck(valid, targetType, value);
|
|
1046
1053
|
}
|
|
1047
1054
|
|
|
@@ -1482,13 +1489,13 @@ export function describe(valid, instruction, evaluatePath,
|
|
|
1482
1489
|
for (let index = 0; index < childCount; index++) {
|
|
1483
1490
|
const child = children[index];
|
|
1484
1491
|
if (child[0] === LOGICAL_WHEN_DEFINES) {
|
|
1485
|
-
const property = child[
|
|
1492
|
+
const property = child[6];
|
|
1486
1493
|
allDependencies.add(property);
|
|
1487
1494
|
if (!Object.hasOwn(target, property)) continue;
|
|
1488
1495
|
present.add(property);
|
|
1489
1496
|
presentWithSchemas.add(property);
|
|
1490
1497
|
} else if (child[0] === ASSERTION_PROPERTY_DEPENDENCIES) {
|
|
1491
|
-
const entries = child[
|
|
1498
|
+
const entries = child[6];
|
|
1492
1499
|
for (const property in entries) {
|
|
1493
1500
|
allDependencies.add(property);
|
|
1494
1501
|
if (Object.hasOwn(target, property)) {
|
|
@@ -1564,7 +1571,7 @@ export function describe(valid, instruction, evaluatePath,
|
|
|
1564
1571
|
|
|
1565
1572
|
for (let index = 0; index < childCount; index++) {
|
|
1566
1573
|
const child = children[index];
|
|
1567
|
-
const property = child[
|
|
1574
|
+
const property = child[6];
|
|
1568
1575
|
allDependencies.add(property);
|
|
1569
1576
|
if (Object.hasOwn(target, property)) {
|
|
1570
1577
|
present.add(property);
|