@prismatic-io/spectral 7.6.6 → 7.6.7

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 (2) hide show
  1. package/dist/util.js +2 -4
  2. package/package.json +1 -1
package/dist/util.js CHANGED
@@ -318,14 +318,12 @@ const keyValPairListToObject = (kvpList, valueConverter) => {
318
318
  };
319
319
  /**
320
320
  * This function tests if the object provided is a Prismatic `DataPayload` object.
321
- * A `DataPayload` object is an object with a `data` attribute, and optional `contentType` attribute.
321
+ * A `DataPayload` object is an object with a `data` attribute that is a Buffer, and optional `contentType` attribute.
322
322
  *
323
323
  * @param value The value to test
324
324
  * @returns This function returns true if `value` is a DataPayload object, and false otherwise.
325
325
  */
326
- const isBufferDataPayload = (value) => {
327
- return value instanceof Object && "data" in value;
328
- };
326
+ const isBufferDataPayload = (value) => value instanceof Object && "data" in value && Buffer.isBuffer(value["data"]);
329
327
  /**
330
328
  * Many libraries for third-party API that handle binary files expect `Buffer` objects.
331
329
  * This function helps to convert strings, Uint8Arrays, and Arrays to a data structure
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "7.6.6",
3
+ "version": "7.6.7",
4
4
  "description": "Utility library for building Prismatic components",
5
5
  "keywords": [
6
6
  "prismatic"