Added custom log name

This commit is contained in:
2019-11-22 09:43:37 +00:00
parent c4b856da62
commit 646700c73f
699 changed files with 5186 additions and 4259 deletions

40
node_modules/string-width/index.js generated vendored
View File

@ -1,38 +1,36 @@
'use strict';
const stripAnsi = require('strip-ansi');
const isFullwidthCodePoint = require('is-fullwidth-code-point');
const emojiRegex = require('emoji-regex')();
var stripAnsi = require('strip-ansi');
var codePointAt = require('code-point-at');
var isFullwidthCodePoint = require('is-fullwidth-code-point');
module.exports = input => {
input = input.replace(emojiRegex, ' ');
if (typeof input !== 'string' || input.length === 0) {
// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345
module.exports = function (str) {
if (typeof str !== 'string' || str.length === 0) {
return 0;
}
input = stripAnsi(input);
var width = 0;
let width = 0;
str = stripAnsi(str);
for (let i = 0; i < input.length; i++) {
const code = input.codePointAt(i);
for (var i = 0; i < str.length; i++) {
var code = codePointAt(str, i);
// Ignore control characters
if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) {
// ignore control characters
if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) {
continue;
}
// Ignore combining characters
if (code >= 0x300 && code <= 0x36F) {
continue;
}
// Surrogates
if (code > 0xFFFF) {
// surrogates
if (code >= 0x10000) {
i++;
}
width += isFullwidthCodePoint(code) ? 2 : 1;
if (isFullwidthCodePoint(code)) {
width += 2;
} else {
width++;
}
}
return width;

20
node_modules/string-width/license generated vendored
View File

@ -1,9 +1,21 @@
MIT License
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:
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 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.
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.

View File

@ -1,29 +1,29 @@
{
"_from": "string-width@^3.0.0",
"_id": "string-width@3.1.0",
"_from": "string-width@^1.0.1",
"_id": "string-width@1.0.2",
"_inBundle": false,
"_integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
"_integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"_location": "/string-width",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "string-width@^3.0.0",
"raw": "string-width@^1.0.1",
"name": "string-width",
"escapedName": "string-width",
"rawSpec": "^3.0.0",
"rawSpec": "^1.0.1",
"saveSpec": null,
"fetchSpec": "^3.0.0"
"fetchSpec": "^1.0.1"
},
"_requiredBy": [
"/cliui",
"/wrap-ansi",
"/yargs"
"/protobufjs/yargs",
"/wrap-ansi"
],
"_resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
"_shasum": "22767be21b62af1081574306f69ac51b62203961",
"_spec": "string-width@^3.0.0",
"_where": "/home/sergiu/linx-simulator2/node_modules/yargs",
"_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"_shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3",
"_spec": "string-width@^1.0.1",
"_where": "/home/safemobile/LINX/linx-simulator2/node_modules/protobufjs/node_modules/yargs",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
@ -34,18 +34,18 @@
},
"bundleDependencies": false,
"dependencies": {
"emoji-regex": "^7.0.1",
"is-fullwidth-code-point": "^2.0.0",
"strip-ansi": "^5.1.0"
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
"strip-ansi": "^3.0.0"
},
"deprecated": false,
"description": "Get the visual width of a string - the number of columns required to display it",
"devDependencies": {
"ava": "^1.0.1",
"xo": "^0.23.0"
"ava": "*",
"xo": "*"
},
"engines": {
"node": ">=6"
"node": ">=0.10.0"
},
"files": [
"index.js"
@ -86,5 +86,5 @@
"scripts": {
"test": "xo && ava"
},
"version": "3.1.0"
"version": "1.0.2"
}

View File

@ -2,7 +2,7 @@
> Get the visual width of a string - the number of columns required to display it
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
Useful to be able to measure the actual width of command-line output.
@ -10,7 +10,7 @@ Useful to be able to measure the actual width of command-line output.
## Install
```
$ npm install string-width
$ npm install --save string-width
```
@ -27,9 +27,6 @@ stringWidth('\u001b[1m古\u001b[22m');
stringWidth('a');
//=> 1
stringWidth('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
// => 5
```