Skip to content

Commit 8a5eb72

Browse files
committed
Remove Unused IsRecordDeferred Guard | Base Coverage
1 parent d3be357 commit 8a5eb72

2 files changed

Lines changed: 16 additions & 9 deletions

File tree

src/type/types/record.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,6 @@ export type TRecordDeferred<Key extends TSchema = TSchema, Value extends TSchema
8989
export function RecordDeferred<Key extends TSchema, Value extends TSchema>(key: Key, value: Value, options: TObjectOptions = {}): TRecordDeferred<Key, Value> {
9090
return Deferred('Record', [key, value], options)
9191
}
92-
// ------------------------------------------------------------------
93-
// Guard
94-
// ------------------------------------------------------------------
95-
/** Returns true if this value is a deferred Interface action. */
96-
export function IsRecordDeferred(value: unknown): value is TRecordDeferred {
97-
return IsSchema(value)
98-
&& Guard.HasPropertyKey(value, 'action')
99-
&& Guard.IsEqual(value.action, 'Record')
100-
}
10192
// -------------------------------------------------------------------
10293
// Factory
10394
// -------------------------------------------------------------------

test/typebox/runtime/type/types/base.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ class TStringBase extends Type.Base<string> {
2828
public override Errors(value: unknown): object[] {
2929
return typeof value === 'string' ? [] : [{ message: 'expected string' }]
3030
}
31+
public override Clone(): Type.Base {
32+
return new TStringBase()
33+
}
3134
}
3235
const StringBase = () => new TStringBase()
3336
Test('Should Base 3', () => {
@@ -55,6 +58,19 @@ Test('Should Base 8', () => {
5558
Assert.IsEqual(T.Errors(1), [{ message: 'expected string' }])
5659
})
5760
// ------------------------------------------------------------------
61+
// Clone - Coverage
62+
// ------------------------------------------------------------------
63+
Test('Should Base 9', () => {
64+
const T: TStringBase = StringBase()
65+
const S = T.Clone()
66+
Assert.IsEqual(S.Errors(1), [{ message: 'expected string' }])
67+
})
68+
69+
Test('Should Base 10', () => {
70+
const T = new Type.Base()
71+
Assert.Throws(() => T.Clone())
72+
})
73+
// ------------------------------------------------------------------
5874
// Clone - Compositor
5975
// ------------------------------------------------------------------
6076
// Test('Should Base 9', () => {

0 commit comments

Comments
 (0)