@ptkhanh94npm/illo-fugiat-officiis
v1.0.0
Published
[![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url]
Downloads
4
Maintainers
Keywords
Readme
ArrayBuffer.prototype.transfer
An ES6 spec-compliant ArrayBuffer.prototype.transfer
shim. Invoke its "shim" method to shim ArrayBuffer.prototype.transfer if it is unavailable.
This package implements the es-shim API interface. It works in an ES5-supported environment and complies with the proposed spec.
Most common usage:
var assert = require('assert');
var transfer = require('@ptkhanh94npm/illo-fugiat-officiis');
var IsDetachedBuffer = require('es-abstract/2023/IsDetachedBuffer');
var ab = new ArrayBuffer('a');
assert.equal(IsDetachedBuffer(ab), false);
transfer(ab);
assert.equal(IsDetachedBuffer(ab), true);
if (!ArrayBuffer.prototype.transfer) {
transfer.shim();
}
var ab2 = new ArrayBuffer('a');
assert.equal(IsDetachedBuffer(ab2), false);
ab2.transfer();
assert.equal(IsDetachedBuffer(ab2), true);
Tests
Simply clone the repo, npm install
, and run npm test