当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript stream.readExactlyByFile函数代码示例

本文整理汇总了TypeScript中vs/base/node/stream.readExactlyByFile函数的典型用法代码示例。如果您正苦于以下问题:TypeScript readExactlyByFile函数的具体用法?TypeScript readExactlyByFile怎么用?TypeScript readExactlyByFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了readExactlyByFile函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: test

	test('detectEncodingFromBuffer (JSON saved as PNG)', async function () {
		const file = getPathFromAmdModule(require, './fixtures/some.json.png');

		const buffer = await readExactlyByFile(file, 512);
		const mimes = encoding.detectEncodingFromBuffer(buffer);
		assert.equal(mimes.seemsBinary, false);
	});
开发者ID:DonJayamanne,项目名称:vscode,代码行数:7,代码来源:encoding.test.ts

示例2: test

	test('detectEncodingFromBuffer (QWOFF saved as TXT)', function () {
		const file = require.toUrl('./fixtures/some.qwoff.txt');
		return readExactlyByFile(file, 512).then(buffer => {
			const mimes = encoding.detectEncodingFromBuffer(buffer);
			assert.equal(mimes.seemsBinary, true);
		});
	});
开发者ID:AllureFer,项目名称:vscode,代码行数:7,代码来源:encoding.test.ts

示例3: test

	test('detectEncodingFromBuffer (CSS saved as QWOFF)', function () {
		const file = getPathFromAmdModule(require, './fixtures/some.css.qwoff');
		return readExactlyByFile(file, 512).then(buffer => {
			const mimes = encoding.detectEncodingFromBuffer(buffer);
			assert.equal(mimes.seemsBinary, false);
		});
	});
开发者ID:developers23,项目名称:vscode,代码行数:7,代码来源:encoding.test.ts

示例4: test

	test('readExactlyByFile - empty', function () {
		const file = getPathFromAmdModule(require, './fixtures/empty.txt');

		return stream.readExactlyByFile(file, 10).then(({ bytesRead }) => {
			assert.equal(bytesRead, 0);
		});
	});
开发者ID:VishalMadhvani,项目名称:vscode,代码行数:7,代码来源:stream.test.ts

示例5: test

	test('readExactlyByFile - empty', function () {
		const file = require.toUrl('./fixtures/empty.txt');

		return stream.readExactlyByFile(file, 10).then(({ bytesRead }) => {
			assert.equal(bytesRead, 0);
		});
	});
开发者ID:AllureFer,项目名称:vscode,代码行数:7,代码来源:stream.test.ts

示例6: test

	test('detectMimesFromFile (PDF)', function () {
		const file = require.toUrl('./fixtures/some.pdf');
		return readExactlyByFile(file, 512).then(buffer => {
			const mimes = mime.detectMimeAndEncodingFromBuffer(buffer);
			assert.deepEqual(mimes.mimes, ['application/octet-stream']);
		});
	});
开发者ID:sameer-coder,项目名称:vscode,代码行数:7,代码来源:mime.test.ts


注:本文中的vs/base/node/stream.readExactlyByFile函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。