A fork of trim package to fix ReDoS vulnerability
Trims string whitespace.
In yarn.lock
add an entry to resolutions
field:
resolutions: {
"trim": "npm:trim-fix@^0.0.1"
}
and run yarn install
.
$ npm install trim-fix
trim(' foo bar ').should.equal('foo bar');
trim('\n\n\nfoo bar\n\r\n\n').should.equal('foo bar');
trim.left(' foo bar ').should.equal('foo bar ');
trim.right(' foo bar ').should.equal(' foo bar');