-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing parsing bugs in sub-schema detection.
- Loading branch information
Showing
10 changed files
with
394 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export function valueTypeLabel(value: unknown): string { | ||
if (value === null) { | ||
return 'null'; | ||
} | ||
|
||
if (Array.isArray(value)) { | ||
return 'array'; | ||
} | ||
|
||
return typeof value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import {schemaFieldTypes} from '../../src/schema/field/types'; | ||
|
||
const EXPECTED_TYPES: string[] = [ | ||
'array', | ||
'bigint', | ||
'boolean', | ||
'datetime', | ||
'dbl', | ||
'double', | ||
'float', | ||
'int', | ||
'iterable', | ||
'json-serialized', | ||
'json', | ||
'null', | ||
'number', | ||
'real', | ||
'string', | ||
'time', | ||
'uint', | ||
'undefined', | ||
'url' | ||
]; | ||
|
||
describe('Schema Field Types (built-in)', () => { | ||
let fieldTypes: Set<string>; | ||
|
||
beforeAll(() => { | ||
fieldTypes = new Set<string>(schemaFieldTypes); | ||
}); | ||
|
||
for (const expectedType of EXPECTED_TYPES) { | ||
it(`should include built-in type '${expectedType}'`, () => { | ||
expect(fieldTypes.has(expectedType)).toBe(true); | ||
}); | ||
} | ||
}); |
Oops, something went wrong.