all files / src/ helpers.ts

100% Statements 8/8
100% Branches 4/4
100% Functions 4/4
100% Lines 8/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18    873×     27×     112×     948×    
import { VNode } from './'
 
export function isString(x: any): x is string {
  return typeof x === 'string'
}
 
export function isNumber(x: any): x is number {
  return typeof x === 'number'
}
 
export function isPrimitive(x: any): x is (string | number) {
  return isString(x) || isNumber(x)
}
 
export function vNodesAreEqual(formerVNode: VNode, vNode: VNode) {
  return formerVNode.key === vNode.key && formerVNode.tagName === vNode.tagName
}