node-stripr
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -17,3 +17,3 @@ var allowedInputTypes = ['number', 'string']; | ||
'<html': /<html((.|\n|\r)*?)>/i, | ||
'<head': /<head(?:.|\n|\r)+?(<\/head>|\/>)/i, | ||
'<head': /(<head(.|\n|\r)*<\/head>|<head(.)*\/>)/i, | ||
'<body': /<body((.|\n|\r)*?)>/i, | ||
@@ -35,3 +35,3 @@ '</body>': /<\/body>/i, | ||
// check if keys have a match in input and strip away using the regexes | ||
if (inputLower.indexOf(key) > -1) { | ||
if (inputLower.indexOf(key.toLowerCase()) > -1) { | ||
output = output.replace(stripRegexes[key], ''); | ||
@@ -38,0 +38,0 @@ } |
{ | ||
"name": "node-stripr", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Node Script for stripping content", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,3 @@ | ||
var stripr = require('../index.js'); | ||
var stripr = require('../index.js'), | ||
fs = require('fs'); | ||
@@ -52,2 +53,8 @@ describe('stripr', function() { | ||
it('strips unnecessary html structure from a test-file based on optionally provided stripping rules', function() { | ||
expect(stripr(fs.readFileSync('test/test.html').toString(), { | ||
'<!-- Generated': /<!(.|\n|\r)*<\/h2><a name="JIRA_Report"><\/a>/i | ||
})).toBe('<table>Test</table>'); | ||
}); | ||
}); |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
6612
7
77
2