| 17 | import { Schema as DirectiveOptions } from './schema'; |
| 18 | |
| 19 | function buildSelector(options: DirectiveOptions, projectPrefix: string) { |
| 20 | let selector = options.name; |
| 21 | if (options.prefix) { |
| 22 | selector = `${options.prefix}-${selector}`; |
| 23 | } else if (options.prefix === undefined && projectPrefix) { |
| 24 | selector = `${projectPrefix}-${selector}`; |
| 25 | } |
| 26 | |
| 27 | return strings.camelize(selector); |
| 28 | } |
| 29 | |
| 30 | const directiveSchematic: RuleFactory<DirectiveOptions> = createProjectSchematic( |
| 31 | (options, { project, tree }) => { |