1.32.0 • Published 3 years ago

@rom13/protector v1.32.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Protector JS (Node)

🦍

Protector est un scanner d'objet

return : true / false ou Complexité trop élevé (cas d'un objet trop complexe).

Il vérifie si les String dans vos objets contiennent des charactères spéciaux qui peuvent créer un risque de sécurité.

Requis : nodeJs

Installation :

Dans votre terminal tapez ceci :

npm install @rom13/protector

Dans votre app importez protector :

const { Protector } = require("@rom13/protector");

Création d'un protector :

const protector = new Protector();

Protector.isprotek()

EXEMPLE: Créons un objet à examiner et verifions avec isprotek() le rapport.

let hack = {
  pseudo: "hacker",
  nom: "unkhnown",
  age: 30.5,
  hobbies: "<script/>",
  balek: "ahahah",
  objet: {
    nom: "jason^^",
    age: 34,
  },
  test: ["tes*", "test2", 34, "ji"],
};

console.log(protector.isprotek(hack)); // return = false

Trois réponses possibles : true (l'objet est safe), false (l'objet n'est pas validé par Protector)

protector gère un niveau de complexité bas .

Si dans votre objet, il y a un objet qui a lui même un autre objet ou un Array, Protector vous répondra que la version ne couvre pas ce niveau de complexité.

Protector.clean()

EXEMPLE: Nettoyons un string avec Protector.clean().

let string = "Je s|<uis un s@tring pirate ah:ah^^";

console.log(protector.clean(string)); // return = Je suis un string pirate ahah

Enjoy :sunglasses:

1.15.0

3 years ago

1.14.0

3 years ago

1.13.0

3 years ago

1.12.0

3 years ago

1.19.0

3 years ago

1.18.0

3 years ago

1.17.0

3 years ago

1.16.0

3 years ago

1.9.0

3 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.6.0

3 years ago

1.21.0

3 years ago

1.22.0

3 years ago

1.20.0

3 years ago

1.25.0

3 years ago

1.26.0

3 years ago

1.23.0

3 years ago

1.24.0

3 years ago

1.27.0

3 years ago

1.28.0

3 years ago

1.32.0

3 years ago

1.11.0

3 years ago

1.10.0

3 years ago

1.30.0

3 years ago

1.31.0

3 years ago

1.2.0

3 years ago

1.5.0

3 years ago

1.3.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago