contractdiff 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/props-mutate.js +4 -3
- package/package.json +1 -1
package/dist/props-mutate.js
CHANGED
|
@@ -41,14 +41,15 @@ const listBreaks = (schema, tokens) => {
|
|
|
41
41
|
}
|
|
42
42
|
return out;
|
|
43
43
|
};
|
|
44
|
-
const
|
|
44
|
+
const beyond = (bound, step) => bound + step * Math.max(1, Math.abs(bound) * Number.EPSILON);
|
|
45
|
+
const outside = (bound, excluded, step) => (excluded ? bound : beyond(bound, step));
|
|
45
46
|
const numberBreaks = (draw, schema, value, tokens) => {
|
|
46
47
|
const out = [];
|
|
47
48
|
const range = rangeOf(schema, draw.draft);
|
|
48
49
|
const whole = !typesOf(schema, draw.draft).includes('number');
|
|
49
50
|
const [low, high] = wholeIn(range);
|
|
50
|
-
const below = whole ? low -
|
|
51
|
-
const above = whole ? high
|
|
51
|
+
const below = whole ? beyond(low, -1) : outside(range.low, range.lowOut, -1);
|
|
52
|
+
const above = whole ? beyond(high, 1) : outside(range.high, range.highOut, 1);
|
|
52
53
|
const lowKey = range.lowOut && has(schema, 'exclusiveMinimum') ? 'exclusiveMinimum' : 'minimum';
|
|
53
54
|
const highKey = range.highOut && has(schema, 'exclusiveMaximum') ? 'exclusiveMaximum' : 'maximum';
|
|
54
55
|
if (has(schema, lowKey))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contractdiff",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Breaking-change diff, lint and code generation for API contracts (OpenAPI, JSON Schema, AsyncAPI, MCP), and the spec back from the code. No dependency outside the burgee family. An openapi-typescript migration path.",
|
|
6
6
|
"license": "MIT",
|