本文整理匯總了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]);
});