This repository has been archived on 2026-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
todo/client/node_modules/data-view-buffer/index.js

20 lines
485 B
JavaScript
Raw Normal View History

2025-06-13 06:04:40 +00:00
'use strict';
var $TypeError = require('es-errors/type');
var callBound = require('call-bound');
var $dataViewBuffer = callBound('DataView.prototype.buffer', true);
var isDataView = require('is-data-view');
// node <= 0.10, < 0.11.4 has a nonconfigurable own property instead of a prototype getter
/** @type {import('.')} */
module.exports = $dataViewBuffer || function dataViewBuffer(x) {
if (!isDataView(x)) {
throw new $TypeError('not a DataView');
}
return x.buffer;
};