本文整理匯總了TypeScript中dgeni.DocCollection.find方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript DocCollection.find方法的具體用法?TypeScript DocCollection.find怎麽用?TypeScript DocCollection.find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dgeni.DocCollection
的用法示例。
在下文中一共展示了DocCollection.find方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: beforeEach
beforeEach(() => {
processor.sourceFiles = [ 'memberAliases.ts'];
docs = [];
processor.$process(docs);
fn = docs.find(doc => doc.name === 'fn');
[foo, foo1, foo2] = docs.filter(doc => doc.name === 'foo');
bar = docs.find(doc => doc.name === 'bar');
});
示例2: it
it('should extract all content from the comments', () => {
processor.sourceFiles = [ 'commentContent.ts' ];
const docs: DocCollection = [];
processor.$process(docs);
const someClassDoc = docs.find(doc => doc.name === 'SomeClass');
expect(someClassDoc.content).toEqual('@empty');
const fooDoc = docs.find(doc => doc.name === 'foo');
expect(fooDoc.content).toEqual('The description\n@tag1\ntag info');
const barDoc = docs.find(doc => doc.name === 'bar');
expect(barDoc.content).toEqual('@name bar\n@description\ndescription of bar {@inline-tag} more content');
});