本文整理汇总了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);
});
示例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);
});
示例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' }));
});
示例4: constructor
constructor(arg: any) {
this.modelProvider = isFunction(arg.getModel) ? arg : { getModel: () => arg };
}
示例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));
});