mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 22:28:13 +00:00
[Code Style] Use prototypes in containment bundle
WTD-1482.
This commit is contained in:
@ -10,22 +10,17 @@ define(
|
||||
* have a composition property.
|
||||
* @constructor
|
||||
* @memberof platform/containment
|
||||
* @implements {Policy.<Type, Type>}
|
||||
*/
|
||||
function CompositionModelPolicy() {
|
||||
return {
|
||||
/**
|
||||
* Is the type identified by the candidate allowed to
|
||||
* contain the type described by the context?
|
||||
* @memberof platform/containment.CompositionModelPolicy#
|
||||
*/
|
||||
allow: function (candidate, context) {
|
||||
return Array.isArray(
|
||||
(candidate.getInitialModel() || {}).composition
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
CompositionModelPolicy.prototype.allow = function (candidate, context) {
|
||||
return Array.isArray(
|
||||
(candidate.getInitialModel() || {}).composition
|
||||
);
|
||||
};
|
||||
|
||||
return CompositionModelPolicy;
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user