full-width-of-terminal
Advanced tools
Comparing version 0.0.3 to 0.1.0
@@ -9,3 +9,3 @@ 'use strict' | ||
test('When the argument is one character', () => { | ||
expect(getStringFullWidthOfTerminal('=')).toBe('====') | ||
expect(getStringFullWidthOfTerminal('=')).toBe('=====') | ||
}) | ||
@@ -12,0 +12,0 @@ |
@@ -8,3 +8,4 @@ // | ||
exports.getStringFullWidthOfTerminal = (str ) => { | ||
return new Array(columns).join(str).substr(0, columns) | ||
const size = Math.ceil(columns / str.length) | ||
return new Array(size + 1).join(str).substr(0, columns) | ||
} |
{ | ||
"name": "full-width-of-terminal", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"description": "The string is displayed on the full width of the terminal.", | ||
@@ -18,4 +18,4 @@ "main": "build/index.js", | ||
"devDependencies": { | ||
"babel-eslint": "^8.0.2", | ||
"eslint-plugin-flowtype": "^2.39.1", | ||
"babel-eslint": "^8.2.1", | ||
"eslint-plugin-flowtype": "^2.42.0", | ||
"flow-bin": "^0.59.0", | ||
@@ -22,0 +22,0 @@ "flow-remove-types": "^1.2.3", |
@@ -9,3 +9,3 @@ 'use strict' | ||
test('When the argument is one character', () => { | ||
expect(getStringFullWidthOfTerminal('=')).toBe('====') | ||
expect(getStringFullWidthOfTerminal('=')).toBe('=====') | ||
}) | ||
@@ -12,0 +12,0 @@ |
@@ -8,3 +8,4 @@ // @flow | ||
exports.getStringFullWidthOfTerminal = (str: string): string => { | ||
return new Array(columns).join(str).substr(0, columns) | ||
const size = Math.ceil(columns / str.length) | ||
return new Array(size + 1).join(str).substr(0, columns) | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
152201
15
48