Skip to content

Commit 63c16fc

Browse files
committed
doc: update generated testsuite samples
1 parent c6e7797 commit 63c16fc

File tree

10 files changed

+25
-102
lines changed

10 files changed

+25
-102
lines changed

doc/samples/draft-next/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Based on JSON Schema Test Suite for `draft-next`.
2626
| [anyOf](./anyOf.md) | 8 | - | 3 | - |
2727
| [boolean_schema](./boolean_schema.md) | 2 | - | - | - |
2828
| [const](./const.md) | 15 | - | - | - |
29-
| [contains](./contains.md) | 7 | - | - | - |
29+
| [contains](./contains.md) | 7 | - | 1 | - |
3030
| [content](./content.md) | 4 | - | 4 | - |
3131
| [default](./default.md) | 3 | - | - | - |
3232
| [defs](./defs.md) | 1 | - | - | - |

doc/samples/draft-next/contains.md

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -115,22 +115,12 @@ return ref0
115115
const ref0 = function validate(data) {
116116
if (Array.isArray(data)) {
117117
let passes0 = 0
118-
for (let i = 0; i < data.length; i++) {
119-
const sub0 = (() => {
120-
return true
121-
})()
122-
if (sub0) passes0++
123-
}
118+
for (let i = 0; i < data.length; i++) passes0++
124119
if (passes0 < 1) return false
125120
}
126121
if (typeof data === "object" && data && !Array.isArray(data)) {
127122
let passes1 = 0
128-
for (const key0 of Object.keys(data)) {
129-
const sub1 = (() => {
130-
return true
131-
})()
132-
if (sub1) passes1++
133-
}
123+
for (const key0 of Object.keys(data)) passes1++
134124
if (passes1 < 1) return false
135125
}
136126
return true
@@ -155,38 +145,23 @@ return ref0
155145

156146
```js
157147
'use strict'
158-
const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
159148
const ref0 = function validate(data) {
160149
if (Array.isArray(data)) {
161150
let passes0 = 0
162-
for (let i = 0; i < data.length; i++) {
163-
const sub0 = (() => {
164-
if (data[i] !== undefined && hasOwn(data, i)) return false
165-
return true
166-
})()
167-
if (sub0) passes0++
168-
}
169151
if (passes0 < 1) return false
170152
}
171153
if (typeof data === "object" && data && !Array.isArray(data)) {
172154
let passes1 = 0
173-
for (const key0 of Object.keys(data)) {
174-
const sub1 = (() => {
175-
return false
176-
return true
177-
})()
178-
if (sub1) passes1++
179-
}
180155
if (passes1 < 1) return false
181156
}
182157
return true
183158
};
184159
return ref0
185160
```
186161

187-
##### Strong mode notices
162+
### Warnings
188163

189-
* `[requireValidation] possible type confusion in 'contains', forbid 'object' or 'array' at #`
164+
* `some checks are never reachable at #`
190165

191166

192167
## items + contains

doc/samples/draft2019-09/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Based on JSON Schema Test Suite for `draft2019-09`.
2727
| [anyOf](./anyOf.md) | 8 | - | 3 | - |
2828
| [boolean_schema](./boolean_schema.md) | 2 | - | - | - |
2929
| [const](./const.md) | 15 | - | - | - |
30-
| [contains](./contains.md) | 7 | - | - | - |
30+
| [contains](./contains.md) | 7 | - | 1 | - |
3131
| [content](./content.md) | 4 | - | 4 | - |
3232
| [default](./default.md) | 3 | - | - | - |
3333
| [defs](./defs.md) | 1 | - | - | - |

doc/samples/draft2019-09/contains.md

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,7 @@ return ref0
9191
const ref0 = function validate(data) {
9292
if (Array.isArray(data)) {
9393
let passes0 = 0
94-
for (let i = 0; i < data.length; i++) {
95-
const sub0 = (() => {
96-
return true
97-
})()
98-
if (sub0) passes0++
99-
}
94+
for (let i = 0; i < data.length; i++) passes0++
10095
if (passes0 < 1) return false
10196
}
10297
return true
@@ -106,7 +101,7 @@ return ref0
106101

107102
##### Strong mode notices
108103

109-
* `[requireValidation] schema = true is not allowed at #/contains`
104+
* `[requireValidation] type should be specified at #`
110105

111106

112107
## contains keyword with boolean schema false
@@ -121,27 +116,19 @@ return ref0
121116

122117
```js
123118
'use strict'
124-
const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
125119
const ref0 = function validate(data) {
126120
if (Array.isArray(data)) {
127121
let passes0 = 0
128-
for (let i = 0; i < data.length; i++) {
129-
const sub0 = (() => {
130-
if (data[i] !== undefined && hasOwn(data, i)) return false
131-
return true
132-
})()
133-
if (sub0) passes0++
134-
}
135122
if (passes0 < 1) return false
136123
}
137124
return true
138125
};
139126
return ref0
140127
```
141128

142-
##### Strong mode notices
129+
### Warnings
143130

144-
* `[requireValidation] type should be specified at #`
131+
* `some checks are never reachable at #`
145132

146133

147134
## items + contains

doc/samples/draft2020-12/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Based on JSON Schema Test Suite for `draft2020-12`.
2626
| [anyOf](./anyOf.md) | 8 | - | 3 | - |
2727
| [boolean_schema](./boolean_schema.md) | 2 | - | - | - |
2828
| [const](./const.md) | 15 | - | - | - |
29-
| [contains](./contains.md) | 7 | - | - | - |
29+
| [contains](./contains.md) | 7 | - | 1 | - |
3030
| [content](./content.md) | 4 | - | 4 | - |
3131
| [default](./default.md) | 3 | - | - | - |
3232
| [defs](./defs.md) | 1 | - | - | - |

doc/samples/draft2020-12/contains.md

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,7 @@ return ref0
9191
const ref0 = function validate(data) {
9292
if (Array.isArray(data)) {
9393
let passes0 = 0
94-
for (let i = 0; i < data.length; i++) {
95-
const sub0 = (() => {
96-
return true
97-
})()
98-
if (sub0) passes0++
99-
}
94+
for (let i = 0; i < data.length; i++) passes0++
10095
if (passes0 < 1) return false
10196
}
10297
return true
@@ -106,7 +101,7 @@ return ref0
106101

107102
##### Strong mode notices
108103

109-
* `[requireValidation] schema = true is not allowed at #/contains`
104+
* `[requireValidation] type should be specified at #`
110105

111106

112107
## contains keyword with boolean schema false
@@ -121,27 +116,19 @@ return ref0
121116

122117
```js
123118
'use strict'
124-
const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
125119
const ref0 = function validate(data) {
126120
if (Array.isArray(data)) {
127121
let passes0 = 0
128-
for (let i = 0; i < data.length; i++) {
129-
const sub0 = (() => {
130-
if (data[i] !== undefined && hasOwn(data, i)) return false
131-
return true
132-
})()
133-
if (sub0) passes0++
134-
}
135122
if (passes0 < 1) return false
136123
}
137124
return true
138125
};
139126
return ref0
140127
```
141128

142-
##### Strong mode notices
129+
### Warnings
143130

144-
* `[requireValidation] type should be specified at #`
131+
* `some checks are never reachable at #`
145132

146133

147134
## items + contains

doc/samples/draft6/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Based on JSON Schema Test Suite for `draft6`.
2626
| [anyOf](./anyOf.md) | 8 | - | 3 | - |
2727
| [boolean_schema](./boolean_schema.md) | 2 | - | - | - |
2828
| [const](./const.md) | 15 | - | - | - |
29-
| [contains](./contains.md) | 6 | - | - | - |
29+
| [contains](./contains.md) | 6 | - | 1 | - |
3030
| [default](./default.md) | 3 | - | - | - |
3131
| [definitions](./definitions.md) | 1 | - | - | - |
3232
| [dependencies](./dependencies.md) | 7 | - | - | - |

doc/samples/draft6/contains.md

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,7 @@ return ref0
9191
const ref0 = function validate(data) {
9292
if (Array.isArray(data)) {
9393
let passes0 = 0
94-
for (let i = 0; i < data.length; i++) {
95-
const sub0 = (() => {
96-
return true
97-
})()
98-
if (sub0) passes0++
99-
}
94+
for (let i = 0; i < data.length; i++) passes0++
10095
if (passes0 < 1) return false
10196
}
10297
return true
@@ -106,7 +101,7 @@ return ref0
106101

107102
##### Strong mode notices
108103

109-
* `[requireValidation] schema = true is not allowed at #/contains`
104+
* `[requireValidation] type should be specified at #`
110105

111106

112107
## contains keyword with boolean schema false
@@ -121,27 +116,19 @@ return ref0
121116

122117
```js
123118
'use strict'
124-
const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
125119
const ref0 = function validate(data) {
126120
if (Array.isArray(data)) {
127121
let passes0 = 0
128-
for (let i = 0; i < data.length; i++) {
129-
const sub0 = (() => {
130-
if (data[i] !== undefined && hasOwn(data, i)) return false
131-
return true
132-
})()
133-
if (sub0) passes0++
134-
}
135122
if (passes0 < 1) return false
136123
}
137124
return true
138125
};
139126
return ref0
140127
```
141128

142-
##### Strong mode notices
129+
### Warnings
143130

144-
* `[requireValidation] type should be specified at #`
131+
* `some checks are never reachable at #`
145132

146133

147134
## items + contains

doc/samples/draft7/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Based on JSON Schema Test Suite for `draft7`.
2626
| [anyOf](./anyOf.md) | 8 | - | 3 | - |
2727
| [boolean_schema](./boolean_schema.md) | 2 | - | - | - |
2828
| [const](./const.md) | 15 | - | - | - |
29-
| [contains](./contains.md) | 7 | - | - | - |
29+
| [contains](./contains.md) | 7 | - | 1 | - |
3030
| [default](./default.md) | 3 | - | - | - |
3131
| [definitions](./definitions.md) | 1 | - | - | - |
3232
| [dependencies](./dependencies.md) | 7 | - | - | - |

doc/samples/draft7/contains.md

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,7 @@ return ref0
9191
const ref0 = function validate(data) {
9292
if (Array.isArray(data)) {
9393
let passes0 = 0
94-
for (let i = 0; i < data.length; i++) {
95-
const sub0 = (() => {
96-
return true
97-
})()
98-
if (sub0) passes0++
99-
}
94+
for (let i = 0; i < data.length; i++) passes0++
10095
if (passes0 < 1) return false
10196
}
10297
return true
@@ -106,7 +101,7 @@ return ref0
106101

107102
##### Strong mode notices
108103

109-
* `[requireValidation] schema = true is not allowed at #/contains`
104+
* `[requireValidation] type should be specified at #`
110105

111106

112107
## contains keyword with boolean schema false
@@ -121,27 +116,19 @@ return ref0
121116

122117
```js
123118
'use strict'
124-
const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
125119
const ref0 = function validate(data) {
126120
if (Array.isArray(data)) {
127121
let passes0 = 0
128-
for (let i = 0; i < data.length; i++) {
129-
const sub0 = (() => {
130-
if (data[i] !== undefined && hasOwn(data, i)) return false
131-
return true
132-
})()
133-
if (sub0) passes0++
134-
}
135122
if (passes0 < 1) return false
136123
}
137124
return true
138125
};
139126
return ref0
140127
```
141128

142-
##### Strong mode notices
129+
### Warnings
143130

144-
* `[requireValidation] type should be specified at #`
131+
* `some checks are never reachable at #`
145132

146133

147134
## items + contains

0 commit comments

Comments
 (0)