Comparing version 0.0.7 to 0.0.8
@@ -11,3 +11,3 @@ function truncateTextNode ( | ||
lastIndexOfWhitespace = textContent.lastIndexOf(' ') | ||
if (lastIndexOfWhitespace == -1) { | ||
if (lastIndexOfWhitespace === -1) { | ||
break | ||
@@ -65,3 +65,3 @@ } | ||
if ( | ||
(nodeType == 1 && | ||
(nodeType === 1 && | ||
truncateElementNode( | ||
@@ -73,3 +73,3 @@ childNode, | ||
)) || | ||
(nodeType == 3 && | ||
(nodeType === 3 && | ||
truncateTextNode( | ||
@@ -76,0 +76,0 @@ childNode, |
{ | ||
"name": "line-clamp", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Line clamp a DOM element in vanilla JavaScript.", | ||
@@ -17,8 +17,10 @@ "author": "Lim Yuan Qing", | ||
"prettier-standard": "^8.0.0", | ||
"uglify-js": "^3.3.11", | ||
"watchify": "^3.10.0" | ||
"standard": "^11.0.0", | ||
"uglify-js": "^3.3.12", | ||
"watchify": "^3.11.0" | ||
}, | ||
"scripts": { | ||
"start": "concurrently \"watchify index.js --standalone lineClamp --outfile example/bundle.js\" \"ecstatic example --port 8080\" \"opn 'http://0.0.0.0:8080/'\"", | ||
"lint": "prettier-standard index.js --no-semi --single-quote --write", | ||
"fix": "prettier-standard index.js", | ||
"lint": "standard index.js", | ||
"weight": "uglifyjs index.js --compress --mangle --toplevel | gzip-size" | ||
@@ -25,0 +27,0 @@ }, |
@@ -8,3 +8,3 @@ # line-clamp [![npm Version](http://img.shields.io/npm/v/line-clamp.svg?style=flat)](https://www.npmjs.com/package/line-clamp) [![Build Status](https://img.shields.io/travis/yuanqing/line-clamp.svg?branch=master&style=flat)](https://travis-ci.org/yuanqing/line-clamp) | ||
- Supports appending a custom string instead of an ellipsis (`…`) | ||
- 476 bytes gzipped | ||
- 477 bytes gzipped | ||
@@ -61,3 +61,3 @@ ## Usage | ||
- Set `options.ellipsis` to change the string to be appended to the truncated text (defaults to `…`). | ||
- Set `options.ellipsis` to change the string to be appended to the truncated text. Defaults to `…`. | ||
@@ -64,0 +64,0 @@ See [Usage](#usage). |
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
125643
8