Skip to content

Commit 7543e59

Browse files
sonukapoorkara
authored andcommitted
refactor(docs-infra): refactors extractDecoratedClasses (#37135)
This commit removes the dependency on the `lodash` module and refactors the `extractDecoratedClasses` method. PR Close #37135
1 parent 5ca8ba3 commit 7543e59

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

aio/tools/transforms/angular-api-package/processors/extractDecoratedClasses.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
var _ = require('lodash');
2-
31
module.exports = function extractDecoratedClassesProcessor(EXPORT_DOC_TYPES) {
42

53
// Add the "directive" docType into those that can be exported from a module
@@ -10,12 +8,9 @@ module.exports = function extractDecoratedClassesProcessor(EXPORT_DOC_TYPES) {
108
$runBefore: ['docs-processed'],
119
decoratorTypes: ['Directive', 'Component', 'Pipe', 'NgModule'],
1210
$process: function(docs) {
13-
var decoratorTypes = this.decoratorTypes;
14-
15-
_.forEach(docs, function(doc) {
16-
17-
_.forEach(doc.decorators, function(decorator) {
18-
11+
const decoratorTypes = this.decoratorTypes;
12+
docs.forEach(doc => {
13+
(doc.decorators || []).forEach(decorator => {
1914
if (decoratorTypes.indexOf(decorator.name) !== -1) {
2015
doc.docType = decorator.name.toLowerCase();
2116
doc[doc.docType + 'Options'] = decorator.argumentInfo[0];

0 commit comments

Comments
 (0)