Sha256: cc0218226514a59a5bbd86cd2a38b5f6c1b152c513d55de0300716c6ce372bdf

Contents?: true

Size: 401 Bytes

Versions: 61

Compression:

Stored size: 401 Bytes

Contents

'use strict';
var isFinite = require('is-finite');

module.exports = function (str, n) {
	if (typeof str !== 'string') {
		throw new TypeError('Expected `input` to be a string');
	}

	if (n < 0 || !isFinite(n)) {
		throw new TypeError('Expected `count` to be a positive finite number');
	}

	var ret = '';

	do {
		if (n & 1) {
			ret += str;
		}

		str += str;
	} while ((n >>= 1));

	return ret;
};

Version data entries

61 entries across 57 versions & 18 rubygems

Version Path
immosquare-cleaner-0.1.40 node_modules/repeating/index.js
wice_grid-7.1.0 node_modules/repeating/index.js
optimacms-0.1.61 spec/dummy/node_modules/repeating/index.js
disco_app-0.18.0 test/dummy/node_modules/repeating/index.js
disco_app-0.18.2 test/dummy/node_modules/repeating/index.js
tang-0.2.1 spec/tang_app/node_modules/repeating/index.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/repeating/index.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/repeating/index.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/repeating/index.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/repeating/index.js
tang-0.2.0 spec/tang_app/node_modules/repeating/index.js
tang-0.1.0 spec/tang_app/node_modules/repeating/index.js
tang-0.0.9 spec/tang_app/node_modules/repeating/index.js
enju_library-0.3.8 spec/dummy/node_modules/repeating/index.js
ilog-0.4.1 node_modules/babel-generator/node_modules/repeating/index.js
ilog-0.4.1 node_modules/indent-string/node_modules/repeating/index.js
ilog-0.4.0 node_modules/indent-string/node_modules/repeating/index.js
ilog-0.4.0 node_modules/babel-generator/node_modules/repeating/index.js
ilog-0.3.3 node_modules/indent-string/node_modules/repeating/index.js
ilog-0.3.3 node_modules/babel-generator/node_modules/repeating/index.js