@hapi/disinfect code example
Example 1: @hapi/disinfect
const registerPlugins = async (server) => Promise.all([ server.register({ plugin: require('disinfect'), options: { disinfectQuery: true, disinfectParams: true, disinfectPayload: true } })]); registerPlugins(server) .then(() => {
Example 2: @hapi/disinfect
{ path: '/', method: 'get', handler: (request, reply) => { ... }, options: { plugins: { disinfect: false } }}
Example 3: @hapi/disinfect
Example 4: @hapi/disinfect
const customSanitizer = (dirtyObj) => {