REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.91 KB
Close
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/src/utils/param-converter/convert-nested-param.spec.ts
Text
Base64
import { expect } from 'chai' import { convertNestedParam } from './convert-nested-param.js' const jsonField = { number: '123', date: '2020-11-08', nested: { number: '456', }, nestedList: [{ number: '789', }, { number: '111', }], } describe('module:paramConverter.convertNestedParam', () => { it('should convert number property of a JSON to actual number', () => { const property = { type: 'number', propertyPath: 'jsonField.number', subProperties: [], } const convertedJson = convertNestedParam(jsonField, property as any) expect(convertedJson.number).to.equal(123) }) it('should convert date property of a JSON to actual number', () => { const property = { type: 'datetime', propertyPath: 'jsonField.date', subProperties: [], } const convertedJson = convertNestedParam(jsonField, property as any) expect(convertedJson.date.getTime()).to.equal(new Date('2020-11-08').getTime()) }) it('should convert a nested json property\'s number string to actual number', () => { const property = { type: 'mixed', propertyPath: 'jsonField.nested', isArray: false, subProperties: [{ propertyPath: 'jsonField.nested.number', type: 'number', }], } const convertedJson = convertNestedParam(jsonField, property as any) expect(convertedJson.nested.number).to.equal(456) }) it('should convert a nested json array property\'s number string to actual number', () => { const property = { type: 'mixed', propertyPath: 'jsonField.nestedList', isArray: true, subProperties: [{ propertyPath: 'jsonField.nestedList.number', type: 'number', }], } const convertedJson = convertNestedParam(jsonField, property as any) expect(convertedJson.nestedList[0].number).to.equal(789) expect(convertedJson.nestedList[1].number).to.equal(111) }) })
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 9
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
constants.ts
44 B
lrw-r--r--
2026-02-28 00:32:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
convert-nested-param.spec.ts
1.91 KB
lrw-r--r--
2026-02-28 00:32:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
convert-nested-param.ts
990 B
lrw-r--r--
2026-02-28 00:32:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
convert-param.spec.ts
819 B
lrw-r--r--
2026-02-28 00:32:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
convert-param.ts
403 B
lrw-r--r--
2026-02-28 00:32:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.ts
44 B
lrw-r--r--
2026-02-28 00:32:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
param-converter-module.ts
537 B
lrw-r--r--
2026-02-28 00:32:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
prepare-params.ts
1.47 KB
lrw-r--r--
2026-02-28 00:32:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
validate-param.ts
1.18 KB
lrw-r--r--
2026-02-28 00:32:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).