wordwrapjs
Advanced tools
Comparing version 5.0.1 to 5.0.2
@@ -315,10 +315,10 @@ (function (global, factory) { | ||
class WordWrap { | ||
constructor (text, options) { | ||
options = options || {}; | ||
constructor (text, options = {}) { | ||
if (!t.isDefined(text)) text = ''; | ||
this._lines = String(text).split(/\r\n|\n/g); | ||
this.options = options; | ||
this.options.width = options.width === undefined ? 30 : options.width; | ||
this.options.eol = options.eol || '\n'; | ||
this.options = Object.assign({ | ||
eol: '\n', | ||
width: 30 | ||
}, options); | ||
} | ||
@@ -382,3 +382,3 @@ | ||
* @param [options.noTrim] {boolean} - By default, each line output is trimmed. If `noTrim` is set, no line-trimming occurs - all whitespace from the input text is left in. | ||
* @param [options.eol] {boolean} - The end of line character to use. Defaults to `\n`. | ||
* @param [options.eol] {string} - The end of line character to use. Defaults to `\n`. | ||
* @return {string} | ||
@@ -385,0 +385,0 @@ */ |
{ | ||
"name": "wordwrapjs", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "Word-wrapping for javascript.", | ||
@@ -21,3 +21,3 @@ "repository": "https://github.com/75lb/wordwrapjs.git", | ||
"scripts": { | ||
"test": "test-runner test.mjs", | ||
"test": "npm run dist && test-runner test.mjs", | ||
"docs": "jsdoc2md -c jsdoc.conf -t README.hbs index.mjs > README.md; echo", | ||
@@ -27,3 +27,4 @@ "dist": "rollup -c" | ||
"devDependencies": { | ||
"jsdoc-to-markdown": "^7.0.0", | ||
"jsdoc-to-markdown": "^7.0.1", | ||
"rollup": "^2.44.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
@@ -30,0 +31,0 @@ "test-runner": "~0.8.14" |
@@ -105,3 +105,3 @@ [![view on npm](https://badgen.net/npm/v/wordwrapjs)](https://www.npmjs.org/package/wordwrapjs) | ||
| [options.noTrim] | <code>boolean</code> | By default, each line output is trimmed. If `noTrim` is set, no line-trimming occurs - all whitespace from the input text is left in. | | ||
| [options.eol] | <code>boolean</code> | The end of line character to use. Defaults to `\n`. | | ||
| [options.eol] | <code>string</code> | The end of line character to use. Defaults to `\n`. | | ||
@@ -108,0 +108,0 @@ <a name="module_wordwrapjs--WordWrap.lines"></a> |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
35048
4