lib/generate/index.js
function verifyProfile(profile, profileKey) {
    if (!profile.file && !profile.url) {
        throw new Error(`[${profileKey}] Must specify a file or url in the configuration.`);
    }
    if (!profile.output) {
        throw new Error(`[${profileKey}] Must specify an output file path in the configuration.`);
    }
    if (!profile.generator) {
        throw new Error(`[${profileKey}] Must specify a generator in the configuration.`);
    }
    if (profile.generator.toLowerCase() === 'core') {
        throw new Error(`[${profileKey}] Invalid generator ${profile.generator}. This name is reserved.`);
    }
    if (profile.generator.match(/^[\w-]+-language$/i)) {
        throw new Error(`[${profileKey}] Invalid generator ${profile.generator}. The -language suffix is reserved for language helper packages.`);
    }
    profile.debug = profile.debug || {};
    profile.filters = profile.filters || {};
    profile.transforms = profile.transforms || {};
    profile.options = profile.options || {};
}
function verifyProfile(profile, profileKey) {
    if (!profile.file && !profile.url) {
        throw new Error(`[${profileKey}] Must specify a file or url in the configuration.`);
    }
    if (!profile.output) {
        throw new Error(`[${profileKey}] Must specify an output file path in the configuration.`);
    }
    if (!profile.generator) {
        throw new Error(`[${profileKey}] Must specify a generator in the configuration.`);
    }
    if (profile.generator.toLowerCase() === 'core') {
        throw new Error(`[${profileKey}] Invalid generator ${profile.generator}. This name is reserved.`);
    }
    if (profile.generator.match(/^[\w-]+-language$/i)) {
        throw new Error(`[${profileKey}] Invalid generator ${profile.generator}. The -language suffix is reserved for language helper packages.`);
    }
    profile.debug = profile.debug || {};
    profile.filters = profile.filters || {};
    profile.transforms = profile.transforms || {};
    profile.options = profile.options || {};
}
function verifyProfile ( profile , profileKey ) { if ( ! profile . file && ! profile . url ) { throw new Error ( ` ${ profileKey } ` ) ; } if ( ! profile . output ) { throw new Error ( ` ${ profileKey } ` ) ; } if ( ! profile . generator ) { throw new Error ( ` ${ profileKey } ` ) ; } if ( profile . generator . toLowerCase ( ) === 'core' ) { throw new Error ( ` ${ profileKey } ${ profile . generator } ` ) ; } if ( profile . generator . match ( / ^[\w-]+-language$ / i ) ) { throw new Error ( ` ${ profileKey } ${ profile . generator } ` ) ; } profile . debug = profile . debug || { } ; profile . filters = profile . filters || { } ; profile . transforms = profile . transforms || { } ; profile . options = profile . options || { } ; }
Ensure that the profile structure is valid.
Ensure that the profile structure is valid .