UNPKG

@cloud-copilot/iam-policy

Version:
35 lines 802 B
import { isAllWildcards } from '../utils.js'; export class ActionImpl { constructor(rawValue, otherProps) { this.rawValue = rawValue; this.otherProps = otherProps; } path() { return this.otherProps.path; } type() { if (isAllWildcards(this.rawValue)) { return 'wildcard'; } return 'service'; } wildcardValue() { return '*'; } value() { return this.rawValue; } isWildcardAction() { return this.type() === 'wildcard'; } isServiceAction() { return this.type() === 'service'; } service() { return this.rawValue.split(':')[0].toLowerCase(); } action() { return this.rawValue.split(':')[1]; } } //# sourceMappingURL=action.js.map