BigstickCarpet/swagger-express-middleware

View on GitHub
lib/data-store/buffer-polyfill.js

Summary

Maintainability
A
0 mins
Test Coverage
"use strict";

// 0.10.x versions of Node serialize Buffers as arrays instead of objects
if (process.version.substring(0, 6) === "v0.10.") {
  Buffer.prototype.toJSON = function () {
    return {
      type: "Buffer",
      data: Array.prototype.slice.call(this, 0)
    };
  };
}