本文整理汇总了TypeScript中event-stream.readArray函数的典型用法代码示例。如果您正苦于以下问题:TypeScript readArray函数的具体用法?TypeScript readArray怎么用?TypeScript readArray使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了readArray函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should return a function', done => {
const src = [1, 2, 3];
const inp = es.readArray(src);
const factory = util.combine(inp);
factory.should.be.type('function');
done();
});
示例2: Vinyl
gulp.task('create:common-less', () => {
const theme = {
'@theme-color': config.publicConfig.themeColor,
'@resources-url': `"${config.publicConfig.resourcesUrl}"`
};
const vinyl = new Vinyl({
path: 'common.less',
contents: new Buffer('\n')
});
return es.readArray([vinyl]).pipe(lessVars(theme)).pipe(gulp.dest('./src/sites/common/'));
});
示例3: File
.then(fileNames => {
const files = fileNames
.map(fileName => path.join(extensionPath, fileName))
.map(filePath => new File({
path: filePath,
stat: fs.statSync(filePath),
base: extensionPath,
contents: fs.createReadStream(filePath) as any
}));
es.readArray(files).pipe(result);
})
示例4: it
it("should modify the file contents", (done) => {
var fakeFile = new TestFile({
contents: es.readArray(["<", "My", "Component", "/>"])
});
var trans = transform();
trans.write(fakeFile);
trans.once("data", (file: any) => {
expect(file.isStream()).to.be.true;
file.contents.pipe(es.wait((err: any, data: any) => {
expect(data.toString()).to.equal("ViewHost.render(MyComponent, null);");
done();
}));
});
});
示例5:
gulp.task("es:readArray ", () => {
var reader = es.readArray([1, 2, 3]);
});