Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

_cloneDataView.js 507B

12345678910111213141516
  1. var cloneArrayBuffer = require('./_cloneArrayBuffer');
  2. /**
  3. * Creates a clone of `dataView`.
  4. *
  5. * @private
  6. * @param {Object} dataView The data view to clone.
  7. * @param {boolean} [isDeep] Specify a deep clone.
  8. * @returns {Object} Returns the cloned data view.
  9. */
  10. function cloneDataView(dataView, isDeep) {
  11. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  12. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  13. }
  14. module.exports = cloneDataView;