Skip to content

Commit

Permalink
Double-boolean-cast String.prototype..., import from index for increa…
Browse files Browse the repository at this point in the history
…sed coverage, rebuild
  • Loading branch information
nebrelbug committed Jun 21, 2020
1 parent c0b1206 commit 4684090
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 13 deletions.
6 changes: 4 additions & 2 deletions dist/browser/eta.dev.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/browser/eta.dev.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/browser/eta.min.js.map

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions dist/eta.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/eta.cjs.js.map

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions dist/eta.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/eta.es.js.map

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ function trimWS (
if (leftTrim === '_' || leftTrim === 'slurp') {
// console.log('trimming left' + leftTrim)
// full slurp
if (String.prototype.trimLeft) {

// eslint-disable-next-line no-extra-boolean-cast
if (!!String.prototype.trimLeft) {
str = str.trimLeft()
} else {
str = str.replace(/^[\s\uFEFF\xA0]+/, '')
Expand All @@ -82,7 +84,9 @@ function trimWS (
if (rightTrim === '_' || rightTrim === 'slurp') {
// console.log('trimming right' + rightTrim)
// full slurp
if (String.prototype.trimRight) {

// eslint-disable-next-line no-extra-boolean-cast
if (!!String.prototype.trimRight) {
str = str.trimRight()
} else {
str = str.replace(/[\s\uFEFF\xA0]+$/, '')
Expand Down
2 changes: 1 addition & 1 deletion test/utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* global it, expect, describe */

import { trimWS, XMLEscape } from '../src/utils'
import { defaultConfig, getConfig } from '../src/config'
import { defaultConfig, getConfig } from '../src/index'

describe('Whitespace trim', () => {
describe('#trimLeft', () => {
Expand Down

0 comments on commit 4684090

Please sign in to comment.