Skip to content

Commit

Permalink
Merge 6ad22f4 into 6ab49d9
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Aug 18, 2020
2 parents 6ab49d9 + 6ad22f4 commit e5b9d35
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/util.js
@@ -1,11 +1,14 @@
export const assign =
typeof Object.assign === 'undefined' ? assignFallback : Object.assign;

/**
* 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) {
function assignFallback(obj, props) {
for (let i in props) obj[i] = props[i];
return /** @type {O & P} */ (obj);
}
Expand Down

0 comments on commit e5b9d35

Please sign in to comment.