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:

committed by
Victor Berchet

parent
5f9a10aab9
commit
b8f15d2b77
9
aio/tools/transforms/angular-base-package/rendering/filterByPropertyValue.js
vendored
Normal file
9
aio/tools/transforms/angular-base-package/rendering/filterByPropertyValue.js
vendored
Normal 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);
|
||||
}
|
||||
};
|
||||
};
|
@ -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 }]);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user