build(aio): render class/interface "descendants" in API docs (#19343)

For classes, the tree of subclasses is rendered, recursively.

For interfaces, the descendants are separated into child interfaces, which
extend the interface, and classes, which implement the interface.

Closes #19306
This commit is contained in:
Pete Bacon Darwin
2017-09-25 19:59:44 +01:00
committed by Victor Berchet
parent 5f9a10aab9
commit b8f15d2b77
9 changed files with 100 additions and 4 deletions

View File

@ -0,0 +1,9 @@
module.exports = function filterBy() {
return {
name: 'filterByPropertyValue',
process: function(list, property, value) {
if (!list) return list;
return list.filter(item => item[property] === value);
}
};
};

View File

@ -0,0 +1,14 @@
const factory = require('./filterByPropertyValue');
describe('filterByPropertyValue filter', () => {
let filter;
beforeEach(function() { filter = factory(); });
it('should be called "filterByPropertyValue"', function() { expect(filter.name).toEqual('filterByPropertyValue'); });
it('should filter out items that do not match the given property value', function() {
expect(filter.process([{ a: 1 }, { a: 2 }, { b: 1 }, { a: 1, b: 2 }, { a: null }, { a: undefined }], 'a', 1))
.toEqual([{ a: 1 }, { a: 1, b: 2 }]);
});
});