-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathis.js
executable file
·34 lines (28 loc) · 906 Bytes
/
is.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var FUNCTION = 'function',
OBJECT = 'object',
FASTNBINDING = '_fastn_binding',
FASTNPROPERTY = '_fastn_property',
FASTNCOMPONENT = '_fastn_component',
DEFAULTBINDING = '_default_binding';
function isComponent(thing){
return thing && typeof thing === OBJECT && FASTNCOMPONENT in thing;
}
function isBindingObject(thing){
return thing && typeof thing === OBJECT && FASTNBINDING in thing;
}
function isBinding(thing){
return typeof thing === FUNCTION && FASTNBINDING in thing;
}
function isProperty(thing){
return typeof thing === FUNCTION && FASTNPROPERTY in thing;
}
function isDefaultBinding(thing){
return typeof thing === FUNCTION && FASTNBINDING in thing && DEFAULTBINDING in thing;
}
module.exports = {
component: isComponent,
bindingObject: isBindingObject,
binding: isBinding,
defaultBinding: isDefaultBinding,
property: isProperty
};