當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。