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


TypeScript types.isFunction函数代码示例

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


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

示例1: test

	test('Viewlet extension point and registration', function () {
		assert(Types.isFunction(Platform.Registry.as<ViewletRegistry>(Extensions.Viewlets).registerViewlet));
		assert(Types.isFunction(Platform.Registry.as<ViewletRegistry>(Extensions.Viewlets).getViewlet));
		assert(Types.isFunction(Platform.Registry.as<ViewletRegistry>(Extensions.Viewlets).getViewlets));

		let oldCount = Platform.Registry.as<ViewletRegistry>(Extensions.Viewlets).getViewlets().length;
		let d = new ViewletDescriptor(TestViewlet, 'reg-test-id', 'name');
		Platform.Registry.as<ViewletRegistry>(Extensions.Viewlets).registerViewlet(d);

		assert(d === Platform.Registry.as<ViewletRegistry>(Extensions.Viewlets).getViewlet('reg-test-id'));
		assert.equal(oldCount + 1, Platform.Registry.as<ViewletRegistry>(Extensions.Viewlets).getViewlets().length);
	});
开发者ID:burhandodhy,项目名称:azuredatastudio,代码行数:12,代码来源:viewlet.test.ts

示例2: test

	test("Viewlet extension point and registration", function() {
		assert(Types.isFunction(Platform.Registry.as(Extensions.Viewlets).registerViewlet));
		assert(Types.isFunction(Platform.Registry.as(Extensions.Viewlets).getViewlet));
		assert(Types.isFunction(Platform.Registry.as(Extensions.Viewlets).getViewlets));

		let oldCount = Platform.Registry.as(Extensions.Viewlets).getViewlets().length;
		let d = new ViewletDescriptor("moduleId", "ctorName", "reg-test-id", "name");
		Platform.Registry.as(Extensions.Viewlets).registerViewlet(d);

		assert(d === Platform.Registry.as(Extensions.Viewlets).getViewlet("reg-test-id"));
		assert.equal(oldCount + 1, Platform.Registry.as(Extensions.Viewlets).getViewlets().length);
	});
开发者ID:578723746,项目名称:vscode,代码行数:12,代码来源:viewlet.test.ts

示例3: test

	test('isObject', () => {
		assert(!types.isObject(undefined));
		assert(!types.isObject(null));
		assert(!types.isObject('foo'));
		assert(!types.isObject(5));
		assert(!types.isObject(true));
		assert(!types.isObject([]));
		assert(!types.isObject([1, 2, '3']));
		assert(!types.isObject(/test/));
		assert(!types.isObject(new RegExp('')));
		assert(!types.isFunction(new Date()));
		assert(!types.isObject(assert));
		assert(!types.isObject(function foo() { }));

		assert(types.isObject({}));
		assert(types.isObject({ foo: 'bar' }));
	});
开发者ID:DonJayamanne,项目名称:vscode,代码行数:17,代码来源:types.test.ts

示例4: constructor

	constructor(arg: any) {
		this.modelProvider = isFunction(arg.getModel) ? arg : { getModel: () => arg };
	}
开发者ID:VishalMadhvani,项目名称:vscode,代码行数:3,代码来源:quickOpenViewer.ts

示例5: test

	test('registry - api', function () {
		assert.ok(Types.isFunction(Platform.Registry.add));
		assert.ok(Types.isFunction(Platform.Registry.as));
		assert.ok(Types.isFunction(Platform.Registry.knows));
	});
开发者ID:AllureFer,项目名称:vscode,代码行数:5,代码来源:platform.test.ts


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