@formily-design/shared 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/dist/designable.shared.umd.production.js +0 -1
- package/dist/designable.shared.umd.production.min.js +0 -2051
- package/rollup.config.js +0 -3
- package/src/animation.ts +0 -38
- package/src/array.ts +0 -301
- package/src/clone.ts +0 -96
- package/src/compose.ts +0 -7
- package/src/coordinate.ts +0 -633
- package/src/element.ts +0 -144
- package/src/event.ts +0 -379
- package/src/globalThisPolyfill.ts +0 -19
- package/src/index.ts +0 -17
- package/src/instanceof.ts +0 -10
- package/src/keycode.ts +0 -150
- package/src/lru.ts +0 -322
- package/src/observer.ts +0 -38
- package/src/request-idle.ts +0 -22
- package/src/scroller.ts +0 -113
- package/src/subscribable.ts +0 -60
- package/src/types.ts +0 -27
- package/src/uid.ts +0 -10
- package/tsconfig.build.json +0 -10
- package/tsconfig.json +0 -5
package/src/types.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const isType =
|
|
2
|
-
<T>(type: string | string[]) =>
|
|
3
|
-
(obj: unknown): obj is T =>
|
|
4
|
-
obj != null &&
|
|
5
|
-
(Array.isArray(type) ? type : [type]).some(
|
|
6
|
-
(t) => getType(obj) === `[object ${t}]`
|
|
7
|
-
)
|
|
8
|
-
export const getType = (obj: any) => Object.prototype.toString.call(obj)
|
|
9
|
-
export const isFn = isType<(...args: any[]) => any>([
|
|
10
|
-
'Function',
|
|
11
|
-
'AsyncFunction',
|
|
12
|
-
'GeneratorFunction',
|
|
13
|
-
])
|
|
14
|
-
export const isWindow = isType<Window>('Window')
|
|
15
|
-
export const isHTMLElement = (obj: any): obj is HTMLElement => {
|
|
16
|
-
return obj?.['nodeName'] || obj?.['tagName']
|
|
17
|
-
}
|
|
18
|
-
export const isArr = Array.isArray
|
|
19
|
-
export const isPlainObj = isType<object>('Object')
|
|
20
|
-
export const isStr = isType<string>('String')
|
|
21
|
-
export const isBool = isType<boolean>('Boolean')
|
|
22
|
-
export const isNum = isType<number>('Number')
|
|
23
|
-
export const isObj = (val: unknown): val is object => typeof val === 'object'
|
|
24
|
-
export const isRegExp = isType<RegExp>('RegExp')
|
|
25
|
-
export const isValid = (val: any) => val !== null && val !== undefined
|
|
26
|
-
export const isValidNumber = (val: any): val is number =>
|
|
27
|
-
!isNaN(val) && isNum(val)
|
package/src/uid.ts
DELETED
package/tsconfig.build.json
DELETED