@amritk/helpers 0.1.0 → 0.2.2

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.
@@ -0,0 +1,406 @@
1
+ import type { JSONSchema } from 'json-schema-typed/draft-2020-12'
2
+ import { describe, expect, it } from 'vitest'
3
+
4
+ import {
5
+ hasAdditionalProperties,
6
+ hasAllOf,
7
+ hasAnyOf,
8
+ hasConst,
9
+ hasDefault,
10
+ hasEnum,
11
+ hasExamples,
12
+ hasExclusiveMaximum,
13
+ hasExclusiveMinimum,
14
+ hasFormat,
15
+ hasItems,
16
+ hasMaxItems,
17
+ hasMaximum,
18
+ hasMaxLength,
19
+ hasMaxProperties,
20
+ hasMinItems,
21
+ hasMinimum,
22
+ hasMinLength,
23
+ hasMinProperties,
24
+ hasMultipleOf,
25
+ hasOneOf,
26
+ hasPattern,
27
+ hasProperties,
28
+ hasRef,
29
+ hasRequired,
30
+ hasType,
31
+ hasUniqueItems,
32
+ isObjectSchema,
33
+ isSchemaObject,
34
+ } from './schema-guards'
35
+
36
+ describe('schema-guards', () => {
37
+ // isSchemaObject
38
+ it('isSchemaObject returns true for plain object', () => {
39
+ expect(isSchemaObject({})).toBe(true)
40
+ })
41
+
42
+ it('isSchemaObject returns true for object with properties', () => {
43
+ expect(isSchemaObject({ type: 'string' })).toBe(true)
44
+ })
45
+
46
+ it('isSchemaObject returns false for boolean true', () => {
47
+ expect(isSchemaObject(true)).toBe(false)
48
+ })
49
+
50
+ it('isSchemaObject returns false for boolean false', () => {
51
+ expect(isSchemaObject(false)).toBe(false)
52
+ })
53
+
54
+ // hasType
55
+ it('hasType returns true when type is a string', () => {
56
+ expect(hasType({ type: 'string' })).toBe(true)
57
+ })
58
+
59
+ it('hasType returns false when type is missing', () => {
60
+ expect(hasType({})).toBe(false)
61
+ })
62
+
63
+ it('hasType returns false for boolean schema', () => {
64
+ expect(hasType(true)).toBe(false)
65
+ })
66
+
67
+ it('hasType returns false when type is an array', () => {
68
+ expect(hasType({ type: ['string', 'number'] })).toBe(false)
69
+ })
70
+
71
+ // isObjectSchema
72
+ it('isObjectSchema returns true for schema with type object', () => {
73
+ expect(isObjectSchema({ type: 'object' })).toBe(true)
74
+ })
75
+
76
+ it('isObjectSchema returns true for schema with properties but no type', () => {
77
+ expect(isObjectSchema({ properties: { name: { type: 'string' } } })).toBe(true)
78
+ })
79
+
80
+ it('isObjectSchema returns false for string type', () => {
81
+ expect(isObjectSchema({ type: 'string' })).toBe(false)
82
+ })
83
+
84
+ it('isObjectSchema returns false for boolean schema', () => {
85
+ expect(isObjectSchema(true)).toBe(false)
86
+ })
87
+
88
+ // hasProperties
89
+ it('hasProperties returns true when properties is an object', () => {
90
+ expect(hasProperties({ properties: { name: { type: 'string' } } })).toBe(true)
91
+ })
92
+
93
+ it('hasProperties returns true for empty properties object', () => {
94
+ expect(hasProperties({ properties: {} })).toBe(true)
95
+ })
96
+
97
+ it('hasProperties returns false when properties is missing', () => {
98
+ expect(hasProperties({ type: 'object' })).toBe(false)
99
+ })
100
+
101
+ it('hasProperties returns false for boolean schema', () => {
102
+ expect(hasProperties(true)).toBe(false)
103
+ })
104
+
105
+ // hasEnum
106
+ it('hasEnum returns true when enum is an array', () => {
107
+ expect(hasEnum({ enum: ['a', 'b'] })).toBe(true)
108
+ })
109
+
110
+ it('hasEnum returns true for empty enum array', () => {
111
+ expect(hasEnum({ enum: [] })).toBe(true)
112
+ })
113
+
114
+ it('hasEnum returns false when enum is missing', () => {
115
+ expect(hasEnum({})).toBe(false)
116
+ })
117
+
118
+ it('hasEnum returns false for boolean schema', () => {
119
+ expect(hasEnum(false)).toBe(false)
120
+ })
121
+
122
+ // hasConst
123
+ it('hasConst returns true when const is present', () => {
124
+ expect(hasConst({ const: 'value' })).toBe(true)
125
+ })
126
+
127
+ it('hasConst returns true for null const', () => {
128
+ expect(hasConst({ const: null })).toBe(true)
129
+ })
130
+
131
+ it('hasConst returns false when const is missing', () => {
132
+ expect(hasConst({})).toBe(false)
133
+ })
134
+
135
+ // hasPattern
136
+ it('hasPattern returns true when pattern is a string', () => {
137
+ expect(hasPattern({ pattern: '^[a-z]+$' })).toBe(true)
138
+ })
139
+
140
+ it('hasPattern returns false when pattern is not a string', () => {
141
+ // Intentionally passing wrong type to verify the guard rejects it
142
+ expect(hasPattern({ pattern: 123 } as unknown as JSONSchema)).toBe(false)
143
+ })
144
+
145
+ it('hasPattern returns false when pattern is missing', () => {
146
+ expect(hasPattern({})).toBe(false)
147
+ })
148
+
149
+ // hasFormat
150
+ it('hasFormat returns true when format is a string', () => {
151
+ expect(hasFormat({ format: 'date-time' })).toBe(true)
152
+ })
153
+
154
+ it('hasFormat returns false when format is missing', () => {
155
+ expect(hasFormat({})).toBe(false)
156
+ })
157
+
158
+ it('hasFormat returns false when format is not a string', () => {
159
+ // Intentionally passing wrong type to verify the guard rejects it
160
+ expect(hasFormat({ format: 123 } as unknown as JSONSchema)).toBe(false)
161
+ })
162
+
163
+ // hasDefault
164
+ it('hasDefault returns true when default is present', () => {
165
+ expect(hasDefault({ default: 'value' })).toBe(true)
166
+ })
167
+
168
+ it('hasDefault returns true for undefined-like defaults', () => {
169
+ expect(hasDefault({ default: null })).toBe(true)
170
+ })
171
+
172
+ it('hasDefault returns false when default is missing', () => {
173
+ expect(hasDefault({})).toBe(false)
174
+ })
175
+
176
+ // hasExamples
177
+ it('hasExamples returns true when examples is an array', () => {
178
+ expect(hasExamples({ examples: ['foo'] })).toBe(true)
179
+ })
180
+
181
+ it('hasExamples returns true for empty examples array', () => {
182
+ expect(hasExamples({ examples: [] })).toBe(true)
183
+ })
184
+
185
+ it('hasExamples returns false when examples is missing', () => {
186
+ expect(hasExamples({})).toBe(false)
187
+ })
188
+
189
+ it('hasExamples returns false when examples is not an array', () => {
190
+ // Intentionally passing wrong type to verify the guard rejects it
191
+ expect(hasExamples({ examples: 'not-array' } as unknown as JSONSchema)).toBe(false)
192
+ })
193
+
194
+ // hasOneOf
195
+ it('hasOneOf returns true when oneOf is an array', () => {
196
+ expect(hasOneOf({ oneOf: [{ type: 'string' }] })).toBe(true)
197
+ })
198
+
199
+ it('hasOneOf returns false when oneOf is missing', () => {
200
+ expect(hasOneOf({})).toBe(false)
201
+ })
202
+
203
+ // hasAnyOf
204
+ it('hasAnyOf returns true when anyOf is an array', () => {
205
+ expect(hasAnyOf({ anyOf: [{ type: 'string' }] })).toBe(true)
206
+ })
207
+
208
+ it('hasAnyOf returns false when anyOf is missing', () => {
209
+ expect(hasAnyOf({})).toBe(false)
210
+ })
211
+
212
+ // hasAllOf
213
+ it('hasAllOf returns true when allOf is an array', () => {
214
+ expect(hasAllOf({ allOf: [{ type: 'string' }] })).toBe(true)
215
+ })
216
+
217
+ it('hasAllOf returns false when allOf is missing', () => {
218
+ expect(hasAllOf({})).toBe(false)
219
+ })
220
+
221
+ // hasRequired
222
+ it('hasRequired returns true when required is an array', () => {
223
+ expect(hasRequired({ required: ['name'] })).toBe(true)
224
+ })
225
+
226
+ it('hasRequired returns true for empty required array', () => {
227
+ expect(hasRequired({ required: [] })).toBe(true)
228
+ })
229
+
230
+ it('hasRequired returns false when required is missing', () => {
231
+ expect(hasRequired({})).toBe(false)
232
+ })
233
+
234
+ // hasItems
235
+ it('hasItems returns true when items is a schema object', () => {
236
+ expect(hasItems({ items: { type: 'string' } })).toBe(true)
237
+ })
238
+
239
+ it('hasItems returns false when items is boolean true', () => {
240
+ expect(hasItems({ items: true })).toBe(false)
241
+ })
242
+
243
+ it('hasItems returns false when items is missing', () => {
244
+ expect(hasItems({})).toBe(false)
245
+ })
246
+
247
+ // hasAdditionalProperties
248
+ it('hasAdditionalProperties returns true when additionalProperties is present', () => {
249
+ expect(hasAdditionalProperties({ additionalProperties: false })).toBe(true)
250
+ })
251
+
252
+ it('hasAdditionalProperties returns true for schema additionalProperties', () => {
253
+ expect(hasAdditionalProperties({ additionalProperties: { type: 'string' } })).toBe(true)
254
+ })
255
+
256
+ it('hasAdditionalProperties returns false when missing', () => {
257
+ expect(hasAdditionalProperties({})).toBe(false)
258
+ })
259
+
260
+ // hasMinLength
261
+ it('hasMinLength returns true when minLength is a number', () => {
262
+ expect(hasMinLength({ minLength: 1 })).toBe(true)
263
+ })
264
+
265
+ it('hasMinLength returns false when minLength is not a number', () => {
266
+ // Intentionally passing wrong type to verify the guard rejects it
267
+ expect(hasMinLength({ minLength: '1' } as unknown as JSONSchema)).toBe(false)
268
+ })
269
+
270
+ it('hasMinLength returns false when missing', () => {
271
+ expect(hasMinLength({})).toBe(false)
272
+ })
273
+
274
+ // hasMaxLength
275
+ it('hasMaxLength returns true when maxLength is a number', () => {
276
+ expect(hasMaxLength({ maxLength: 100 })).toBe(true)
277
+ })
278
+
279
+ it('hasMaxLength returns false when missing', () => {
280
+ expect(hasMaxLength({})).toBe(false)
281
+ })
282
+
283
+ // hasMinimum
284
+ it('hasMinimum returns true when minimum is a number', () => {
285
+ expect(hasMinimum({ minimum: 0 })).toBe(true)
286
+ })
287
+
288
+ it('hasMinimum returns false when missing', () => {
289
+ expect(hasMinimum({})).toBe(false)
290
+ })
291
+
292
+ // hasMaximum
293
+ it('hasMaximum returns true when maximum is a number', () => {
294
+ expect(hasMaximum({ maximum: 100 })).toBe(true)
295
+ })
296
+
297
+ it('hasMaximum returns false when missing', () => {
298
+ expect(hasMaximum({})).toBe(false)
299
+ })
300
+
301
+ // hasExclusiveMinimum
302
+ it('hasExclusiveMinimum returns true when exclusiveMinimum is a number', () => {
303
+ expect(hasExclusiveMinimum({ exclusiveMinimum: 0 })).toBe(true)
304
+ })
305
+
306
+ it('hasExclusiveMinimum returns false for boolean exclusiveMinimum', () => {
307
+ // Intentionally passing wrong type to verify the guard rejects it
308
+ expect(hasExclusiveMinimum({ exclusiveMinimum: true } as unknown as JSONSchema)).toBe(false)
309
+ })
310
+
311
+ it('hasExclusiveMinimum returns false when missing', () => {
312
+ expect(hasExclusiveMinimum({})).toBe(false)
313
+ })
314
+
315
+ // hasExclusiveMaximum
316
+ it('hasExclusiveMaximum returns true when exclusiveMaximum is a number', () => {
317
+ expect(hasExclusiveMaximum({ exclusiveMaximum: 100 })).toBe(true)
318
+ })
319
+
320
+ it('hasExclusiveMaximum returns false for boolean exclusiveMaximum', () => {
321
+ // Intentionally passing wrong type to verify the guard rejects it
322
+ expect(hasExclusiveMaximum({ exclusiveMaximum: false } as unknown as JSONSchema)).toBe(false)
323
+ })
324
+
325
+ it('hasExclusiveMaximum returns false when missing', () => {
326
+ expect(hasExclusiveMaximum({})).toBe(false)
327
+ })
328
+
329
+ // hasMultipleOf
330
+ it('hasMultipleOf returns true when multipleOf is a number', () => {
331
+ expect(hasMultipleOf({ multipleOf: 5 })).toBe(true)
332
+ })
333
+
334
+ it('hasMultipleOf returns false when missing', () => {
335
+ expect(hasMultipleOf({})).toBe(false)
336
+ })
337
+
338
+ // hasMinItems
339
+ it('hasMinItems returns true when minItems is a number', () => {
340
+ expect(hasMinItems({ minItems: 1 })).toBe(true)
341
+ })
342
+
343
+ it('hasMinItems returns false when missing', () => {
344
+ expect(hasMinItems({})).toBe(false)
345
+ })
346
+
347
+ // hasMaxItems
348
+ it('hasMaxItems returns true when maxItems is a number', () => {
349
+ expect(hasMaxItems({ maxItems: 10 })).toBe(true)
350
+ })
351
+
352
+ it('hasMaxItems returns false when missing', () => {
353
+ expect(hasMaxItems({})).toBe(false)
354
+ })
355
+
356
+ // hasUniqueItems
357
+ it('hasUniqueItems returns true when uniqueItems is a boolean', () => {
358
+ expect(hasUniqueItems({ uniqueItems: true })).toBe(true)
359
+ expect(hasUniqueItems({ uniqueItems: false })).toBe(true)
360
+ })
361
+
362
+ it('hasUniqueItems returns false when missing', () => {
363
+ expect(hasUniqueItems({})).toBe(false)
364
+ })
365
+
366
+ // hasMinProperties
367
+ it('hasMinProperties returns true when minProperties is a number', () => {
368
+ expect(hasMinProperties({ minProperties: 1 })).toBe(true)
369
+ })
370
+
371
+ it('hasMinProperties returns false when missing', () => {
372
+ expect(hasMinProperties({})).toBe(false)
373
+ })
374
+
375
+ it('hasMinProperties returns false for non-number value', () => {
376
+ // Intentionally passing wrong type to verify the guard rejects it
377
+ expect(hasMinProperties({ minProperties: '1' } as unknown as JSONSchema)).toBe(false)
378
+ })
379
+
380
+ // hasMaxProperties
381
+ it('hasMaxProperties returns true when maxProperties is a number', () => {
382
+ expect(hasMaxProperties({ maxProperties: 10 })).toBe(true)
383
+ })
384
+
385
+ it('hasMaxProperties returns false when missing', () => {
386
+ expect(hasMaxProperties({})).toBe(false)
387
+ })
388
+
389
+ // hasRef
390
+ it('hasRef returns true when $ref is a string', () => {
391
+ expect(hasRef({ $ref: '#/$defs/user' })).toBe(true)
392
+ })
393
+
394
+ it('hasRef returns false when $ref is missing', () => {
395
+ expect(hasRef({})).toBe(false)
396
+ })
397
+
398
+ it('hasRef returns false for boolean schema', () => {
399
+ expect(hasRef(true)).toBe(false)
400
+ })
401
+
402
+ it('hasRef returns false when $ref is not a string', () => {
403
+ // Intentionally passing wrong type to verify the guard rejects it
404
+ expect(hasRef({ $ref: 123 } as unknown as JSONSchema)).toBe(false)
405
+ })
406
+ })
@@ -0,0 +1,160 @@
1
+ import type { JSONSchema } from 'json-schema-typed/draft-2020-12'
2
+
3
+ type SchemaObject = Exclude<JSONSchema, false | boolean>
4
+
5
+ /** Type guard to check if schema is not false */
6
+ export const isSchemaObject = (schema: JSONSchema): schema is SchemaObject => {
7
+ return typeof schema === 'object' && schema !== null && typeof schema !== 'boolean'
8
+ }
9
+
10
+ /** Type guard to check if schema has a type property */
11
+ export const hasType = (schema: JSONSchema): schema is SchemaObject & { type: string } => {
12
+ return isSchemaObject(schema) && 'type' in schema && typeof schema.type === 'string'
13
+ }
14
+
15
+ /** Type guard to check if schema is an object schema */
16
+ export const isObjectSchema = (schema: JSONSchema): schema is JSONSchema.Object => {
17
+ return isSchemaObject(schema) && (('type' in schema && schema.type === 'object') || 'properties' in schema)
18
+ }
19
+
20
+ /** Type guard to check if schema has properties */
21
+ export const hasProperties = (
22
+ schema: JSONSchema,
23
+ ): schema is SchemaObject & { properties: Record<string, JSONSchema> } => {
24
+ return (
25
+ isSchemaObject(schema) &&
26
+ 'properties' in schema &&
27
+ typeof schema.properties === 'object' &&
28
+ schema.properties !== null
29
+ )
30
+ }
31
+
32
+ /** Type guard to check if schema has enum */
33
+ export const hasEnum = (schema: JSONSchema): schema is SchemaObject & { enum: readonly unknown[] } => {
34
+ return isSchemaObject(schema) && 'enum' in schema && Array.isArray(schema.enum)
35
+ }
36
+
37
+ /** Type guard to check if schema has const */
38
+ export const hasConst = (schema: JSONSchema): schema is SchemaObject & { const: unknown } => {
39
+ return isSchemaObject(schema) && 'const' in schema
40
+ }
41
+
42
+ /** Type guard to check if schema has pattern */
43
+ export const hasPattern = (schema: JSONSchema): schema is SchemaObject & { pattern: string } => {
44
+ return isSchemaObject(schema) && 'pattern' in schema && typeof schema.pattern === 'string'
45
+ }
46
+
47
+ /** Type guard to check if schema has format */
48
+ export const hasFormat = (schema: JSONSchema): schema is SchemaObject & { format: string } => {
49
+ return isSchemaObject(schema) && 'format' in schema && typeof schema.format === 'string'
50
+ }
51
+
52
+ /** Type guard to check if schema has default */
53
+ export const hasDefault = (schema: JSONSchema): schema is SchemaObject & { default: unknown } => {
54
+ return isSchemaObject(schema) && 'default' in schema
55
+ }
56
+
57
+ /** Type guard to check if schema has examples */
58
+ export const hasExamples = (schema: JSONSchema): schema is SchemaObject & { examples: readonly unknown[] } => {
59
+ return isSchemaObject(schema) && 'examples' in schema && Array.isArray(schema.examples)
60
+ }
61
+
62
+ /** Type guard to check if schema has oneOf */
63
+ export const hasOneOf = (schema: JSONSchema): schema is SchemaObject & { oneOf: readonly JSONSchema[] } => {
64
+ return isSchemaObject(schema) && 'oneOf' in schema && Array.isArray(schema.oneOf)
65
+ }
66
+
67
+ /** Type guard to check if schema has anyOf */
68
+ export const hasAnyOf = (schema: JSONSchema): schema is SchemaObject & { anyOf: readonly JSONSchema[] } => {
69
+ return isSchemaObject(schema) && 'anyOf' in schema && Array.isArray(schema.anyOf)
70
+ }
71
+
72
+ /** Type guard to check if schema has allOf */
73
+ export const hasAllOf = (schema: JSONSchema): schema is SchemaObject & { allOf: readonly JSONSchema[] } => {
74
+ return isSchemaObject(schema) && 'allOf' in schema && Array.isArray(schema.allOf)
75
+ }
76
+
77
+ /** Type guard to check if schema has required */
78
+ export const hasRequired = (schema: JSONSchema): schema is SchemaObject & { required: readonly string[] } => {
79
+ return isSchemaObject(schema) && 'required' in schema && Array.isArray(schema.required)
80
+ }
81
+
82
+ /** Type guard to check if schema has items (and it's not just boolean) */
83
+ export const hasItems = (schema: JSONSchema): schema is SchemaObject & { items: SchemaObject } => {
84
+ return (
85
+ isSchemaObject(schema) &&
86
+ 'items' in schema &&
87
+ typeof schema.items === 'object' &&
88
+ schema.items !== null &&
89
+ typeof schema.items !== 'boolean'
90
+ )
91
+ }
92
+
93
+ /** Type guard to check if schema has additionalProperties */
94
+ export const hasAdditionalProperties = (
95
+ schema: JSONSchema,
96
+ ): schema is SchemaObject & { additionalProperties: JSONSchema | boolean } => {
97
+ return isSchemaObject(schema) && 'additionalProperties' in schema
98
+ }
99
+
100
+ /** Type guard to check if schema has minLength */
101
+ export const hasMinLength = (schema: JSONSchema): schema is SchemaObject & { minLength: number } => {
102
+ return isSchemaObject(schema) && 'minLength' in schema && typeof schema.minLength === 'number'
103
+ }
104
+
105
+ /** Type guard to check if schema has maxLength */
106
+ export const hasMaxLength = (schema: JSONSchema): schema is SchemaObject & { maxLength: number } => {
107
+ return isSchemaObject(schema) && 'maxLength' in schema && typeof schema.maxLength === 'number'
108
+ }
109
+
110
+ /** Type guard to check if schema has minimum */
111
+ export const hasMinimum = (schema: JSONSchema): schema is SchemaObject & { minimum: number } => {
112
+ return isSchemaObject(schema) && 'minimum' in schema && typeof schema.minimum === 'number'
113
+ }
114
+
115
+ /** Type guard to check if schema has maximum */
116
+ export const hasMaximum = (schema: JSONSchema): schema is SchemaObject & { maximum: number } => {
117
+ return isSchemaObject(schema) && 'maximum' in schema && typeof schema.maximum === 'number'
118
+ }
119
+
120
+ /** Type guard to check if schema has exclusiveMinimum */
121
+ export const hasExclusiveMinimum = (schema: JSONSchema): schema is SchemaObject & { exclusiveMinimum: number } => {
122
+ return isSchemaObject(schema) && 'exclusiveMinimum' in schema && typeof schema.exclusiveMinimum === 'number'
123
+ }
124
+
125
+ /** Type guard to check if schema has exclusiveMaximum */
126
+ export const hasExclusiveMaximum = (schema: JSONSchema): schema is SchemaObject & { exclusiveMaximum: number } => {
127
+ return isSchemaObject(schema) && 'exclusiveMaximum' in schema && typeof schema.exclusiveMaximum === 'number'
128
+ }
129
+
130
+ /** Type guard to check if schema has multipleOf */
131
+ export const hasMultipleOf = (schema: JSONSchema): schema is SchemaObject & { multipleOf: number } => {
132
+ return isSchemaObject(schema) && 'multipleOf' in schema && typeof schema.multipleOf === 'number'
133
+ }
134
+
135
+ /** Type guard to check if schema has minItems */
136
+ export const hasMinItems = (schema: JSONSchema): schema is SchemaObject & { minItems: number } => {
137
+ return isSchemaObject(schema) && 'minItems' in schema && typeof schema.minItems === 'number'
138
+ }
139
+
140
+ /** Type guard to check if schema has maxItems */
141
+ export const hasMaxItems = (schema: JSONSchema): schema is SchemaObject & { maxItems: number } => {
142
+ return isSchemaObject(schema) && 'maxItems' in schema && typeof schema.maxItems === 'number'
143
+ }
144
+
145
+ /** Type guard to check if schema has uniqueItems */
146
+ export const hasUniqueItems = (schema: JSONSchema): schema is SchemaObject & { uniqueItems: boolean } => {
147
+ return isSchemaObject(schema) && 'uniqueItems' in schema && typeof schema.uniqueItems === 'boolean'
148
+ }
149
+
150
+ /** Type guard to check if schema has minProperties */
151
+ export const hasMinProperties = (schema: JSONSchema): schema is SchemaObject & { minProperties: number } => {
152
+ return isSchemaObject(schema) && 'minProperties' in schema && typeof schema.minProperties === 'number'
153
+ }
154
+
155
+ /** Type guard to check if schema has maxProperties */
156
+ export const hasMaxProperties = (schema: JSONSchema): schema is SchemaObject & { maxProperties: number } => {
157
+ return isSchemaObject(schema) && 'maxProperties' in schema && typeof schema.maxProperties === 'number'
158
+ }
159
+
160
+ export { hasRef } from './has-ref'