faucet-pipeline / faucet-pipeline-js

JavaScript asset pipeline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

validate configuration

FND opened this issue · comments

commented

Detecting typos and similar issues might save users from arduous rabbit holes (cf. faucet-pipeline/faucet-pipeline-sass#62). A recent example was the erroneous use of "exnext" causing significant confusion.

declepticon seems like an acceptable option for this:

import { validate, validators } from "declepticon";

validate(bundleConfig, {
    source: validators.nonBlankString
}, {
    onError(message) {
        throw new Error(message);
    }
});