UNPKG

preact

Version:

Fast 4kb React-compatible Virtual DOM library.

17 lines (14 loc) • 500 B
export const assign = Object.assign; /** * Check if two objects have a different shape * @param {object} a * @param {object} b * @returns {boolean} */ export function shallowDiffers(a, b) { for (let i in a) if (i != '__source' && a[i] !== b[i]) return true; for (let i in b) if (i != '__source' && !(i in a)) return true; return false; } export const IS_NON_DIMENSIONAL = /^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini)/;