is-what 3.5.0 → 3.7.1

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.
package/.eslintignore ADDED
@@ -0,0 +1,8 @@
1
+ # don't ever lint node_modules
2
+ node_modules
3
+ # don't lint build output (make sure it's set to your correct build folder name)
4
+ dist
5
+ # don't lint nyc coverage output
6
+ coverage
7
+
8
+ test
package/.eslintrc.js ADDED
@@ -0,0 +1,17 @@
1
+ // npm i -D @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-plugin-tree-shaking
2
+ module.exports = {
3
+ root: true,
4
+ parser: '@typescript-eslint/parser',
5
+ plugins: ['@typescript-eslint', 'tree-shaking'],
6
+ extends: [
7
+ 'eslint:recommended',
8
+ 'plugin:@typescript-eslint/eslint-recommended',
9
+ 'plugin:@typescript-eslint/recommended',
10
+ 'prettier/@typescript-eslint',
11
+ ],
12
+ rules: {
13
+ '@typescript-eslint/no-explicit-any': 'off',
14
+ '@typescript-eslint/ban-ts-ignore': 'off',
15
+ 'tree-shaking/no-side-effects-in-initialization': 'error',
16
+ },
17
+ }
package/dist/index.cjs.js CHANGED
@@ -136,7 +136,7 @@ function isBoolean(payload) {
136
136
  return getType(payload) === 'Boolean';
137
137
  }
