File tree Expand file tree Collapse file tree 4 files changed +12
-11
lines changed
Expand file tree Collapse file tree 4 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -4,14 +4,14 @@ import {
44 Const ,
55 assign ,
66 isArray ,
7+ isElementOrDocument ,
78 isObject ,
89 isSameType ,
910 on ,
1011 pushToDestinations ,
1112 setConsent ,
1213 tryCatchAsync ,
1314} from '@elbwalker/utils' ;
14- import { isElementOrDocument } from './helper' ;
1515import { initScopeTrigger , ready } from './trigger' ;
1616import { getState } from './state' ;
1717import { addDestination } from './destination' ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import type { WalkerOS } from '@elbwalker/types' ;
22import type { Elb , SourceWalkerjs } from '../types' ;
3- import { isCommand , isElementOrDocument } from './helper' ;
43import { handleCommand , handleEvent } from './handle' ;
54import {
65 Const ,
76 assign ,
87 isArguments ,
98 isArray ,
9+ isCommand ,
10+ isElementOrDocument ,
1011 isObject ,
1112 isSameType ,
1213 isString ,
Original file line number Diff line number Diff line change 11import type { WalkerOS } from '@elbwalker/types' ;
2+ import { Const } from './constants' ;
23
34export function isArguments ( value : unknown ) : value is IArguments {
45 return Object . prototype . toString . call ( value ) === '[object Arguments]' ;
@@ -12,10 +13,18 @@ export function isBoolean(value: unknown): value is boolean {
1213 return typeof value === 'boolean' ;
1314}
1415
16+ export function isCommand ( entity : string ) {
17+ return entity === Const . Commands . Walker ;
18+ }
19+
1520export function isDefined < T > ( val : T | undefined ) : val is T {
1621 return typeof val !== 'undefined' ;
1722}
1823
24+ export function isElementOrDocument ( elem : unknown ) : elem is Element {
25+ return elem === document || elem instanceof Element ;
26+ }
27+
1928export function isNumber ( value : unknown ) : value is number {
2029 return typeof value === 'number' && ! Number . isNaN ( value ) ;
2130}
You can’t perform that action at this time.
0 commit comments