25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
507 B

3 년 전
  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;