Skip to content

Commit c2b674f

Browse files
committed
types: use Builtin instead of Function and Date
1 parent 94a81b6 commit c2b674f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/reactivity/src/reactive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export function shallowReactive<T extends object>(
141141
}
142142

143143
type Primitive = string | number | boolean | bigint | symbol | undefined | null
144-
type Builtin = Primitive | Function | Date | Error | RegExp
144+
export type Builtin = Primitive | Function | Date | Error | RegExp
145145
export type DeepReadonly<T> = T extends Builtin
146146
? T
147147
: T extends Map<infer K, infer V>

packages/reactivity/src/ref.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
isReadonly,
1616
isShallow
1717
} from './reactive'
18-
import type { ShallowReactiveMarker } from './reactive'
18+
import type { Builtin, ShallowReactiveMarker } from './reactive'
1919
import { CollectionTypes } from './collectionHandlers'
2020
import { createDep, Dep } from './dep'
2121

@@ -491,8 +491,7 @@ export type UnwrapRef<T> = T extends ShallowRef<infer V>
491491
: UnwrapRefSimple<T>
492492

493493
export type UnwrapRefSimple<T> = T extends
494-
| Function
495-
| Date
494+
| Builtin
496495
| CollectionTypes
497496
| BaseTypes
498497
| Ref

0 commit comments

Comments
 (0)