How to use the @commercial/joi.number function in @commercial/joi

To help you get started, we’ve selected a few @commercial/joi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hapijs / hapi / test / security.js View on Github external
it('prevents xss in path validation response message', (done) => {

        const server = new Hapi.Server();
        server.connection();
        server.state('encoded', { encoding: 'iron' });

        server.route({
            method: 'GET', path: '/fail/{name}', handler: function (request, reply) {

                return reply('Success');
            },
            config: {
                validate: { params: { name: Joi.number() } }
            }
        });

        server.inject({
            method: 'GET',
            url: '/fail/

@commercial/joi

Object schema validation

SEE LICENSE IN LICENSE.md
Latest version published 5 years ago

Package Health Score

66 / 100
Full package analysis

Popular @commercial/joi functions