REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.18 KB
Close
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/src/utils/param-converter/validate-param.ts
Text
Base64
import { ParamsTypeValue } from '../../backend/adapters/record/params.type.js' import { BaseProperty } from '../../backend/adapters/property/index.js' import PropertyDecorator from '../../backend/decorators/property/property-decorator.js' const isNumeric = (value: ParamsTypeValue) => !Number.isNaN(value) const isUuid = (value: ParamsTypeValue) => { const rgx = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi return rgx.test(String(value)) } const isSafeInteger = ( value: ParamsTypeValue, ) => isNumeric(value) && Number.isSafeInteger(Number(value)) const isPositiveNumber = ( value: ParamsTypeValue, ) => isNumeric(value) && Number(value) > 0 const validateParam = ( value: ParamsTypeValue, property: BaseProperty | PropertyDecorator, ): boolean => { if (property.type() === 'number' || property.type() === 'float') { if (!property.isId()) return isNumeric(value) if (property.type() === 'float') return isPositiveNumber(value) return isSafeInteger(value) && isPositiveNumber(value) } if (property.type() === 'uuid') { return isUuid(value) } return true } export { validateParam, isNumeric, isUuid, isSafeInteger }
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).