138
138
  /**
139
- * Returns whether the payload is a regular expression
139
+ * Returns whether the payload is a regular expression (RegExp)
140
140
  *
141
141
  * @param {*} payload
142
142
  * @returns {payload is RegExp}
@@ -154,7 +154,7 @@ function isSymbol(payload) {
154
154
  return getType(payload) === 'Symbol';
155
155
  }
156
156
  /**
157
- * Returns whether the payload is a date, and that the date is Valid
157
+ * Returns whether the payload is a Date, and that the date is valid
158
158
  *
159
159
  * @param {*} payload
160
160
  * @returns {payload is Date}
@@ -163,7 +163,7 @@ function isDate(payload) {
163
163
  return getType(payload) === 'Date' && !isNaN(payload);
164
164
  }
165
165
  /**
166
- * Returns whether the payload is a blob
166
+ * Returns whether the payload is a Blob
167
167
  *
168
168
  * @param {*} payload
169
169
  * @returns {payload is Blob}
@@ -172,7 +172,7 @@ function isBlob(payload) {
172
172
  return getType(payload) === 'Blob';
173
173
  }
174
174
  /**
175
- * Returns whether the payload is a file
175
+ * Returns whether the payload is a File
176
176
  *
177
177
  * @param {*} payload
178
178
  * @returns {payload is File}
@@ -180,6 +180,24 @@ function isBlob(payload) {
180
180
  function isFile(payload) {
181
181
  return getType(payload) === 'File';
182
182
  }
183
+ /**
184
+ * Returns whether the payload is a Promise
185
+ *
186
+ * @param {*} payload
187
+ * @returns {payload is Promise}
188
+ */
189
+ function isPromise(payload) {
190
+ return getType(payload) === 'Promise';
191
+ }
192
+ /**
193
+ * Returns whether the payload is an Error
194
+ *
195
+ * @param {*} payload
196
+ * @returns {payload is Error}
197
+ */
198
+ function isError(payload) {
199
+ return getType(payload) === 'Error';
200
+ }
183
201
  /**
184
202
  * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)
185
203
  *
@@ -218,7 +236,7 @@ function isType(payload, type) {
218
236
  if (!(type instanceof Function)) {
219
237
  throw new TypeError('Type must be a function');
220
238
  }
221
- if (!type.hasOwnProperty('prototype')) {
239
+ if (!Object.prototype.hasOwnProperty.call(type, 'prototype')) {
222
240
  throw new TypeError('Type is not a class');
223
241
  }
224
242
  // Classes usually have names (as functions usually have names)
@@ -233,6 +251,7 @@ exports.isBlob = isBlob;
233
251
  exports.isBoolean = isBoolean;
234
252
  exports.isDate = isDate;
235
253
  exports.isEmptyString = isEmptyString;
254
+ exports.isError = isError;
236
255
  exports.isFile = isFile;
237
256
  exports.isFullString = isFullString;
238
257
  exports.isFunction = isFunction;
@@ -243,6 +262,7 @@ exports.isObject = isObject;
243
262
  exports.isObjectLike = isObjectLike;
244
263
  exports.isPlainObject = isPlainObject;
245
264
  exports.isPrimitive = isPrimitive;
265
+ exports.isPromise = isPromise;
246
266
  exports.isRegExp = isRegExp;
247
267
  exports.isString = isString;
248
268
  exports.isSymbol = isSymbol;
package/dist/index.esm.js CHANGED
@@ -132,7 +132,7 @@ function isBoolean(payload) {
132
132
  return getType(payload) === 'Boolean';
133
133
  }
134
134
  /**
135
- * Returns whether the payload is a regular expression
135
+ * Returns whether the payload is a regular expression (RegExp)
136
136
  *
137
137
  * @param {*} payload
138
138
  * @returns {payload is RegExp}
@@ -150,7 +150,7 @@ function isSymbol(payload) {
150
150
  return getType(payload) === 'Symbol';
151
151
  }
152
152
  /**
153
- * Returns whether the payload is a date, and that the date is Valid
153
+ * Returns whether the payload is a Date, and that the date is valid
154
154
  *
155
155
  * @param {*} payload
156
156
  * @returns {payload is Date}
@@ -159,7 +159,7 @@ function isDate(payload) {
159
159
  return getType(payload) === 'Date' && !isNaN(payload);
160
160
  }
161
161
  /**
162
- * Returns whether the payload is a blob
162
+ * Returns whether the payload is a Blob
163
163
  *
164
164
  * @param {*} payload
165
165
  * @returns {payload is Blob}
@@ -168,7 +168,7 @@ function isBlob(payload) {
168
168
  return getType(payload) === 'Blob';
169
169
  }
170
170
  /**
171
- * Returns whether the payload is a file
171
+ * Returns whether the payload is a File
172
172
  *
173
173
  * @param {*} payload
174
174
  * @returns {payload is File}
@@ -176,6 +176,24 @@ function isBlob(payload) {
176
176
  function isFile(payload) {
177
177
  return getType(payload) === 'File';
178
178
  }
179
+ /**
180
+ * Returns whether the payload is a Promise
181
+ *
182
+ * @param {*} payload
183
+ * @returns {payload is Promise}
184
+ */
185
+ function isPromise(payload) {
186
+ return getType(payload) === 'Promise';
187
+ }
188
+ /**
189
+ * Returns whether the payload is an Error
190
+ *
191
+ * @param {*} payload
192
+ * @returns {payload is Error}
193
+ */
194
+ function isError(payload) {
195
+ return getType(payload) === 'Error';
196
+ }
179
197
  /**
180
198
  * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)
181
199
  *
@@ -214,7 +232,7 @@ function isType(payload, type) {
214
232
  if (!(type instanceof Function)) {
215
233
  throw new TypeError('Type must be a function');
216
234
  }
217
- if (!type.hasOwnProperty('prototype')) {
235
+ if (!Object.prototype.hasOwnProperty.call(type, 'prototype')) {
218
236
  throw new TypeError('Type is not a class');
219
237
  }
220
238
  // Classes usually have names (as functions usually have names)
@@ -222,4 +240,4 @@ function isType(payload, type) {
222
240
  return getType(payload) === name || Boolean(payload && payload.constructor === type);
223
241
  }
224
242
 
225
- export { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyString, isFile, isFullString, isFunction, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPrimitive, isRegExp, isString, isSymbol, isType, isUndefined };
243
+ export { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyString, isError, isFile, isFullString, isFunction, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPrimitive, isPromise, isRegExp, isString, isSymbol, isType, isUndefined };
package/package.json CHANGED
@@ -1,14 +1,18 @@
1
1
  {
2
2
  "name": "is-what",
3
- "version": "3.5.0",
3
+ "sideEffects": false,
4
+ "version": "3.7.1",
4
5
  "description": "JS type check (TypeScript supported) functions like `isPlainObject() isArray()` etc. A simple & small integration.",
5
6
  "main": "dist/index.cjs.js",
6
7
  "module": "dist/index.esm.js",
7
8
  "typings": "types/index.d.ts",
8
9
  "scripts": {
10
+ "ava": "ava",
9
11
  "test": "jest",
10
12
  "test-w": "jest --watchAll",
11
- "build": "rollup -c ./build/rollup.js && npm run test"
13
+ "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
14
+ "rollup": "rollup -c ./build/rollup.js",
15
+ "build": "npm run lint && npm run rollup && npm run test"
12
16
  },
13
17
  "repository": {
14
18
  "type": "git",
@@ -41,18 +45,29 @@
41
45
  "url": "https://github.com/mesqueeb/is-what/issues"
42
46
  },
43
47
  "homepage": "https://github.com/mesqueeb/is-what#readme",
48
+ "dependencies": {},
44
49
  "devDependencies": {
45
- "@babel/core": "^7.7.4",
50
+ "@babel/core": "^7.8.7",
46
51
  "@types/babel-core": "^6.25.6",
47
- "@types/jest": "^24.0.23",
52
+ "@types/jest": "^25.1.4",
53
+ "@typescript-eslint/eslint-plugin": "^2.23.0",
54
+ "@typescript-eslint/parser": "^2.23.0",
55
+ "ava": "^3.5.0",
48
56
  "babel-core": "^7.0.0-bridge.0",
49
- "babel-jest": "^24.9.0",
57
+ "babel-jest": "^25.1.0",
50
58
  "babel-preset-env": "^1.7.0",
51
- "jest": "^24.9.0",
52
- "regenerator-runtime": "^0.13.3",
53
- "rollup": "^1.27.4",
54
- "rollup-plugin-typescript2": "^0.25.2",
55
- "typescript": "^3.7.2"
59
+ "eslint": "^6.8.0",
60
+ "eslint-config-prettier": "^6.10.0",
61
+ "eslint-plugin-tree-shaking": "^1.8.0",
62
+ "jest": "^25.1.0",
63
+ "regenerator-runtime": "^0.13.5",
64
+ "rollup": "^1.32.1",
65
+ "rollup-plugin-typescript2": "^0.26.0",
66
+ "ts-node": "^8.6.2",
67
+ "typescript": "^3.8.3"
56
68
  },
57
- "dependencies": {}
69
+ "ava": {
70
+ "extensions": ["ts"],
71
+ "require": ["ts-node/register"]
72
+ }
58
73
  }
package/src/index.ts CHANGED
@@ -145,7 +145,7 @@ export function isBoolean (payload: any): payload is boolean {
145
145
  }
146
146
 
147
147
  /**
148
- * Returns whether the payload is a regular expression
148
+ * Returns whether the payload is a regular expression (RegExp)
149
149
  *
150
150
  * @param {*} payload
151
151
  * @returns {payload is RegExp}
@@ -165,7 +165,7 @@ export function isSymbol (payload: any): payload is symbol {
165
165
  }
166
166
 
167
167
  /**
168
- * Returns whether the payload is a date, and that the date is Valid
168
+ * Returns whether the payload is a Date, and that the date is valid
169
169
  *
170
170
  * @param {*} payload
171
171
  * @returns {payload is Date}
@@ -175,7 +175,7 @@ export function isDate (payload: any): payload is Date {
175
175
  }
176
176
 
177
177
  /**
178
- * Returns whether the payload is a blob
178
+ * Returns whether the payload is a Blob
179
179
  *
180
180
  * @param {*} payload
181
181
  * @returns {payload is Blob}
@@ -185,7 +185,7 @@ export function isBlob (payload: any): payload is Blob {
185
185
  }
186
186
 
187
187
  /**
188
- * Returns whether the payload is a file
188
+ * Returns whether the payload is a File
189
189
  *
190
190
  * @param {*} payload
191
191
  * @returns {payload is File}
@@ -194,6 +194,26 @@ export function isFile (payload: any): payload is File {
194
194
  return getType(payload) === 'File'
195
195
  }
196
196
 
197
+ /**
198
+ * Returns whether the payload is a Promise
199
+ *
200
+ * @param {*} payload
201
+ * @returns {payload is Promise}
202
+ */
203
+ export function isPromise (payload: any): payload is Promise<any> {
204
+ return getType(payload) === 'Promise'
205
+ }
206
+
207
+ /**
208
+ * Returns whether the payload is an Error
209
+ *
210
+ * @param {*} payload
211
+ * @returns {payload is Error}
212
+ */
213
+ export function isError (payload: any): payload is Error {
214
+ return getType(payload) === 'Error'
215
+ }
216
+
197
217
  /**
198
218
  * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)
199
219
  *
@@ -238,10 +258,10 @@ export function isType<T extends Function> (payload: any, type: T): payload is T
238
258
  if (!(type instanceof Function)) {
239
259
  throw new TypeError('Type must be a function')
240
260
  }
241
- if (!type.hasOwnProperty('prototype')) {
261
+ if (!Object.prototype.hasOwnProperty.call(type, 'prototype')) {
242
262
  throw new TypeError('Type is not a class')
243
263
  }
244
264
  // Classes usually have names (as functions usually have names)
245
- const name: string | undefined | null = (<any>type).name
265
+ const name: string | undefined | null = (type as any).name
246
266
  return getType(payload) === name || Boolean(payload && payload.constructor === type)
247
267
  }
package/test/ava.ts ADDED
@@ -0,0 +1,195 @@
1
+ import test from 'ava'
2
+ import {
3
+ isError,
4
+ isObject,
5
+ isPlainObject,
6
+ isAnyObject,
7
+ isUndefined,
8
+ isNull,
9
+ isNullOrUndefined,
10
+ isFunction,
11
+ isArray,
12
+ isString,
13
+ isEmptyString,
14
+ isFullString,
15
+ isBoolean,
16
+ isRegExp,
17
+ isNumber,
18
+ isDate,
19
+ isSymbol,
20
+ isPrimitive,
21
+ isType,
22
+ // isBlob,
23
+ // isFile,
24
+ isPromise,
25
+ } from '../src/index'
26
+
27
+ // const blob = Buffer.from([])
28
+
29
+ test('Basic true tests', t => {
30
+ t.is(isError(new Error('')), true)
31
+ t.is(isUndefined(undefined), true)
32
+ t.is(isNull(null), true)
33
+ t.is(isNullOrUndefined(null), true)
34
+ t.is(isNullOrUndefined(undefined), true)
35
+ t.is(isObject({}), true)
36
+ t.is(isObject(new Object()), true)
37
+ t.is(
38
+ isFunction(_ => {}),
39
+ true
40
+ )
41
+ t.is(isArray([]), true)
42
+ t.is(isArray(new Array()), true)
43
+ t.is(isString(''), true)
44
+ t.is(isString('_'), true)
45
+ t.is(isEmptyString(''), true)
46
+ t.is(isFullString(' '), true)
47
+ t.is(isBoolean(true), true)
48
+ t.is(isBoolean(false), true)
49
+ t.is(isRegExp(/./), true)
50
+ t.is(isRegExp(/./gi), true)
51
+ t.is(isNumber(0), true)
52
+ t.is(isNumber(1), true)
53
+ t.is(isDate(new Date()), true)
54
+ t.is(isSymbol(Symbol()), true)
55
+ // t.is(isBlob(blob), true)
56
+ // t.is(isFile(new File([''], '', { type: 'text/html' })), true)
57
+ t.is(isPromise(new Promise((resolve, reject) => {})), true)
58
+ })
59
+
60
+ test('Basic false tests', t => {
61
+ t.is(isError({}), false)
62
+ t.is(isNumber(NaN), false)
63
+ t.is(isDate(new Date('_')), false)
64
+ t.is(isDate(NaN), false)
65
+ t.is(isUndefined(NaN), false)
66
+ t.is(isNull(NaN), false)
67
+ t.is(isObject(NaN), false)
68
+ t.is(isFunction(NaN), false)
69
+ t.is(isArray(NaN), false)
70
+ t.is(isString(NaN), false)
71
+ t.is(isEmptyString(' '), false)
72
+ t.is(isFullString(''), false)
73
+ t.is(isBoolean(NaN), false)
74
+ t.is(isRegExp(NaN), false)
75
+ t.is(isSymbol(NaN), false)
76
+ t.is(isNullOrUndefined(NaN), false)
77
+ })
78
+
79
+ test('Primitive tests', t => {
80
+ // true
81
+ t.is(isPrimitive(0), true)
82
+ t.is(isPrimitive(''), true)
83
+ t.is(isPrimitive('str'), true)
84
+ t.is(isPrimitive(Symbol()), true)
85
+ t.is(isPrimitive(true), true)
86
+ t.is(isPrimitive(false), true)
87
+ t.is(isPrimitive(null), true)
88
+ t.is(isPrimitive(undefined), true)
89
+ // false
90
+ t.is(isPrimitive(NaN), false)
91
+ t.is(isPrimitive([]), false)
92
+ t.is(isPrimitive(new Array()), false)
93
+ t.is(isPrimitive({}), false)
94
+ t.is(isPrimitive(new Object()), false)
95
+ t.is(isPrimitive(new Date()), false)
96
+ t.is(
97
+ isPrimitive(_ => {}),
98
+ false
99
+ )
100
+ })
101
+
102
+ test('Date exception', t => {
103
+ t.is(isDate(new Date('_')), false)
104
+ })
105
+
106
+ test('Generic isType', t => {
107
+ function MyClass () {}
108
+ // This is correct old fashion syntax for classes, if this is missing
109
+ MyClass.prototype.constructor = MyClass
110
+ class MyOtherClass {}
111
+ const myClass = new MyClass()
112
+ // this is expected behaviour
113
+ t.is(isType('', String), true)
114
+ t.is(isType('_', String), true)
115
+ t.is(isType('Hello World', String), true)
116
+ t.is(isType(NaN, Number), true)
117
+ t.is(isType(0, Number), true)
118
+ t.is(isType(1, Number), true)
119
+ t.is(isType({}, Object), true)
120
+ t.is(isType(new Object(), Object), true)
121
+ t.is(isType([], Array), true)
122
+ t.is(isType(new Array(), Array), true)
123
+ t.is(
124
+ isType(_ => {}, Function),
125
+ true
126
+ )
127
+ t.is(isType(true, Boolean), true)
128
+ t.is(isType(false, Boolean), true)
129
+ t.is(isType(new Date('_'), Date), true)
130
+ t.is(isType(new Date(), Date), true)
131
+ t.is(isType(/./, RegExp), true)
132
+ t.is(isType(/./gi, RegExp), true)
133
+ t.is(isType(myClass, MyClass), true)
134
+ t.is(isType(new MyOtherClass(), MyOtherClass), true)
135
+ t.is(isType(myClass, MyOtherClass), false)
136
+ t.is(isType(Symbol(), Symbol), true)
137
+ // t.is(isType(null, Null), true)
138
+ // t.is(isType(undefined, Undefined), true)
139
+ // It SHOULD fail
140
+ t.is(isType(5, String), false)
141
+ t.is(isType(null, Object), false)
142
+ // Not sure if this would be the expected behaviour but everything is an object
143
+ // so I would say so
144
+ t.is(isType(myClass, Object), true)
145
+ })
146
+
147
+ test('isObject vs isAnyObject', t => {
148
+ function MyClass () {}
149
+ // This is correct old fashion syntax for classes, if this is missing
150
+ MyClass.prototype.constructor = MyClass
151
+ const myClass = new MyClass()
152
+ class MyClass2 {}
153
+ const myClass2 = new MyClass()
154
+ const mySpecialObject = {}
155
+ Object.setPrototypeOf(mySpecialObject, {
156
+ toDate: function () {
157
+ return new Date()
158
+ },
159
+ })
160
+ // IS OBJECT
161
+ // plain object
162
+ t.is(isObject({}), true)
163
+ t.is(isObject(new Object()), true)
164
+ t.is(isPlainObject({}), true)
165
+ t.is(isPlainObject(new Object()), true)
166
+ // classes & prototypes
167
+ t.is(isObject(myClass), false)
168
+ t.is(isObject(myClass2), false)
169
+ t.is(isObject(mySpecialObject), false)
170
+ t.is(isPlainObject(myClass), false)
171
+ t.is(isPlainObject(myClass2), false)
172
+ t.is(isPlainObject(mySpecialObject), false)
173
+ // arrays and dates
174
+ t.is(isObject([]), false)
175
+ t.is(isObject(new Array()), false)
176
+ t.is(isObject(new Date('_')), false)
177
+ t.is(isObject(new Date()), false)
178
+ t.is(isPlainObject([]), false)
179
+ t.is(isPlainObject(new Array()), false)
180
+ t.is(isPlainObject(new Date('_')), false)
181
+ t.is(isPlainObject(new Date()), false)
182
+ // IS ANY OBJECT
183
+ // plain object
184
+ t.is(isAnyObject({}), true)
185
+ t.is(isAnyObject(new Object()), true)
186
+ // classes & prototypes
187
+ t.is(isAnyObject(myClass), true)
188
+ t.is(isAnyObject(myClass2), true)
189
+ t.is(isAnyObject(mySpecialObject), true)
190
+ // arrays and dates
191
+ t.is(isAnyObject([]), false)
192
+ t.is(isAnyObject(new Array()), false)
193
+ t.is(isAnyObject(new Date('_')), false)
194
+ t.is(isAnyObject(new Date()), false)
195
+ })
@@ -1,3 +1,4 @@
1
+ // @ts-check
1
2
  import {
2
3
  isObject,
3
4
  isPlainObject,
@@ -19,6 +20,7 @@ import {
19
20
  isType,
20
21
  isBlob,
21
22
  isFile,
23
+ isPromise,
22
24
  } from '../dist/index.cjs'
23
25
 
24
26
  test('Basic true tests', () => {
@@ -45,6 +47,7 @@ test('Basic true tests', () => {
45
47
  expect(isSymbol(Symbol())).toBe(true)
46
48
  expect(isBlob(new Blob())).toBe(true)
47
49
  expect(isFile(new File([''], '', { type: 'text/html' }))).toBe(true)
50
+ expect(isPromise(new Promise((resolve, reject) => {}))).toBe(true)
48
51
  })
49
52
 
50
53
  test('Basic false tests', () => {
package/types/index.d.ts CHANGED
@@ -108,7 +108,7 @@ export declare function isNumber(payload: any): payload is number;
108
108
  */
