summaryrefslogtreecommitdiff
path: root/preact/debug/src/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'preact/debug/src/util.js')
-rw-r--r--preact/debug/src/util.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/preact/debug/src/util.js b/preact/debug/src/util.js
new file mode 100644
index 0000000..7b7a5e1
--- /dev/null
+++ b/preact/debug/src/util.js
@@ -0,0 +1,11 @@
+/**
+ * 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);
+}