You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there is an optional callback that can be specified (onClean) which will be called every time a value is sanitised. There may, however, be scenarios in which a callback would be preferred which is invoked once after the entire process is finished.
This callback would contain an array of objects that detail the same information as the existing callback for each sanitisation that occurred (object path, key, value).
In practise, its usage by the end user should look something like this:
constexpress=require('express');constnosqlSanitizer=require('express-nosql-sanitizer');constapp=express();app.use(nosqlSanitizer({onClean: (objectPath,key,value)=>{console.log('A single item has been sanitised');console.log(objectPath,key,value);},onComplete: (sanitizations)=>{console.log('All items have been sanitised');sanitizations.forEach((s)=>{console.log(s.objectPath,s.key,s.value);});},}));
The text was updated successfully, but these errors were encountered:
Currently, there is an optional callback that can be specified (
onClean
) which will be called every time a value is sanitised. There may, however, be scenarios in which a callback would be preferred which is invoked once after the entire process is finished.This callback would contain an array of objects that detail the same information as the existing callback for each sanitisation that occurred (object path, key, value).
In practise, its usage by the end user should look something like this:
The text was updated successfully, but these errors were encountered: