UNPKG

635 BJavaScriptView Raw
1var idCounter = 0; // eslint-disable-next-line @typescript-eslint/ban-types
2
3export function isFunction(value) {
4 return typeof value === 'function';
5}
6export function isString(value) {
7 return typeof value === 'string';
8} // eslint-disable-next-line @typescript-eslint/no-empty-function
9
10export function noop() {}
11export function pick(obj, keys) {
12 // eslint-disable-next-line @typescript-eslint/no-explicit-any
13 var result = {};
14 keys.forEach(function (key) {
15 result[key] = obj[key];
16 });
17 return result;
18}
19export function uniqueId(prefix) {
20 idCounter += 1;
21 return (prefix == null ? '' : String(prefix)) + idCounter;
22}
\No newline at end of file