UNPKG

yeoman-generator

Version:

Rails-inspired generator system that provides scaffolding for your apps

12 lines (11 loc) • 476 B
/** * Split `PathOptions` from an options object so the remaining options can be forwarded untouched. * Objects without a path option (including `fs.Stats` instances) are returned as is, not copied. */ export function splitPathOptions(options) { if (!options || typeof options !== 'object' || !('allowOutsideRoot' in options)) { return [{}, options]; } const { allowOutsideRoot, ...remaining } = options; return [{ allowOutsideRoot }, remaining]; }