Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies and fix string package vulnerability #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions br/validations.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const BrValidations = require('br-validations');
const S = require('string');

module.exports = (RED) => {
function BrValidationsNode(config) {
Expand Down Expand Up @@ -28,7 +27,7 @@ module.exports = (RED) => {
const isAnySelected = () => node.cpf || node.cnpj || node.pis;

node.on('input', (message) => {
if (S(message.document).isEmpty()) {
if (/^[\s\xa0]*$/.test(message.document || '')) {
node.error('BrValidations Error: message.document must be sent!', message);
} else if (!isAnySelected()) {
node.error('BrValidations Config Error: at least one Document Type must be checked!', message);
Expand Down
30 changes: 14 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"name": "node-red-contrib-br-validations",
"version": "0.1.0",
"version": "0.1.1",
"description": "Validates some Brazilian documents such as CPF, CNPJ and PIS - based on the br-validations library",
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/sciensa/node-red-contrib-br-validations.git"
},
"scripts": {
"test:unit": "mocha --opts test/unit/mocha.opts test/",
"postinstall": "npm --prefix ./node_modules/node-red install ./node_modules/node-red"
"test:unit": "mocha --opts test/unit/mocha.opts test/"
},
"keywords": [
"node-red",
Expand Down Expand Up @@ -39,21 +38,20 @@
},
"homepage": "https://github.com/sciensa/node-red-contrib-br-validations#readme",
"devDependencies": {
"chai": "^3.5.0",
"eslint": "^3.19.0",
"eslint-config-airbnb-base": "^11.2.0",
"eslint-plugin-import": "^2.2.0",
"mocha": "^3.4.1",
"nock": "^9.0.13",
"node-red": "git+ssh://[email protected]/node-red/node-red#0.16.2",
"chai": "^4.3.4",
"eslint": "^8.3.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.25.3",
"mocha": "^9.1.3",
"nock": "^13.2.1",
"node-red": "git+ssh://[email protected]/node-red/node-red#2.1.3",
"path": "^0.12.7",
"sinon": "^2.2.0",
"sinon-chai": "^2.10.0"
"sinon": "^12.0.1",
"sinon-chai": "^3.7.0"
},
"dependencies": {
"babel-core": "^6.24.1",
"babel-preset-env": "^1.4.0",
"br-validations": "^0.3.1",
"string": "^3.3.3"
"babel-core": "^6.26.3",
"babel-preset-env": "^1.7.0",
"br-validations": "^0.3.1"
}
}