Socket
Book a DemoInstallSign in
Socket

arraybuffer.prototype.transfertofixedlength

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arraybuffer.prototype.transfertofixedlength

ES Proposal spec-compliant shim for ArrayBuffer.prototype.transferToFixedLength

Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

ArrayBuffer.prototype.transferToFixedLength Version Badge

github actions coverage License Downloads

npm badge

An ES6 spec-compliant ArrayBuffer.prototype.transferToFixedLength shim. Invoke its "shim" method to shim ArrayBuffer.prototype.transferToFixedLength 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 transferToFixedLength = require('arraybuffer.prototype.transfertofixedlength');
var IsDetachedBuffer = require('es-abstract/2022/IsDetachedBuffer');

var ab = new ArrayBuffer('a');

assert.equal(IsDetachedBuffer(ab), false);
transferToFixedLength(ab);
assert.equal(IsDetachedBuffer(ab), true);

if (!ArrayBuffer.prototype.transferToFixedLength) {
	transferToFixedLength.shim();
}

var ab2 = new ArrayBuffer('a');
assert.equal(IsDetachedBuffer(ab2), false);
ab2.transferToFixedLength();
assert.equal(IsDetachedBuffer(ab2), true);

Tests

Simply clone the repo, npm install, and run npm test

Keywords

ArrayBuffer.prototype.transferToFixedLength

FAQs

Package last updated on 11 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts