nervjs
Version:
A react-like framework based on virtual-dom
24 lines (19 loc) • 556 B
JavaScript
export function isVNode (node) {
return node && node.type === 'VirtualNode'
}
export function isVText (node) {
return node && node.type === 'VirtualText'
}
export function isWidget (node) {
return node && node.type === 'Widget'
}
export function isStateLess (node) {
return node && node.type === 'StateLess'
}
export function isHook (arg) {
if ((arg && (typeof arg.hook === 'function' && !arg.hasOwnProperty('hook'))) ||
(arg && (typeof arg.unhook === 'function' && !arg.hasOwnProperty('unhook')))) {
return true
}
return false
}