本文整理汇总了TypeScript中colors/safe.strip函数的典型用法代码示例。如果您正苦于以下问题:TypeScript strip函数的具体用法?TypeScript strip怎么用?TypeScript strip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了strip函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: helpRun
return helpRun(command).then(() => {
var expected: string = expectedLines.join("\n");
var actual: string = colors.strip(memoryStdout.contentsAsText()); // The colors add extra characters
actual = actual.replace(/ (\.+) ?\n +/gm, " $1 "); // We undo the word-wrapping
actual = actual.replace(/ +$/gm, ""); // Remove useless spaces at the end of a line
actual.should.be.equal(expected);
});
开发者ID:Dmitry-Kravchuk,项目名称:TACO,代码行数:7,代码来源:help.ts
示例2: templatesRun
templatesRun().done(() => {
var expected = [
"CommandTemplatesHeader",
"",
" blank ............... BlankTemplateName",
" typescript .......... TypescriptTemplateName",
"",
"HowToUseCreateProjectWithTemplate",
""].join("\n");
var actual: string = colors.strip(memoryStdout.contentsAsText()); // The colors add extra characters
actual.should.be.equal(expected);
done();
}, done);
开发者ID:darocha,项目名称:TACO,代码行数:13,代码来源:templates.ts
示例3: done
create.run(commandData).done(() => {
var expected : string = expectedMessages.join("\n");
var actual: string = colors.strip(memoryStdout.contentsAsText()); // We don't want to compare the colors
actual = actual.replace(/ {10,}/g, tenSpaces); // We don't want to count spaces when we have a lot of them, so we replace it with 10
actual = actual.replace(/-{10,}/g, tenMinuses); // We don't want to count -----s when we have a lot of them, so we replace it with 10 (They also depend dynamically on the path length)
actual = actual.replace(/ +$/gm, ""); // We also don't want trailing spaces
actual = actual.replace(/ \.+ ?\n +/gm, " ..... "); // We undo the word-wrapping
actual = actual.replace(/ *\n +\(/gm, " ("); // We undo the word-wrapping
actual = actual.replace(/\n\n /gm, "\n "); // We undo the word-wrapping
actual = actual.replace(/ \.+ /gm, " ..... "); // We want all the points to always be 5 points .....
if (expectedMessages.every((msg: string) => actual.indexOf(msg) >= 0) || alternativeExpectedMessages.every((msg: string) => actual.indexOf(msg) >= 0)) {
done();
} else {
done(new Error("Bad onboarding for " + createCommandLineArguments));
}
}, (arg: any) => {
开发者ID:darocha,项目名称:TACO,代码行数:18,代码来源:create.ts
注:本文中的colors/safe.strip函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论