Sha256: cb289f0f15814693341eac7236bbc38737bfbcecc573a5c6eaaaa4d4955ef86b

Contents?: true

Size: 438 Bytes

Versions: 12

Compression:

Stored size: 438 Bytes

Contents

var toInteger = require('../internals/to-integer');

var max = Math.max;
var min = Math.min;

// Helper for a popular repeating case of the spec:
// Let integer be ? ToInteger(index).
// If integer < 0, let result be max((length + integer), 0); else let result be min(length, length).
module.exports = function (index, length) {
  var integer = toInteger(index);
  return integer < 0 ? max(integer + length, 0) : min(integer, length);
};

Version data entries

12 entries across 12 versions & 4 rubygems

Version Path
disco_app-0.18.0 test/dummy/node_modules/core-js/internals/to-absolute-index.js
disco_app-0.18.2 test/dummy/node_modules/core-js/internals/to-absolute-index.js
condenser-0.0.8 lib/condenser/processors/node_modules/core-js-pure/internals/to-absolute-index.js
jester-data-8.0.0 node_modules/core-js/internals/to-absolute-index.js
ezii-os-5.2.1 node_modules/core-js/internals/to-absolute-index.js
ezii-os-2.0.1 node_modules/core-js/internals/to-absolute-index.js
ezii-os-1.1.0 node_modules/core-js/internals/to-absolute-index.js
ezii-os-1.0.0 node_modules/core-js/internals/to-absolute-index.js
condenser-0.0.7 lib/condenser/processors/node_modules/core-js-pure/internals/to-absolute-index.js
ezii-os-0.0.0.1.0 node_modules/core-js/internals/to-absolute-index.js
ezii-os-0.0.0.0.1 node_modules/core-js/internals/to-absolute-index.js
condenser-0.0.5 lib/condenser/processors/node_modules/core-js-pure/internals/to-absolute-index.js