109
109
  export declare function isBoolean(payload: any): payload is boolean;
110
110
  /**
111
- * Returns whether the payload is a regular expression
111
+ * Returns whether the payload is a regular expression (RegExp)
112
112
  *
113
113
  * @param {*} payload
114
114
  * @returns {payload is RegExp}
@@ -122,26 +122,40 @@ export declare function isRegExp(payload: any): payload is RegExp;
122
122
  */
123
123
  export declare function isSymbol(payload: any): payload is symbol;
124
124
  /**
125
- * Returns whether the payload is a date, and that the date is Valid
125
+ * Returns whether the payload is a Date, and that the date is valid
126
126
  *
127
127
  * @param {*} payload
128
128
  * @returns {payload is Date}
129
129
  */
130
130
  export declare function isDate(payload: any): payload is Date;
131
131
  /**
132
- * Returns whether the payload is a blob
132
+ * Returns whether the payload is a Blob
133
133
  *
134
134
  * @param {*} payload
135
135
  * @returns {payload is Blob}
136
136
  */
137
137
  export declare function isBlob(payload: any): payload is Blob;
138
138
  /**
139
- * Returns whether the payload is a file
139
+ * Returns whether the payload is a File
140
140
  *
141
141
  * @param {*} payload
142
142
  * @returns {payload is File}
143
143
  */
