mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
react app
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
var pkg = require('./package.json');
|
||||
var repeating = require('./');
|
||||
var argv = process.argv.slice(2);
|
||||
|
||||
function help() {
|
||||
console.log([
|
||||
'',
|
||||
' ' + pkg.description,
|
||||
'',
|
||||
' Usage',
|
||||
' $ repeating <string> <count>',
|
||||
'',
|
||||
' Example',
|
||||
' $ repeating \'unicorn \' 2',
|
||||
' unicorn unicorn'
|
||||
].join('\n'));
|
||||
}
|
||||
|
||||
if (process.argv.indexOf('--help') !== -1) {
|
||||
help();
|
||||
return;
|
||||
}
|
||||
|
||||
if (process.argv.indexOf('--version') !== -1) {
|
||||
console.log(pkg.version);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!argv[1]) {
|
||||
console.error('You have to define how many times to repeat the string.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log(repeating(argv[0], Number(argv[1])));
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
var isFinite = require('is-finite');
|
||||
|
||||
module.exports = function (str, n) {
|
||||
if (typeof str !== 'string') {
|
||||
throw new TypeError('Expected a string as the first argument');
|
||||
}
|
||||
|
||||
if (n < 0 || !isFinite(n)) {
|
||||
throw new TypeError('Expected a finite positive number');
|
||||
}
|
||||
|
||||
var ret = '';
|
||||
|
||||
do {
|
||||
if (n & 1) {
|
||||
ret += str;
|
||||
}
|
||||
|
||||
str += str;
|
||||
} while (n = n >> 1);
|
||||
|
||||
return ret;
|
||||
};
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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.
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"repeating@^1.1.3",
|
||||
"/Users/mromano/dev/react-sfs/node_modules/babel-traverse"
|
||||
]
|
||||
],
|
||||
"_from": "repeating@>=1.1.3 <2.0.0",
|
||||
"_id": "repeating@1.1.3",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/repeating",
|
||||
"_nodeVersion": "0.12.4",
|
||||
"_npmUser": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "sindresorhus"
|
||||
},
|
||||
"_npmVersion": "2.10.1",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "repeating",
|
||||
"raw": "repeating@^1.1.3",
|
||||
"rawSpec": "^1.1.3",
|
||||
"scope": null,
|
||||
"spec": ">=1.1.3 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/babel-code-frame",
|
||||
"/babel-generator",
|
||||
"/babel-traverse",
|
||||
"/detect-indent"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz",
|
||||
"_shasum": "3d4114218877537494f97f77f9785fab810fa4ac",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "repeating@^1.1.3",
|
||||
"_where": "/Users/mromano/dev/react-sfs/node_modules/babel-traverse",
|
||||
"author": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "Sindre Sorhus",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bin": {
|
||||
"repeating": "cli.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/repeating/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"is-finite": "^1.0.0"
|
||||
},
|
||||
"description": "Repeat a string - fast",
|
||||
"devDependencies": {
|
||||
"ava": "0.0.4"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "3d4114218877537494f97f77f9785fab810fa4ac",
|
||||
"tarball": "http://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"cli.js"
|
||||
],
|
||||
"gitHead": "23e93be864952600940d29c8d67f2b9a09d48d81",
|
||||
"homepage": "https://github.com/sindresorhus/repeating",
|
||||
"keywords": [
|
||||
"cli-app",
|
||||
"cli",
|
||||
"bin",
|
||||
"repeat",
|
||||
"repeating",
|
||||
"string",
|
||||
"str",
|
||||
"text",
|
||||
"fill"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "sindresorhus"
|
||||
}
|
||||
],
|
||||
"name": "repeating",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/repeating.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
},
|
||||
"version": "1.1.3"
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
# repeating [](https://travis-ci.org/sindresorhus/repeating)
|
||||
|
||||
> Repeat a string - fast
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```sh
|
||||
$ npm install --save repeating
|
||||
```
|
||||
|
||||
```js
|
||||
var repeating = require('repeating');
|
||||
|
||||
repeating('unicorn ', 100);
|
||||
//=> unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn
|
||||
```
|
||||
|
||||
|
||||
## CLI
|
||||
|
||||
```sh
|
||||
$ npm install --global repeating
|
||||
```
|
||||
|
||||
```
|
||||
$ repeating --help
|
||||
|
||||
Usage
|
||||
repeating <string> <count>
|
||||
|
||||
Example
|
||||
repeating 'unicorn ' 2
|
||||
unicorn unicorn
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
Reference in New Issue
Block a user