analogger 1.12.2 → 1.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,135 @@
1
+ /**
2
+ * DO NOT EDIT THIS FILE DIRECTLY.
3
+ * This file is generated following the conversion of
4
+ * [./node_modules/kind-of/index.js]{@link ./node_modules/kind-of/index.js}
5
+ *
6
+ **/
7
+ var toString = Object.prototype.toString;
8
+
9
+ export default function kindOf(val) {
10
+ if (val === void 0) return 'undefined';
11
+ if (val === null) return 'null';
12
+
13
+ var type = typeof val;
14
+ if (type === 'boolean') return 'boolean';
15
+ if (type === 'string') return 'string';
16
+ if (type === 'number') return 'number';
17
+ if (type === 'symbol') return 'symbol';
18
+ if (type === 'function') {
19
+ return isGeneratorFn(val) ? 'generatorfunction' : 'function';
20
+ }
21
+
22
+ if (isArray(val)) return 'array';
23
+ if (isBuffer(val)) return 'buffer';
24
+ if (isArguments(val)) return 'arguments';
25
+ if (isDate(val)) return 'date';
26
+ if (isError(val)) return 'error';
27
+ if (isRegexp(val)) return 'regexp';
28
+
29
+ switch (ctorName(val)) {
30
+ case 'Symbol': return 'symbol';
31
+ case 'Promise': return 'promise';
32
+
33
+ // Set, Map, WeakSet, WeakMap
34
+ case 'WeakMap': return 'weakmap';
35
+ case 'WeakSet': return 'weakset';
36
+ case 'Map': return 'map';
37
+ case 'Set': return 'set';
38
+
39
+ // 8-bit typed arrays
40
+ case 'Int8Array': return 'int8array';
41
+ case 'Uint8Array': return 'uint8array';
42
+ case 'Uint8ClampedArray': return 'uint8clampedarray';
43
+
44
+ // 16-bit typed arrays
45
+ case 'Int16Array': return 'int16array';
46
+ case 'Uint16Array': return 'uint16array';
47
+
48
+ // 32-bit typed arrays
49
+ case 'Int32Array': return 'int32array';
50
+ case 'Uint32Array': return 'uint32array';
51
+ case 'Float32Array': return 'float32array';
52
+ case 'Float64Array': return 'float64array';
53
+ }
54
+
55
+ if (isGeneratorObj(val)) {
56
+ return 'generator';
57
+ }
58
+
59
+ // Non-plain objects
60
+ type = toString.call(val);
61
+ switch (type) {
62
+ case '[object Object]': return 'object';
63
+ // iterators
64
+ case '[object Map Iterator]': return 'mapiterator';
65
+ case '[object Set Iterator]': return 'setiterator';
66
+ case '[object String Iterator]': return 'stringiterator';
67
+ case '[object Array Iterator]': return 'arrayiterator';
68
+ }
69
+
70
+ // other
71
+ return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
72
+ };
73
+
74
+ function ctorName(val) {
75
+ return typeof val.constructor === 'function' ? val.constructor.name : null;
76
+ }
77
+
78
+ function isArray(val) {
79
+ if (Array.isArray) return Array.isArray(val);
80
+ return val instanceof Array;
81
+ }
82
+
83
+ function isError(val) {
84
+ return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number');
85
+ }
86
+
87
+ function isDate(val) {
88
+ if (val instanceof Date) return true;
89
+ return typeof val.toDateString === 'function'
90
+ && typeof val.getDate === 'function'
91
+ && typeof val.setDate === 'function';
92
+ }
93
+
94
+ function isRegexp(val) {
95
+ if (val instanceof RegExp) return true;
96
+ return typeof val.flags === 'string'
97
+ && typeof val.ignoreCase === 'boolean'
98
+ && typeof val.multiline === 'boolean'
99
+ && typeof val.global === 'boolean';
100
+ }
101
+
102
+ function isGeneratorFn(name, val) {
103
+ return ctorName(name) === 'GeneratorFunction';
104
+ }
105
+
106
+ function isGeneratorObj(val) {
107
+ return typeof val.throw === 'function'
108
+ && typeof val.return === 'function'
109
+ && typeof val.next === 'function';
110
+ }
111
+
112
+ function isArguments(val) {
113
+ try {
114
+ if (typeof val.length === 'number' && typeof val.callee === 'function') {
115
+ return true;
116
+ }
117
+ } catch (err) {
118
+ if (err.message.indexOf('callee') !== -1) {
119
+ return true;
120
+ }
121
+ }
122
+ return false;
123
+ }
124
+
125
+ /**
126
+ * If you need to support Safari 5-7 (8-10 yr-old browser),
127
+ * take a look at https://github.com/feross/is-buffer
128
+ */
129
+
130
+ function isBuffer(val) {
131
+ if (val.constructor && typeof val.constructor.isBuffer === 'function') {
132
+ return val.constructor.isBuffer(val);
133
+ }
134
+ return false;
135
+ }