Remove dependency: string-sanitizer-fix & npm update
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
49bb0627e9
commit
1c944e9ae1
5
package-lock.json
generated
5
package-lock.json
generated
@ -2121,11 +2121,6 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/string-sanitizer-fix": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/string-sanitizer-fix/-/string-sanitizer-fix-2.0.1.tgz",
|
||||
"integrity": "sha512-I5RSqL5vDfKnoAbpFP2mU0QAh7Gc1KoeIg02N+5+NBfDB/MiSddgNNXfmWND7+BBwy3zub6s/ZWRbZICZKUA0g=="
|
||||
},
|
||||
"node_modules/strnum": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz",
|
||||
|
@ -1,4 +1,4 @@
|
||||
const clean = require('string-sanitizer-fix');
|
||||
//const clean = require('string-sanitizer-fix');
|
||||
const log = require('../utils/log.utils');
|
||||
|
||||
function removeNonAlphanumeric(inputString) { // Should be able to replace sanitizer module
|
||||
@ -7,8 +7,12 @@ function removeNonAlphanumeric(inputString) { // Should be able to replace sani
|
||||
|
||||
function removeNonAlpha(inputString) { // Should be able to replace sanitizer module
|
||||
return inputString.replace(/[^a-zA-Z]/g, '');
|
||||
}
|
||||
}
|
||||
|
||||
const cleanApiEndpointTxt = removeNonAlpha
|
||||
const cleanApiEndpointNum = removeNonAlphanumeric
|
||||
|
||||
/*
|
||||
function cleanApiEndpointTxt(input) {
|
||||
var output = clean.sanitize.keepSpace(input)
|
||||
if (output != input){
|
||||
@ -24,7 +28,7 @@ function cleanApiEndpointNum(input) {
|
||||
}
|
||||
return output
|
||||
}
|
||||
|
||||
*/
|
||||
function cleanNrcc(input) { // Remove newlines and then <p> tags from input
|
||||
const cleanInput = input.replace(/[\n\r]/g, '').replace(/<\/?p[^>]*>/g, '');
|
||||
return cleanInput;
|
||||
@ -38,6 +42,8 @@ async function getDomainFromEmail(mail) { // Needs testing
|
||||
module.exports = {
|
||||
cleanApiEndpointTxt,
|
||||
cleanApiEndpointNum,
|
||||
removeNonAlpha,
|
||||
removeNonAlphanumeric,
|
||||
cleanNrcc,
|
||||
getDomainFromEmail,
|
||||
}
|
Loading…
Reference in New Issue
Block a user