all these changes

This commit is contained in:
Jake Kasper
2026-04-09 13:19:47 -05:00
parent e83a51a051
commit 65315f36d1
39102 changed files with 7932979 additions and 567 deletions

View File

@@ -0,0 +1,18 @@
'use strict';
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var toString = require('../internals/to-string');
var requireObjectCoercible = require('../internals/require-object-coercible');
var $RangeError = RangeError;
var floor = Math.floor;
// `String.prototype.repeat` method implementation
// https://tc39.es/ecma262/#sec-string.prototype.repeat
module.exports = function repeat(count) {
var str = toString(requireObjectCoercible(this));
var result = '';
var n = toIntegerOrInfinity(count);
if (n < 0 || n === Infinity) throw new $RangeError('Wrong number of repetitions');
for (;n > 0; (n = floor(n / 2)) && (str += str)) if (n % 2) result += str;
return result;
};