diff options
Diffstat (limited to 'node_modules/clone')
-rw-r--r-- | node_modules/clone/clone.js | 8 | ||||
-rw-r--r-- | node_modules/clone/package.json | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/node_modules/clone/clone.js b/node_modules/clone/clone.js index 626375920..ba200c2f9 100644 --- a/node_modules/clone/clone.js +++ b/node_modules/clone/clone.js @@ -63,7 +63,13 @@ function clone(parent, circular, depth, prototype) { } else if (clone.__isDate(parent)) { child = new Date(parent.getTime()); } else if (useBuffer && Buffer.isBuffer(parent)) { - child = new Buffer(parent.length); + if (Buffer.allocUnsafe) { + // Node.js >= 4.5.0 + child = Buffer.allocUnsafe(parent.length); + } else { + // Older Node.js versions + child = new Buffer(parent.length); + } parent.copy(child); return child; } else { diff --git a/node_modules/clone/package.json b/node_modules/clone/package.json index 687fa645e..3ddd242f4 100644 --- a/node_modules/clone/package.json +++ b/node_modules/clone/package.json @@ -8,7 +8,7 @@ "function", "date" ], - "version": "1.0.3", + "version": "1.0.4", "repository": { "type": "git", "url": "git://github.com/pvorb/node-clone.git" |