本文整理匯總了TypeScript中@ngrx/schematics/schematics-core.stringUtils類的典型用法代碼示例。如果您正苦於以下問題:TypeScript stringUtils類的具體用法?TypeScript stringUtils怎麽用?TypeScript stringUtils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了stringUtils類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: return
return (host: Tree, context: SchematicContext) => {
options.path = getProjectPath(host, options);
const parsedPath = parseName(options.path, options.name);
options.name = parsedPath.name;
options.path = parsedPath.path;
const statePath = `/${options.path}/${options.statePath}/index.ts`;
const srcPath = dirname(options.path as Path);
const environmentsPath = buildRelativePath(
statePath,
`${srcPath}/environments/environment`
);
if (options.module) {
options.module = findModuleFromOptions(host, options);
}
if (
options.root &&
options.stateInterface &&
options.stateInterface !== 'State'
) {
options.stateInterface = stringUtils.classify(options.stateInterface);
}
const templateSource = apply(url('./files'), [
template({
...stringUtils,
...(options as object),
environmentsPath,
} as any),
move(parsedPath.path),
]);
return chain([
branchAndMerge(
chain([
filter(
path =>
path.endsWith('.module.ts') &&
!path.endsWith('-routing.module.ts')
),
addImportToNgModule(options),
mergeWith(templateSource),
])
),
])(host, context);
};
示例2:
'if-flat': (s: string) =>
stringUtils.group(
options.flat ? '' : s,
options.group ? 'reducers' : ''
),