Sha256: 550ed5b37392bd96493b0c38212a5bf8779890b7ba964d2ac4049c41e80f774a

Contents?: true

Size: 1.03 KB

Versions: 264

Compression:

Stored size: 1.03 KB

Contents

var root = require('./_root');

/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;

/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;

/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;

/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined,
    allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;

/**
 * Creates a clone of  `buffer`.
 *
 * @private
 * @param {Buffer} buffer The buffer to clone.
 * @param {boolean} [isDeep] Specify a deep clone.
 * @returns {Buffer} Returns the cloned buffer.
 */
function cloneBuffer(buffer, isDeep) {
  if (isDeep) {
    return buffer.slice();
  }
  var length = buffer.length,
      result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);

  buffer.copy(result);
  return result;
}

module.exports = cloneBuffer;

Version data entries

264 entries across 262 versions & 29 rubygems

Version Path
trusty-cms-6.3.1 node_modules/lodash/_cloneBuffer.js
immosquare-cleaner-0.1.51 node_modules/lodash/_cloneBuffer.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/_cloneBuffer.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/_cloneBuffer.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/_cloneBuffer.js
immosquare-cleaner-0.1.50 node_modules/lodash/_cloneBuffer.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/_cloneBuffer.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/_cloneBuffer.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/lodash/_cloneBuffer.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/lodash/_cloneBuffer.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/lodash/_cloneBuffer.js
clapton-0.0.19 lib/clapton/javascripts/node_modules/lodash/_cloneBuffer.js
clapton-0.0.18 lib/clapton/javascripts/node_modules/lodash/_cloneBuffer.js
clapton-0.0.17 lib/clapton/javascripts/node_modules/lodash/_cloneBuffer.js
clapton-0.0.16 lib/clapton/javascripts/node_modules/lodash/_cloneBuffer.js
clapton-0.0.15 lib/clapton/javascripts/node_modules/lodash/_cloneBuffer.js
immosquare-cleaner-0.1.49 node_modules/lodash/_cloneBuffer.js
clapton-0.0.14 lib/clapton/javascripts/node_modules/lodash/_cloneBuffer.js
immosquare-cleaner-0.1.48 node_modules/lodash/_cloneBuffer.js
clapton-0.0.13 lib/clapton/javascripts/node_modules/lodash/_cloneBuffer.js