@patrtorg/quis-unde

2.9.114 • Public • Published

@patrtorg/quis-unde Version Badge

github actions coverage License Downloads

npm badge

Set a function’s length.

Arguments:

  • fn: the function
  • length: the new length. Must be an integer between 0 and 2**32.
  • loose: Optional. If true, and the length fails to be set, do not throw. Default false.

Returns fn.

Usage

var setFunctionLength = require('@patrtorg/quis-unde');
var assert = require('assert');

function zero() {}
function one(_) {}
function two(_, __) {}

assert.equal(zero.length, 0);
assert.equal(one.length, 1);
assert.equal(two.length, 2);

assert.equal(setFunctionLength(zero, 10), zero);
assert.equal(setFunctionLength(one, 11), one);
assert.equal(setFunctionLength(two, 12), two);

assert.equal(zero.length, 10);
assert.equal(one.length, 11);
assert.equal(two.length, 12);

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.9.1140latest

Version History

VersionDownloads (Last 7 Days)Published
2.9.1140
2.9.11353
2.9.11250
2.9.11153
2.9.11050
2.9.10962
2.9.10855
2.9.10757
2.9.10610
2.9.1057
2.9.1048
2.9.1035
2.9.1022
2.9.1012
2.9.1001
2.9.991
2.9.981
2.9.970
2.9.960
2.9.950
2.9.940
2.9.930
2.9.920
2.9.910
2.9.900
2.9.890
2.8.890
2.8.880
2.8.870
2.8.860
2.8.850
2.8.840
2.7.841
2.7.831
2.7.821
2.7.811
2.7.801
2.7.791
2.7.781
2.6.781
2.6.771
2.6.761
2.6.751
2.6.741
2.6.731
2.6.721
2.5.721
2.5.711
2.4.711
2.4.701
2.4.691
2.4.681
2.4.671
2.4.661
2.4.651
2.4.641
2.4.631
2.4.621
2.4.611
2.4.601
2.4.591
2.4.581
2.4.571
2.4.561
2.4.551
1.4.551
1.4.541
1.4.531
1.4.521
1.4.511
1.4.501
1.4.491
1.4.481
1.4.471
1.4.461
1.4.451
1.4.441
1.4.431
1.4.421
1.4.411
1.4.401
1.4.391
1.4.381
1.3.381
1.3.371
1.3.361
1.3.351
1.3.341
1.3.331
1.3.321
1.3.311
1.3.301
1.3.291
1.3.281
1.3.271
1.2.271
1.2.261
1.1.261
1.1.251
1.1.241
1.1.231
1.1.221
1.1.211
1.1.201
1.1.191
1.1.181
1.1.171
1.1.161
1.1.151
1.1.141
1.1.131
1.1.121
1.1.111
1.1.101
1.1.91
1.1.81
1.1.71
1.1.61
1.1.51
1.1.41
1.0.41
1.0.31
1.0.21
1.0.11
1.0.01

Package Sidebar

Install

npm i @patrtorg/quis-unde

Weekly Downloads

510

Version

2.9.114

License

MIT

Unpacked Size

228 kB

Total Files

634

Last publish

Collaborators

  • minhtran645176