144
144
  export declare function isFile(payload: any): payload is File;
145
+ /**
146
+ * Returns whether the payload is a Promise
147
+ *
148
+ * @param {*} payload
149
+ * @returns {payload is Promise}
150
+ */
151
+ export declare function isPromise(payload: any): payload is Promise<any>;
152
+ /**
153
+ * Returns whether the payload is an Error
154
+ *
155
+ * @param {*} payload
156
+ * @returns {payload is Error}
157
+ */
158
+ export declare function isError(payload: any): payload is Error;
145
159
  /**
146
160
  * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)
147
161
  *
package/wallaby.conf.js DELETED
@@ -1,23 +0,0 @@
1
- module.exports = function (wallaby) {
2
- return {
3
- files: [
4
- 'src/**/*.ts',
5
- 'dist/**/*.js'
6
- ],
7
- tests: [
8
- 'test/**/*.js'
9
- ],
10
- env: {
11
- type: 'node',
12
- runner: 'node'
13
- },
14
- compilers: {
15
- '**/*.+(js|ts)': wallaby.compilers.typeScript({allowJs: true, outDir: './bin'})
16
- },
17
- preprocessors: {
18
- '**/*.jsts': file => file.changeExt('js').content
19
- },
20
- testFramework: 'jest',
21
- debug: true
22
- }
23
- }