@magic/types 0.1.21 → 0.1.23

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.
Files changed (3) hide show
  1. package/README.md +55 -17
  2. package/package.json +5 -5
  3. package/src/fns.mjs +1 -1
package/README.md CHANGED
@@ -23,11 +23,13 @@ typechecking utilities
23
23
  [snyk-url]: https://snyk.io/test/github/magic/types
24
24
 
25
25
  ##### install
26
+
26
27
  ```javascript
27
28
  npm install @magic/types
28
29
  ```
29
30
 
30
31
  ##### import single function
32
+
31
33
  ```js
32
34
  // single function import
33
35
  import { isArray } from '@magic/types'
@@ -36,6 +38,7 @@ isArray([]) // true
36
38
  ```
37
39
 
38
40
  ##### import all functions
41
+
39
42
  ```javascript
40
43
  import is from '@magic/types'
41
44
 
@@ -43,6 +46,7 @@ is.array([]) // true
43
46
  ```
44
47
 
45
48
  ##### functions
49
+
46
50
  ```javascript
47
51
 
48
52
  // comparisons
@@ -208,89 +212,123 @@ isOwnProp({ test: undefined }, 'test') // true
208
212
  // alias isOwnProperty, is.ownProperty, is.ownProp, is.prop
209
213
  ```
210
214
 
211
-
212
215
  #### Changelog
213
216
 
214
217
  ##### 0.0.5
218
+
215
219
  added Map, WeakMap, Set and WeakSet
216
220
 
217
221
  ##### 0.1.0
222
+
218
223
  use es6 modules
219
224
 
220
225
  ##### 0.1.1
226
+
221
227
  FIX: add module field to package.json
222
228
 
223
229
  ##### 0.1.2
230
+
224
231
  FIX: is.number no longer errors on node es6 modules and other weird objects
225
232
 
226
233
  ##### 0.1.3
234
+
227
235
  use @magic/deep for is.deep.equal and is.deep.different
228
236
 
229
237
  ##### 0.1.4
238
+
230
239
  is.deep uses @magic/deep now.
231
240
 
232
241
  this means that is.deep.equal(null, undefined) is returning a function now,
233
242
  because it expects currying.
234
243
 
235
244
  ##### 0.1.5
245
+
236
246
  minimum node version is 13.5.0
237
247
 
238
248
  ##### 0.1.6
249
+
239
250
  remove @magic/deep dependency
240
251
 
241
252
  ##### 0.1.7
253
+
242
254
  fix erroneous '@magic/types' import in src/deep/equal.mjs
243
255
 
244
256
  ##### 0.1.8
257
+
245
258
  add
246
- * is.every
247
- * is.some
248
- * is.none
259
+
260
+ - is.every
261
+ - is.some
262
+ - is.none
249
263
 
250
264
  ##### 0.1.9
265
+
251
266
  add is.instanceOf
252
267
 
253
268
  ##### 0.1.10
269
+
254
270
  add isCase, isUpperCase, isLowerCase
255
271
 
256
272
  ##### 0.1.11
273
+
257
274
  add isObjectNative
258
275
 
259
276
  ##### 0.1.12
277
+
260
278
  bump required node version to 14.2.0
261
279
 
262
280
  ##### 0.1.13
263
- * add isAsyncFunction
264
- * add isGeneratorFunction
281
+
282
+ - add isAsyncFunction
283
+ - add isGeneratorFunction
265
284
 
266
285
  ##### 0.1.14
267
- * bump required node version to 14.15.4
268
- * update dependencies
286
+
287
+ - bump required node version to 14.15.4
288
+ - update dependencies
269
289
 
270
290
  ##### 0.1.15
291
+
271
292
  deep.equal now does return true for objects that have undefined property values
272
293
 
273
294
  ##### 0.1.16
274
- * remove circular dependencies
295
+
296
+ - remove circular dependencies
275
297
 
276
298
  ##### 0.1.17
277
- * add isSameType, isSame, same, sameType
278
- * update dev dependencies
299
+
300
+ - add isSameType, isSame, same, sameType
301
+ - update dev dependencies
279
302
 
280
303
  ##### 0.1.18
281
- * add isModule and isOwnProperty
282
- * update dependencies
304
+
305
+ - add isModule and isOwnProperty
306
+ - update dependencies
283
307
 
284
308
  ##### 0.1.19
309
+
285
310
  update dependencies
286
311
 
287
312
  ##### 0.1.20
313
+
288
314
  update dependencies
289
315
 
290
316
  ##### 0.1.21
291
- * isBuffer uses Buffer.isBuffer.
292
- * update dependencies
293
- * getLength does not use .length or .size property for unknown types. instead we test for is.array, is.string, is.map etc.
294
317
 
295
- ##### 0.1.22 - unreleased
318
+ - isBuffer uses Buffer.isBuffer.
319
+ - update dependencies
320
+ - getLength does not use .length or .size property for unknown types. instead we test for is.array, is.string, is.map etc.
321
+
322
+ ##### 0.1.22
323
+
324
+ - update getLength to correctly return the length of buffers (regressed in 0.1.21).
325
+ - add a test case for buffer length
326
+
327
+ ##### 0.1.23
328
+
329
+ - update dev dependencies
330
+ - update docs
331
+
332
+ ##### 0.1.24 - unreleased
333
+
296
334
  ...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magic/types",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "author": "Wizards & Witches",
5
5
  "homepage": "https://github.com/magic/types",
6
6
  "license": "AGPL-3.0",
@@ -36,12 +36,12 @@
36
36
  "devDependencies": {
37
37
  "@magic-modules/git-badges": "0.0.12",
38
38
  "@magic-modules/light-switch": "0.0.11",
39
- "@magic-modules/no-spy": "0.0.7",
39
+ "@magic-modules/no-spy": "0.0.8",
40
40
  "@magic-modules/pre": "0.0.11",
41
41
  "@magic-themes/docs": "0.0.14",
42
- "@magic/core": "0.0.141",
43
- "@magic/format": "0.0.40",
44
- "@magic/test": "0.2.11"
42
+ "@magic/core": "0.0.149",
43
+ "@magic/format": "0.0.50",
44
+ "@magic/test": "0.2.15"
45
45
  },
46
46
  "keywords": [
47
47
  "magic",
package/src/fns.mjs CHANGED
@@ -79,7 +79,7 @@ export const isEmpty = e => {
79
79
  }
80
80
 
81
81
  export const getLength = arg => {
82
- if (isArray(arg) || isString(arg)) {
82
+ if (isArray(arg) || isString(arg) || isBuffer(arg)) {
83
83
  return arg.length
84
84
  } else if (isInteger(arg)) {
85
85
  return arg