@magic/types 0.1.21 → 0.1.22

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/README.md CHANGED
@@ -292,5 +292,9 @@ update dependencies
292
292
  * update dependencies
293
293
  * getLength does not use .length or .size property for unknown types. instead we test for is.array, is.string, is.map etc.
294
294
 
295
- ##### 0.1.22 - unreleased
295
+ ##### 0.1.22
296
+ * update getLength to correctly return the length of buffers (regressed in 0.1.21).
297
+ * add a test case for buffer length
298
+
299
+ ##### 0.1.23 - unreleased
296
300
  ...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magic/types",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "author": "Wizards & Witches",
5
5
  "homepage": "https://github.com/magic/types",
6
6
  "license": "AGPL-3.0",
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