mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-10 21:01:41 +00:00
update
This commit is contained in:
21
node_modules/align-text/LICENSE
generated
vendored
Normal file
21
node_modules/align-text/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 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.
|
236
node_modules/align-text/README.md
generated
vendored
Normal file
236
node_modules/align-text/README.md
generated
vendored
Normal file
@ -0,0 +1,236 @@
|
||||
# align-text [](http://badge.fury.io/js/align-text) [](https://travis-ci.org/jonschlinkert/align-text)
|
||||
|
||||
> Align the text in a string.
|
||||
|
||||
**Examples**
|
||||
|
||||
Align text values in an array:
|
||||
|
||||
```js
|
||||
align([1, 2, 3, 100]);
|
||||
//=> [' 1', ' 2', ' 3', '100']
|
||||
```
|
||||
|
||||
Or [do stuff like this](./example.js):
|
||||
|
||||
[](./example.js)
|
||||
|
||||
Visit [the example](./example.js) to see how this works.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/)
|
||||
|
||||
```sh
|
||||
$ npm i align-text --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var align = require('align-text');
|
||||
align(text, callback_function_or_integer);
|
||||
```
|
||||
|
||||
**Params**
|
||||
|
||||
* `text` can be a **string or array**. If a string is passed, a string will be returned. If an array is passed, an array will be returned.
|
||||
* `callback|integer`: if an integer, the text will be indented by that amount. If a function, it must return an integer representing the amount of leading indentation to use as `align` loops over each line.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
align(text, 4);
|
||||
```
|
||||
|
||||
Would align:
|
||||
|
||||
```
|
||||
abc
|
||||
abc
|
||||
abc
|
||||
```
|
||||
|
||||
To:
|
||||
|
||||
```
|
||||
abc
|
||||
abc
|
||||
abc
|
||||
```
|
||||
|
||||
## callback
|
||||
|
||||
### params
|
||||
|
||||
The callback is used to determine the indentation of each line and gets the following params:
|
||||
|
||||
* `len` the length of the "current" line
|
||||
* `longest` the length of the longest line
|
||||
* `line` the current line (string) being aligned
|
||||
* `lines` the array of all lines
|
||||
|
||||
### return
|
||||
|
||||
The callback may return:
|
||||
|
||||
* an integer that represents the number of spaces to use for padding,
|
||||
* or an object with the following properties:
|
||||
- `indent`: **{Number}** the amount of indentation to use. Default is `0` when an object is returned.
|
||||
- `character`: **{String}** the character to use for indentation. Default is `''` (empty string) when an object is returned.
|
||||
- `prefix`: **{String}** leading characters to use at the beginning of each line. `''` (empty string) when an object is returned.
|
||||
|
||||
**Integer example:**
|
||||
|
||||
```js
|
||||
// calculate half the difference between the length
|
||||
// of the current line and the longest line
|
||||
function centerAlign(len, longest, line, lines) {
|
||||
return Math.floor((longest - len) / 2);
|
||||
}
|
||||
```
|
||||
|
||||
**Object example:**
|
||||
|
||||
```js
|
||||
function centerAlign(len, longest, line, lines) {
|
||||
return {
|
||||
character: '\t',
|
||||
indent: Math.floor((longest - len) / 2),
|
||||
prefix: '~ ',
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Usage examples
|
||||
|
||||
### Center align
|
||||
|
||||
Using the `centerAlign` function from above:
|
||||
|
||||
```js
|
||||
align(text, centerAlign);
|
||||
```
|
||||
|
||||
Would align this text:
|
||||
|
||||
```js
|
||||
Lorem ipsum dolor sit amet
|
||||
consectetur adipiscin
|
||||
elit, sed do eiusmod tempor incididun
|
||||
ut labore et dolor
|
||||
magna aliqua. Ut enim ad mini
|
||||
veniam, quis
|
||||
```
|
||||
|
||||
Resulting in this:
|
||||
|
||||
```
|
||||
Lorem ipsum dolor sit amet,
|
||||
consectetur adipiscing
|
||||
elit, sed do eiusmod tempor incididunt
|
||||
ut labore et dolore
|
||||
magna aliqua. Ut enim ad minim
|
||||
veniam, quis
|
||||
```
|
||||
|
||||
**Customize**
|
||||
|
||||
If you wanted to add more padding on the left, just pass the number in the callback.
|
||||
|
||||
For example, to add 4 spaces before every line:
|
||||
|
||||
```js
|
||||
function centerAlign(len, longest, line, lines) {
|
||||
return 4 + Math.floor((longest - len) / 2);
|
||||
}
|
||||
```
|
||||
|
||||
Would result in:
|
||||
|
||||
```
|
||||
Lorem ipsum dolor sit amet,
|
||||
consectetur adipiscing
|
||||
elit, sed do eiusmod tempor incididunt
|
||||
ut labore et dolore
|
||||
magna aliqua. Ut enim ad minim
|
||||
veniam, quis
|
||||
```
|
||||
|
||||
### Bullets
|
||||
|
||||
```js
|
||||
align(text, function (len, max, line, lines) {
|
||||
return {prefix: ' - '};
|
||||
});
|
||||
```
|
||||
|
||||
Would return:
|
||||
|
||||
```
|
||||
- Lorem ipsum dolor sit amet,
|
||||
- consectetur adipiscing
|
||||
- elit, sed do eiusmod tempor incididunt
|
||||
- ut labore et dolore
|
||||
- magna aliqua. Ut enim ad minim
|
||||
- veniam, quis
|
||||
```
|
||||
|
||||
### Different indent character
|
||||
|
||||
```js
|
||||
align(text, function (len, max, line, lines) {
|
||||
return {
|
||||
indent: Math.floor((max - len) / 2),
|
||||
character: '~',
|
||||
};
|
||||
});
|
||||
```
|
||||
|
||||
Would return
|
||||
|
||||
```
|
||||
~~~~~Lorem ipsum dolor sit amet,
|
||||
~~~~~~~~consectetur adipiscing
|
||||
elit, sed do eiusmod tempor incididunt
|
||||
~~~~~~~~~ut labore et dolore
|
||||
~~~~magna aliqua. Ut enim ad minim
|
||||
~~~~~~~~~~~~~veniam, quis
|
||||
```
|
||||
|
||||
## Related projects
|
||||
|
||||
* [center-align](https://github.com/jonschlinkert/center-align): Center-align the text in a string.
|
||||
* [justify](https://github.com/bahamas10/node-justify): Left or right (or both) justify text using a custom width and character
|
||||
* [longest](https://github.com/jonschlinkert/longest): Get the longest item in an array.
|
||||
* [right-align](https://github.com/jonschlinkert/right-align): Right-align the text in a string.
|
||||
* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string.
|
||||
* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length.
|
||||
|
||||
## Running tests
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```sh
|
||||
$ npm i -d && npm test
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/align-text/issues/new)
|
||||
|
||||
## Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
+ [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)
|
||||
Released under the MIT license.
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 09, 2015._
|
52
node_modules/align-text/index.js
generated
vendored
Normal file
52
node_modules/align-text/index.js
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
/*!
|
||||
* align-text <https://github.com/jonschlinkert/align-text>
|
||||
*
|
||||
* Copyright (c) 2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var typeOf = require('kind-of');
|
||||
var repeat = require('repeat-string');
|
||||
var longest = require('longest');
|
||||
|
||||
module.exports = function alignText(val, fn) {
|
||||
var lines, type = typeOf(val);
|
||||
|
||||
if (type === 'array') {
|
||||
lines = val;
|
||||
} else if (type === 'string') {
|
||||
lines = val.split(/(?:\r\n|\n)/);
|
||||
} else {
|
||||
throw new TypeError('align-text expects a string or array.');
|
||||
}
|
||||
|
||||
var fnType = typeOf(fn);
|
||||
var len = lines.length;
|
||||
var max = longest(lines);
|
||||
var res = [], i = 0;
|
||||
|
||||
while (len--) {
|
||||
var line = String(lines[i++]);
|
||||
var diff;
|
||||
|
||||
if (fnType === 'function') {
|
||||
diff = fn(line.length, max.length, line, lines, i);
|
||||
} else if (fnType === 'number') {
|
||||
diff = fn;
|
||||
} else {
|
||||
diff = max.length - line.length;
|
||||
}
|
||||
|
||||
if (typeOf(diff) === 'number') {
|
||||
res.push(repeat(' ', diff) + line);
|
||||
} else if (typeOf(diff) === 'object') {
|
||||
var result = repeat(diff.character || ' ', diff.indent || 0);
|
||||
res.push((diff.prefix || '') + result + line);
|
||||
}
|
||||
}
|
||||
|
||||
if (type === 'array') return res;
|
||||
return res.join('\n');
|
||||
};
|
21
node_modules/align-text/node_modules/kind-of/LICENSE
generated
vendored
Normal file
21
node_modules/align-text/node_modules/kind-of/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2017, 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.
|
261
node_modules/align-text/node_modules/kind-of/README.md
generated
vendored
Normal file
261
node_modules/align-text/node_modules/kind-of/README.md
generated
vendored
Normal file
@ -0,0 +1,261 @@
|
||||
# kind-of [](https://www.npmjs.com/package/kind-of) [](https://npmjs.org/package/kind-of) [](https://npmjs.org/package/kind-of) [](https://travis-ci.org/jonschlinkert/kind-of)
|
||||
|
||||
> Get the native type of a value.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm install --save kind-of
|
||||
```
|
||||
|
||||
## Install
|
||||
|
||||
Install with [bower](https://bower.io/)
|
||||
|
||||
```sh
|
||||
$ bower install kind-of --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
> es5, browser and es6 ready
|
||||
|
||||
```js
|
||||
var kindOf = require('kind-of');
|
||||
|
||||
kindOf(undefined);
|
||||
//=> 'undefined'
|
||||
|
||||
kindOf(null);
|
||||
//=> 'null'
|
||||
|
||||
kindOf(true);
|
||||
//=> 'boolean'
|
||||
|
||||
kindOf(false);
|
||||
//=> 'boolean'
|
||||
|
||||
kindOf(new Boolean(true));
|
||||
//=> 'boolean'
|
||||
|
||||
kindOf(new Buffer(''));
|
||||
//=> 'buffer'
|
||||
|
||||
kindOf(42);
|
||||
//=> 'number'
|
||||
|
||||
kindOf(new Number(42));
|
||||
//=> 'number'
|
||||
|
||||
kindOf('str');
|
||||
//=> 'string'
|
||||
|
||||
kindOf(new String('str'));
|
||||
//=> 'string'
|
||||
|
||||
kindOf(arguments);
|
||||
//=> 'arguments'
|
||||
|
||||
kindOf({});
|
||||
//=> 'object'
|
||||
|
||||
kindOf(Object.create(null));
|
||||
//=> 'object'
|
||||
|
||||
kindOf(new Test());
|
||||
//=> 'object'
|
||||
|
||||
kindOf(new Date());
|
||||
//=> 'date'
|
||||
|
||||
kindOf([]);
|
||||
//=> 'array'
|
||||
|
||||
kindOf([1, 2, 3]);
|
||||
//=> 'array'
|
||||
|
||||
kindOf(new Array());
|
||||
//=> 'array'
|
||||
|
||||
kindOf(/foo/);
|
||||
//=> 'regexp'
|
||||
|
||||
kindOf(new RegExp('foo'));
|
||||
//=> 'regexp'
|
||||
|
||||
kindOf(function () {});
|
||||
//=> 'function'
|
||||
|
||||
kindOf(function * () {});
|
||||
//=> 'function'
|
||||
|
||||
kindOf(new Function());
|
||||
//=> 'function'
|
||||
|
||||
kindOf(new Map());
|
||||
//=> 'map'
|
||||
|
||||
kindOf(new WeakMap());
|
||||
//=> 'weakmap'
|
||||
|
||||
kindOf(new Set());
|
||||
//=> 'set'
|
||||
|
||||
kindOf(new WeakSet());
|
||||
//=> 'weakset'
|
||||
|
||||
kindOf(Symbol('str'));
|
||||
//=> 'symbol'
|
||||
|
||||
kindOf(new Int8Array());
|
||||
//=> 'int8array'
|
||||
|
||||
kindOf(new Uint8Array());
|
||||
//=> 'uint8array'
|
||||
|
||||
kindOf(new Uint8ClampedArray());
|
||||
//=> 'uint8clampedarray'
|
||||
|
||||
kindOf(new Int16Array());
|
||||
//=> 'int16array'
|
||||
|
||||
kindOf(new Uint16Array());
|
||||
//=> 'uint16array'
|
||||
|
||||
kindOf(new Int32Array());
|
||||
//=> 'int32array'
|
||||
|
||||
kindOf(new Uint32Array());
|
||||
//=> 'uint32array'
|
||||
|
||||
kindOf(new Float32Array());
|
||||
//=> 'float32array'
|
||||
|
||||
kindOf(new Float64Array());
|
||||
//=> 'float64array'
|
||||
```
|
||||
|
||||
## Benchmarks
|
||||
|
||||
Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of).
|
||||
Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`.
|
||||
|
||||
```bash
|
||||
#1: array
|
||||
current x 23,329,397 ops/sec ±0.82% (94 runs sampled)
|
||||
lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled)
|
||||
lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled)
|
||||
|
||||
#2: boolean
|
||||
current x 27,197,115 ops/sec ±0.85% (94 runs sampled)
|
||||
lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled)
|
||||
lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled)
|
||||
|
||||
#3: date
|
||||
current x 20,190,117 ops/sec ±0.86% (92 runs sampled)
|
||||
lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled)
|
||||
lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled)
|
||||
|
||||
#4: function
|
||||
current x 23,855,460 ops/sec ±0.60% (97 runs sampled)
|
||||
lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled)
|
||||
lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled)
|
||||
|
||||
#5: null
|
||||
current x 27,061,047 ops/sec ±0.97% (96 runs sampled)
|
||||
lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled)
|
||||
lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled)
|
||||
|
||||
#6: number
|
||||
current x 25,075,682 ops/sec ±0.53% (99 runs sampled)
|
||||
lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled)
|
||||
lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled)
|
||||
|
||||
#7: object
|
||||
current x 3,348,980 ops/sec ±0.49% (99 runs sampled)
|
||||
lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled)
|
||||
lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled)
|
||||
|
||||
#8: regex
|
||||
current x 21,284,827 ops/sec ±0.72% (96 runs sampled)
|
||||
lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled)
|
||||
lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled)
|
||||
|
||||
#9: string
|
||||
current x 25,379,234 ops/sec ±0.58% (96 runs sampled)
|
||||
lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled)
|
||||
lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled)
|
||||
|
||||
#10: undef
|
||||
current x 27,459,221 ops/sec ±1.01% (93 runs sampled)
|
||||
lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled)
|
||||
lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled)
|
||||
|
||||
```
|
||||
|
||||
## Optimizations
|
||||
|
||||
In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library:
|
||||
|
||||
1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot.
|
||||
2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it.
|
||||
3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'`
|
||||
|
||||
## About
|
||||
|
||||
### Related projects
|
||||
|
||||
* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet")
|
||||
* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.")
|
||||
* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ")
|
||||
|
||||
### Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||
|
||||
### Contributors
|
||||
|
||||
| **Commits** | **Contributor** |
|
||||
| --- | --- |
|
||||
| 59 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 2 | [miguelmota](https://github.com/miguelmota) |
|
||||
| 1 | [dtothefp](https://github.com/dtothefp) |
|
||||
| 1 | [ksheedlo](https://github.com/ksheedlo) |
|
||||
| 1 | [pdehaan](https://github.com/pdehaan) |
|
||||
| 1 | [laggingreflex](https://github.com/laggingreflex) |
|
||||
|
||||
### Building docs
|
||||
|
||||
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
||||
|
||||
To generate the readme, run the following command:
|
||||
|
||||
```sh
|
||||
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
||||
```
|
||||
|
||||
### Running tests
|
||||
|
||||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
||||
|
||||
```sh
|
||||
$ npm install && npm test
|
||||
```
|
||||
|
||||
### Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT License](LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 16, 2017._
|
116
node_modules/align-text/node_modules/kind-of/index.js
generated
vendored
Normal file
116
node_modules/align-text/node_modules/kind-of/index.js
generated
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
var isBuffer = require('is-buffer');
|
||||
var toString = Object.prototype.toString;
|
||||
|
||||
/**
|
||||
* Get the native `typeof` a value.
|
||||
*
|
||||
* @param {*} `val`
|
||||
* @return {*} Native javascript type
|
||||
*/
|
||||
|
||||
module.exports = function kindOf(val) {
|
||||
// primitivies
|
||||
if (typeof val === 'undefined') {
|
||||
return 'undefined';
|
||||
}
|
||||
if (val === null) {
|
||||
return 'null';
|
||||
}
|
||||
if (val === true || val === false || val instanceof Boolean) {
|
||||
return 'boolean';
|
||||
}
|
||||
if (typeof val === 'string' || val instanceof String) {
|
||||
return 'string';
|
||||
}
|
||||
if (typeof val === 'number' || val instanceof Number) {
|
||||
return 'number';
|
||||
}
|
||||
|
||||
// functions
|
||||
if (typeof val === 'function' || val instanceof Function) {
|
||||
return 'function';
|
||||
}
|
||||
|
||||
// array
|
||||
if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) {
|
||||
return 'array';
|
||||
}
|
||||
|
||||
// check for instances of RegExp and Date before calling `toString`
|
||||
if (val instanceof RegExp) {
|
||||
return 'regexp';
|
||||
}
|
||||
if (val instanceof Date) {
|
||||
return 'date';
|
||||
}
|
||||
|
||||
// other objects
|
||||
var type = toString.call(val);
|
||||
|
||||
if (type === '[object RegExp]') {
|
||||
return 'regexp';
|
||||
}
|
||||
if (type === '[object Date]') {
|
||||
return 'date';
|
||||
}
|
||||
if (type === '[object Arguments]') {
|
||||
return 'arguments';
|
||||
}
|
||||
if (type === '[object Error]') {
|
||||
return 'error';
|
||||
}
|
||||
|
||||
// buffer
|
||||
if (isBuffer(val)) {
|
||||
return 'buffer';
|
||||
}
|
||||
|
||||
// es6: Map, WeakMap, Set, WeakSet
|
||||
if (type === '[object Set]') {
|
||||
return 'set';
|
||||
}
|
||||
if (type === '[object WeakSet]') {
|
||||
return 'weakset';
|
||||
}
|
||||
if (type === '[object Map]') {
|
||||
return 'map';
|
||||
}
|
||||
if (type === '[object WeakMap]') {
|
||||
return 'weakmap';
|
||||
}
|
||||
if (type === '[object Symbol]') {
|
||||
return 'symbol';
|
||||
}
|
||||
|
||||
// typed arrays
|
||||
if (type === '[object Int8Array]') {
|
||||
return 'int8array';
|
||||
}
|
||||
if (type === '[object Uint8Array]') {
|
||||
return 'uint8array';
|
||||
}
|
||||
if (type === '[object Uint8ClampedArray]') {
|
||||
return 'uint8clampedarray';
|
||||
}
|
||||
if (type === '[object Int16Array]') {
|
||||
return 'int16array';
|
||||
}
|
||||
if (type === '[object Uint16Array]') {
|
||||
return 'uint16array';
|
||||
}
|
||||
if (type === '[object Int32Array]') {
|
||||
return 'int32array';
|
||||
}
|
||||
if (type === '[object Uint32Array]') {
|
||||
return 'uint32array';
|
||||
}
|
||||
if (type === '[object Float32Array]') {
|
||||
return 'float32array';
|
||||
}
|
||||
if (type === '[object Float64Array]') {
|
||||
return 'float64array';
|
||||
}
|
||||
|
||||
// must be a plain object
|
||||
return 'object';
|
||||
};
|
142
node_modules/align-text/node_modules/kind-of/package.json
generated
vendored
Normal file
142
node_modules/align-text/node_modules/kind-of/package.json
generated
vendored
Normal file
@ -0,0 +1,142 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"kind-of@3.2.2",
|
||||
"/Users/tatiana/selfdefined"
|
||||
]
|
||||
],
|
||||
"_from": "kind-of@3.2.2",
|
||||
"_id": "kind-of@3.2.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
|
||||
"_location": "/align-text/kind-of",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "kind-of@3.2.2",
|
||||
"name": "kind-of",
|
||||
"escapedName": "kind-of",
|
||||
"rawSpec": "3.2.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.2.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/align-text"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
|
||||
"_spec": "3.2.2",
|
||||
"_where": "/Users/tatiana/selfdefined",
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/kind-of/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "David Fox-Powell",
|
||||
"url": "https://dtothefp.github.io/me"
|
||||
},
|
||||
{
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "http://twitter.com/jonschlinkert"
|
||||
},
|
||||
{
|
||||
"name": "Ken Sheedlo",
|
||||
"url": "kensheedlo.com"
|
||||
},
|
||||
{
|
||||
"name": "laggingreflex",
|
||||
"url": "https://github.com/laggingreflex"
|
||||
},
|
||||
{
|
||||
"name": "Miguel Mota",
|
||||
"url": "https://miguelmota.com"
|
||||
},
|
||||
{
|
||||
"name": "Peter deHaan",
|
||||
"url": "http://about.me/peterdehaan"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"is-buffer": "^1.1.5"
|
||||
},
|
||||
"description": "Get the native type of a value.",
|
||||
"devDependencies": {
|
||||
"ansi-bold": "^0.1.1",
|
||||
"benchmarked": "^1.0.0",
|
||||
"browserify": "^14.3.0",
|
||||
"glob": "^7.1.1",
|
||||
"gulp-format-md": "^0.1.12",
|
||||
"mocha": "^3.3.0",
|
||||
"type-of": "^2.0.1",
|
||||
"typeof": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/jonschlinkert/kind-of",
|
||||
"keywords": [
|
||||
"arguments",
|
||||
"array",
|
||||
"boolean",
|
||||
"check",
|
||||
"date",
|
||||
"function",
|
||||
"is",
|
||||
"is-type",
|
||||
"is-type-of",
|
||||
"kind",
|
||||
"kind-of",
|
||||
"number",
|
||||
"object",
|
||||
"of",
|
||||
"regexp",
|
||||
"string",
|
||||
"test",
|
||||
"type",
|
||||
"type-of",
|
||||
"typeof",
|
||||
"types"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "kind-of",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jonschlinkert/kind-of.git"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublish": "browserify -o browser.js -e index.js -s index --bare",
|
||||
"test": "mocha"
|
||||
},
|
||||
"verb": {
|
||||
"related": {
|
||||
"list": [
|
||||
"is-glob",
|
||||
"is-number",
|
||||
"is-primitive"
|
||||
]
|
||||
},
|
||||
"toc": false,
|
||||
"layout": "default",
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
},
|
||||
"reflinks": [
|
||||
"verb"
|
||||
]
|
||||
},
|
||||
"version": "3.2.2"
|
||||
}
|
83
node_modules/align-text/package.json
generated
vendored
Normal file
83
node_modules/align-text/package.json
generated
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"align-text@0.1.4",
|
||||
"/Users/tatiana/selfdefined"
|
||||
]
|
||||
],
|
||||
"_from": "align-text@0.1.4",
|
||||
"_id": "align-text@0.1.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
|
||||
"_location": "/align-text",
|
||||
"_phantomChildren": {
|
||||
"is-buffer": "1.1.6"
|
||||
},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "align-text@0.1.4",
|
||||
"name": "align-text",
|
||||
"escapedName": "align-text",
|
||||
"rawSpec": "0.1.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.1.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/center-align",
|
||||
"/right-align"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
|
||||
"_spec": "0.1.4",
|
||||
"_where": "/Users/tatiana/selfdefined",
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/align-text/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"kind-of": "^3.0.2",
|
||||
"longest": "^1.0.1",
|
||||
"repeat-string": "^1.5.2"
|
||||
},
|
||||
"description": "Align the text in a string.",
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"should": "*",
|
||||
"word-wrap": "^1.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/jonschlinkert/align-text",
|
||||
"keywords": [
|
||||
"align",
|
||||
"align-center",
|
||||
"alignment",
|
||||
"center",
|
||||
"center-align",
|
||||
"indent",
|
||||
"pad",
|
||||
"padding",
|
||||
"right",
|
||||
"right-align",
|
||||
"text",
|
||||
"typography"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "align-text",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/jonschlinkert/align-text.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"version": "0.1.4"
|
||||
}
|
Reference in New Issue
Block a user