mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-03 04:00:48 +05:30
21 lines
340 B
JavaScript
21 lines
340 B
JavaScript
let lastId = 0;
|
|
export function uniqueId(prefix = 'id') {
|
|
return `${prefix}${++lastId}`;
|
|
}
|
|
|
|
/**
|
|
* @param {object} obj
|
|
* @param {array} keys
|
|
*
|
|
* @return {object}
|
|
*/
|
|
export function omit(obj, keys) {
|
|
const newObj = {...obj};
|
|
|
|
keys.forEach((key) => {
|
|
Reflect.deleteProperty(newObj, key);
|
|
});
|
|
|
|
return newObj;
|
|
}
|