putil-flattentext
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -10,2 +10,7 @@ /* putil-flattentext | ||
/** | ||
* Expose Module | ||
*/ | ||
module.exports = flattenText; | ||
/** | ||
* | ||
@@ -21,18 +26,19 @@ * @param {string} input | ||
options.indent = options.indent || 2; | ||
let out = ''; | ||
let indent = 0; | ||
var out = ''; | ||
var indent = 0; | ||
const fillChar = function(cnt, chr = ' ') { | ||
let str = ''; | ||
for (let i = 0; i < cnt; i++) | ||
const fillChar = function(cnt, chr) { | ||
if (chr === undefined) chr = ' '; | ||
var str = ''; | ||
for (var i = 0; i < cnt; i++) | ||
str += chr; | ||
return str; | ||
}; | ||
let newline = 0; | ||
let pchr = 0; | ||
var newline = 0; | ||
var pchr = 0; | ||
input = String(input); | ||
for (let i = 0; i < input.length; i++) { | ||
let chr = input.charAt(i); | ||
let k = 0; | ||
for (var i = 0; i < input.length; i++) { | ||
var chr = input.charAt(i); | ||
var k = 0; | ||
while (options.noWrap && ['\t', '\n', '\r', '\b'].includes(chr)) { | ||
@@ -81,2 +87,1 @@ if (chr === '\b') | ||
module.exports = flattenText; |
{ | ||
"name": "putil-flattentext", | ||
"description": "Simple utility that converts manipulate \t \b \r characters and flattens text", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"author": "Panates Ltd.", | ||
@@ -19,10 +19,10 @@ "contributors": [ | ||
"devDependencies": { | ||
"babel-eslint": "^7.2.3", | ||
"eslint": "^3.19.0", | ||
"eslint-config-google": "^0.8.0", | ||
"babel-eslint": "^8.0.1", | ||
"eslint": "^4.9.0", | ||
"eslint-config-google": "^0.9.1", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^3.4.2" | ||
"mocha": "^4.0.1" | ||
}, | ||
"engines": { | ||
"node": ">= 6.0" | ||
"node": ">= 4.0" | ||
}, | ||
@@ -29,0 +29,0 @@ "directories": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6410
78
1