How to use the @webiny/validation.validation.validateSync function in @webiny/validation

To help you get started, we’ve selected a few @webiny/validation 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 webiny / webiny-js / packages / api-files / src / plugins / resolvers / utils / getPresignedPostPayload.js View on Github external
const sanitizeFileSizeValue = (value, defaultValue) => {
    try {
        validation.validateSync(value, "required,numeric,gte:0");
        return value;
    } catch (e) {
        return defaultValue;
    }
};

@webiny/validation

A simple data validation library, packed with frequently used validators.

MIT
Latest version published 2 days ago

Package Health Score

86 / 100
Full package analysis

Similar packages