diff options
author | Michaël Zasso <mic.besace@gmail.com> | 2016-01-12 20:50:19 +0100 |
---|---|---|
committer | Roman Reiss <me@silverwind.io> | 2016-01-13 23:15:39 +0100 |
commit | 2d441493a4a46a511ba1bdf93e442c3288fbe92d (patch) | |
tree | c649c3aa100a57ff38ed267e3a5e5bba7ac8d961 /tools/eslint/node_modules/repeat-string | |
parent | ed55169834a3ce16a271def9630c858626ded34d (diff) | |
download | node-new-2d441493a4a46a511ba1bdf93e442c3288fbe92d.tar.gz |
tools: update eslint to v1.10.3
PR-URL: https://github.com/nodejs/io.js/pull/2286
Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'tools/eslint/node_modules/repeat-string')
-rw-r--r-- | tools/eslint/node_modules/repeat-string/LICENSE | 24 | ||||
-rw-r--r-- | tools/eslint/node_modules/repeat-string/README.md | 94 | ||||
-rw-r--r-- | tools/eslint/node_modules/repeat-string/index.js | 66 | ||||
-rw-r--r-- | tools/eslint/node_modules/repeat-string/package.json | 105 |
4 files changed, 289 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/repeat-string/LICENSE b/tools/eslint/node_modules/repeat-string/LICENSE new file mode 100644 index 0000000000..5a9956a75d --- /dev/null +++ b/tools/eslint/node_modules/repeat-string/LICENSE @@ -0,0 +1,24 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/eslint/node_modules/repeat-string/README.md b/tools/eslint/node_modules/repeat-string/README.md new file mode 100644 index 0000000000..aaff72aa07 --- /dev/null +++ b/tools/eslint/node_modules/repeat-string/README.md @@ -0,0 +1,94 @@ +# repeat-string [![NPM version](https://badge.fury.io/js/repeat-string.svg)](http://badge.fury.io/js/repeat-string) [![Build Status](https://travis-ci.org/jonschlinkert/repeat-string.svg)](https://travis-ci.org/jonschlinkert/repeat-string) + +> Repeat the given string n times. Fastest implementation for repeating a string. + +## Install with [npm](npmjs.org) + +```bash +npm i repeat-string --save +``` +## Install with [bower](https://github.com/bower/bower) + +```bash +bower install repeat-string --save +``` + +## Usage + +### [repeat](./index.js#L34) + +Repeat the given `string` the specified `number` of times. + +* `string` **{String}**: The string to repeat +* `number` **{Number}**: The number of times to repeat the string +* `returns` **{String}**: Repeated string + +**Example:** + +```js +var repeat = require('repeat-string'); +repeat('A', 5); +//=> AAAAA +``` + +## Benchmarks + +Repeat string is significantly faster than [repeating](https://github.com/sindresorhus/repeating). + +```bash +# 20,000x + repeat-string.js x 16,634,213 ops/sec ±0.92% (93 runs sampled) + repeating.js x 5,883,928 ops/sec ±0.95% (93 runs sampled) + +# 2,000x + repeat-string.js x 17,438,654 ops/sec ±0.76% (97 runs sampled) + repeating.js x 6,639,978 ops/sec ±0.84% (97 runs sampled) + +# 250x + repeat-string.js x 16,246,885 ops/sec ±0.81% (92 runs sampled) + repeating.js x 7,659,342 ops/sec ±0.67% (99 runs sampled) + +# 50x + repeat-string.js x 15,803,340 ops/sec ±0.74% (92 runs sampled) + repeating.js x 9,668,300 ops/sec ±0.89% (98 runs sampled) + +# 5x + repeat-string.js x 16,926,291 ops/sec ±0.78% (97 runs sampled) + repeating.js x 12,215,384 ops/sec ±1.01% (96 runs sampled) +``` + +**Run the benchmarks** + +Install dev dependencies: + +```bash +npm i -d && node benchmark +``` + +### Other javascript/node.js utils +[repeat-element](https://github.com/jonschlinkert/repeat-element): Create an array by repeating the given string n times. + +## Contributing +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/repeat-string/issues) + +## Running tests +Install dev dependencies: + +```bash +npm i -d && npm test +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License +Copyright (c) 2015 Jon Schlinkert +Released under the MIT license + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on April 01, 2015._ diff --git a/tools/eslint/node_modules/repeat-string/index.js b/tools/eslint/node_modules/repeat-string/index.js new file mode 100644 index 0000000000..c781229b2c --- /dev/null +++ b/tools/eslint/node_modules/repeat-string/index.js @@ -0,0 +1,66 @@ +/*! + * repeat-string <https://github.com/jonschlinkert/repeat-string> + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +/** + * Expose `repeat` + */ + +module.exports = repeat; + +/** + * Repeat the given `string` the specified `number` + * of times. + * + * **Example:** + * + * ```js + * var repeat = require('repeat-string'); + * repeat('A', 5); + * //=> AAAAA + * ``` + * + * @param {String} `string` The string to repeat + * @param {Number} `number` The number of times to repeat the string + * @return {String} Repeated string + * @api public + */ + +function repeat(str, num) { + if (typeof str !== 'string') { + throw new TypeError('repeat-string expects a string.'); + } + + if (num === 1) return str; + if (num === 2) return str + str; + + var max = str.length * num; + if (cache !== str || typeof cache === 'undefined') { + cache = str; + res = ''; + } + + while (max > res.length && num > 0) { + if (num & 1) { + res += str; + } + + num >>= 1; + if (!num) break; + str += str; + } + + return res.substr(0, max); +} + +/** + * Results cache + */ + +var res = ''; +var cache; diff --git a/tools/eslint/node_modules/repeat-string/package.json b/tools/eslint/node_modules/repeat-string/package.json new file mode 100644 index 0000000000..6158c140c0 --- /dev/null +++ b/tools/eslint/node_modules/repeat-string/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + "repeat-string@^1.5.2", + "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/align-text" + ] + ], + "_from": "repeat-string@>=1.5.2 <2.0.0", + "_id": "repeat-string@1.5.2", + "_inCache": true, + "_installable": true, + "_location": "/eslint/repeat-string", + "_nodeVersion": "0.12.0", + "_npmUser": { + "email": "github@sellside.com", + "name": "jonschlinkert" + }, + "_npmVersion": "2.5.1", + "_phantomChildren": {}, + "_requested": { + "name": "repeat-string", + "raw": "repeat-string@^1.5.2", + "rawSpec": "^1.5.2", + "scope": null, + "spec": ">=1.5.2 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/eslint/align-text" + ], + "_resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.5.2.tgz", + "_shasum": "21065f70727ad053a0dd5e957ac9e00c7560d90a", + "_shrinkwrap": null, + "_spec": "repeat-string@^1.5.2", + "_where": "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/align-text", + "author": { + "name": "Jon Schlinkert", + "url": "http://github.com/jonschlinkert/" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/repeat-string/issues" + }, + "dependencies": {}, + "description": "Repeat the given string n times. Fastest implementation for repeating a string.", + "devDependencies": { + "benchmarked": "^0.1.3", + "chalk": "^0.5.1", + "glob": "^4.3.5", + "mocha": "^2.2.1", + "repeating": "^1.1.1", + "should": "^4.0.4" + }, + "directories": {}, + "dist": { + "shasum": "21065f70727ad053a0dd5e957ac9e00c7560d90a", + "tarball": "http://registry.npmjs.org/repeat-string/-/repeat-string-1.5.2.tgz" + }, + "engines": { + "node": ">=0.10" + }, + "files": [ + "index.js" + ], + "gitHead": "bf20e5dc1414305bec6ff26d90988378a5bad6ec", + "homepage": "https://github.com/jonschlinkert/repeat-string", + "keywords": [ + "fast", + "fastest", + "fill", + "left", + "left-pad", + "multiple", + "pad", + "padding", + "repeat", + "repeating", + "repetition", + "right", + "right-pad", + "string", + "times" + ], + "license": { + "type": "MIT", + "url": "https://github.com/jonschlinkert/repeat-string/blob/master/LICENSE" + }, + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "repeat-string", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/jonschlinkert/repeat-string.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.5.2" +} |