本文整理汇总了TypeScript中vs/workbench/services/files/test/electron-browser/utils.getByName函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getByName函数的具体用法?TypeScript getByName怎么用?TypeScript getByName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getByName函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
return resolver.resolve({ resolveTo: [toResource('other/deep')] }).then(result => {
assert.ok(result);
assert.ok(result.children);
assert.ok(result.children.length > 0);
assert.ok(result.isDirectory);
let children = result.children;
assert.equal(children.length, 4);
let other = utils.getByName(result, 'other');
assert.ok(other);
assert.ok(other.children.length > 0);
let deep = utils.getByName(other, 'deep');
assert.ok(deep);
assert.ok(deep.children.length > 0);
assert.equal(deep.children.length, 4);
});
示例2:
]).then(res => {
const r1 = res[0].stat;
assert.equal(r1.children.length, 8);
const deep = utils.getByName(r1, 'deep');
assert.equal(deep.children.length, 4);
const r2 = res[1].stat;
assert.equal(r2.children.length, 4);
assert.equal(r2.name, 'deep');
});
示例3: toResource
return resolver.resolve({ resolveTo: [toResource('other/deep'), toResource('examples')] }).then(result => {
assert.ok(result);
assert.ok(result.children);
assert.ok(result.children!.length > 0);
assert.ok(result.isDirectory);
const children = result.children!;
assert.equal(children.length, 4);
const other = utils.getByName(result, 'other');
assert.ok(other);
assert.ok(other!.children!.length > 0);
const deep = utils.getByName(other!, 'deep');
assert.ok(deep);
assert.ok(deep!.children!.length > 0);
assert.equal(deep!.children!.length, 4);
const examples = utils.getByName(result, 'examples');
assert.ok(examples);
assert.ok(examples!.children!.length > 0);
assert.equal(examples!.children!.length, 4);
});