mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-25 00:31:36 +08:00
37 lines
763 B
JavaScript
37 lines
763 B
JavaScript
'use strict';
|
|
|
|
var commandProperties = [
|
|
'name',
|
|
'description',
|
|
'aliases',
|
|
'works',
|
|
'availableOptions',
|
|
'anonymousOptions'
|
|
];
|
|
var blueprintProperties = [
|
|
'name',
|
|
'description',
|
|
'availableOptions',
|
|
'anonymousOptions',
|
|
'overridden'
|
|
];
|
|
|
|
function forEachWithProperty(properties, forEach, context) {
|
|
return properties.filter(function(key) {
|
|
return this[key] !== undefined;
|
|
}, context).forEach(forEach, context);
|
|
}
|
|
|
|
module.exports = {
|
|
command: {
|
|
forEachWithProperty: function(forEach, context) {
|
|
return forEachWithProperty(commandProperties, forEach, context);
|
|
}
|
|
},
|
|
blueprint: {
|
|
forEachWithProperty: function(forEach, context) {
|
|
return forEachWithProperty(blueprintProperties, forEach, context);
|
|
}
|
|
}
|
|
};
|