Sha256: 24c3edfa9dc90ede2bf94be29b160082520727638a6f2c4d66836f650e70178a

Contents?: true

Size: 767 Bytes

Versions: 69

Compression:

Stored size: 767 Bytes

Contents

/**
 * Assign properties from `props` to `obj`
 * @template O, P The obj and props types
 * @param {O} obj The object to copy properties to
 * @param {P} props The object to copy properties from
 * @returns {O & P}
 */
export function assign(obj, props) {
	for (let i in props) obj[i] = props[i];
	return /** @type {O & P} */ (obj);
}

/**
 * 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' && !(i in b)) return true;
	for (let i in b) if (i !== '__source' && a[i] !== b[i]) return true;
	return false;
}

export function removeNode(node) {
	let parentNode = node.parentNode;
	if (parentNode) parentNode.removeChild(node);
}

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
isomorfeus-preact-10.9.0 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.8.2 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.8.1 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.8.0 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.7.3 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.7.2 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.7.1 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.7.0 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.6.62 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.6.61 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.6.60 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.6.59 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.6.58 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.6.57 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.6.56 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.6.55 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.6.54 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.6.53 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.6.52 node_modules/preact/compat/src/util.js
isomorfeus-preact-10.6.51 node_modules/preact/compat/src/util.js