scripts: is,dbal,valid (3 files)

This commit is contained in:
2025-12-25 19:46:38 +00:00
parent 2db70bb75a
commit 654e38143a
3 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import { describe, expect, it } from 'vitest'
import { isPlainObject } from '../../../src/core/validation/is-plain-object'
describe('isPlainObject', () => {
it.each([
{ value: {}, expected: true, description: 'empty object' },
{ value: { key: 'value' }, expected: true, description: 'object with keys' },
{ value: [], expected: false, description: 'array' },
{ value: null, expected: false, description: 'null' },
{ value: 'string', expected: false, description: 'string' },
])('returns $expected for $description', ({ value, expected }) => {
expect(isPlainObject(value)).toBe(expected)
})
})

View File

@@ -0,0 +1,13 @@
import { describe, expect, it } from 'vitest'
import { isValidUuid } from '../../../src/core/validation/is-valid-uuid'
describe('isValidUuid', () => {
it.each([
{ id: '550e8400-e29b-41d4-a716-446655440000', expected: true },
{ id: '00000000-0000-0000-0000-000000000000', expected: true },
{ id: 'not-a-uuid', expected: false },
{ id: '550e8400e29b41d4a716446655440000', expected: false },
])('returns $expected for $id', ({ id, expected }) => {
expect(isValidUuid(id)).toBe(expected)
})
})

0
tools/autobot.sh Normal file → Executable file
View File