@teambit/workspace
Version:
61 lines (59 loc) • 1.47 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ComponentStatus = void 0;
class ComponentStatus {
constructor(
/**
* is the component modified.
*/
modifyInfo,
/**
* is the new component new.
*/
isNew,
/**
* is the component deleted from the workspace.
*/
isDeleted,
/**
* is the component staged.
*/
isStaged,
/**
* does the component exists in the workspace.
*/
isInWorkspace,
/**
* does the component exists in the scope.
*/
isInScope,
/**
* does the component is outdated (pending for update).
*/
isOutdated,
/**
* @deprecated this was relevant for legacy only. can be deleted if it's not used elsewhere
* the component is not authored and not imported.
*/
nested) {
this.modifyInfo = modifyInfo;
this.isNew = isNew;
this.isDeleted = isDeleted;
this.isStaged = isStaged;
this.isInWorkspace = isInWorkspace;
this.isInScope = isInScope;
this.isOutdated = isOutdated;
this.nested = nested;
}
static fromLegacy(status, hasModifiedDependencies, isOutdated) {
const modify = {
hasModifiedFiles: !!status.modified,
hasModifiedDependencies
};
return new ComponentStatus(modify, !!status.newlyCreated, !!status.deleted, !!status.staged, !status.notExist, !status.missingFromScope, isOutdated);
}
}
exports.ComponentStatus = ComponentStatus;
//# sourceMappingURL=component-status.js.map