Comparing version 2.2.1 to 2.2.2
# Changelog | ||
## Version 2.2.2 | ||
* babel: fix es5 generation and upgrade to version 7 | ||
## Version 2.2.1 | ||
@@ -5,0 +9,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 2.0.2 | ||
// Generated by CoffeeScript 2.3.2 | ||
var pad; | ||
@@ -3,0 +3,0 @@ |
@@ -1,7 +0,10 @@ | ||
// Generated by CoffeeScript 2.0.2 | ||
"use strict"; | ||
// Generated by CoffeeScript 2.3.2 | ||
var pad; | ||
pad = require('./index'); | ||
module.exports = function (string, size, options = {}) { | ||
module.exports = function (string, size) { | ||
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | ||
if (typeof options === 'string') { | ||
@@ -12,4 +15,5 @@ options = { | ||
} | ||
options.colors = true; | ||
return pad(string, size, options); | ||
}; |
@@ -1,4 +0,5 @@ | ||
// Generated by CoffeeScript 2.0.2 | ||
"use strict"; | ||
// Generated by CoffeeScript 2.3.2 | ||
var wcwidth; | ||
wcwidth = require('wcwidth'); | ||
@@ -8,9 +9,15 @@ | ||
var escapecolor, invert, pad, padlength, textnocolors; | ||
if (options == null) { | ||
options = {}; | ||
} | ||
invert = typeof text === 'number'; | ||
if (invert) { | ||
[length, text] = [text, length]; | ||
var _ref = [text, length]; | ||
length = _ref[0]; | ||
text = _ref[1]; | ||
} | ||
if (typeof options === 'string') { | ||
@@ -21,13 +28,18 @@ options = { | ||
} | ||
if (options.char == null) { | ||
options.char = ' '; | ||
} | ||
if (options.strip == null) { | ||
options.strip = false; | ||
} | ||
if (typeof text !== 'string') { | ||
text = text.toString(); | ||
} | ||
textnocolors = null; | ||
pad = ''; | ||
if (options.colors) { | ||
@@ -37,3 +49,5 @@ escapecolor = /\x1B\[(?:[0-9]{1,2}(?:;[0-9]{1,2})?)?[m|K]/g; | ||
} | ||
padlength = options.fixed_width ? length - (textnocolors || text).length : length - wcwidth(textnocolors || text, options.wcwidth_options); | ||
if (padlength < 0) { | ||
@@ -47,5 +61,8 @@ if (options.strip) { | ||
} | ||
return text; | ||
} | ||
pad += options.char.repeat(padlength); | ||
if (invert) { | ||
@@ -52,0 +69,0 @@ return pad + text; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 2.0.2 | ||
// Generated by CoffeeScript 2.3.2 | ||
var wcwidth; | ||
@@ -3,0 +3,0 @@ |
{ | ||
"name": "pad", | ||
"description": "Left and right string padding", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"author": "David Worms <david@adaltas.com>", | ||
@@ -13,5 +13,6 @@ "contributors": [ | ||
"devDependencies": { | ||
"babel-cli": "^6.26.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"coffeescript": "^2.3.1", | ||
"@babel/cli": "^7.2.3", | ||
"@babel/core": "^7.2.2", | ||
"@babel/preset-env": "^7.2.3", | ||
"coffeescript": "^2.3.2", | ||
"mocha": "^5.2.0", | ||
@@ -18,0 +19,0 @@ "should": "^13.2.3" |
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
11050
12
148
6