UNPKG

817 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.isFunction = isFunction;
7exports.isString = isString;
8exports.noop = noop;
9exports.pick = pick;
10exports.uniqueId = uniqueId;
11var idCounter = 0; // eslint-disable-next-line @typescript-eslint/ban-types
12
13function isFunction(value) {
14 return typeof value === 'function';
15}
16
17function isString(value) {
18 return typeof value === 'string';
19} // eslint-disable-next-line @typescript-eslint/no-empty-function
20
21
22function noop() {}
23
24function pick(obj, keys) {
25 // eslint-disable-next-line @typescript-eslint/no-explicit-any
26 var result = {};
27 keys.forEach(function (key) {
28 result[key] = obj[key];
29 });
30 return result;
31}
32
33function uniqueId(prefix) {
34 idCounter += 1;
35 return (prefix == null ? '' : String(prefix)) + idCounter;
36}
\No newline at end of file