How to use the waterline/lib/waterline/error/WLError.prototype function in waterline

To help you get started, we’ve selected a few waterline 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 lykmapipo / sails-hook-validation / lib / WLValidationError.js View on Github external
error.toPOJO = function() {

        var errorKey = 'Errors';

        if (sails && sails.config && sails.config.errors &&
            typeof sails.config.errors.errorKey === 'string') {
            errorKey = sails.config.errors.errorKey;
        }

        if (!toJSON) {
            toJSON = WLError.prototype.toJSON;
        }

        var asJSON = toJSON.call(this);
        asJSON[errorKey] = this.Errors;
        return asJSON;
    };

waterline

An ORM for Node.js and the Sails framework

MIT
Latest version published 1 year ago

Package Health Score

65 / 100
Full package analysis