UNPKG

@cloud-copilot/iam-policy

Version:
42 lines 1.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConditionImpl = void 0; const conditionOperation_js_1 = require("./conditionOperation.js"); class ConditionImpl { op; key; values; otherProps; constructor(op, key, values, otherProps) { this.op = op; this.key = key; this.values = values; this.otherProps = otherProps; } operation() { return new conditionOperation_js_1.ConditionOperationImpl(this.op); } conditionKey() { return this.key; } conditionValues() { return typeof this.values === 'string' ? [this.values] : this.values; } valueIsArray() { return Array.isArray(this.values); } operatorKeyPath() { return `${this.otherProps.conditionPath}.#${this.op}`; } operatorValuePath() { return `${this.otherProps.conditionPath}.${this.op}`; } keyPath() { return `${this.otherProps.conditionPath}.${this.op}.#${this.key}`; } valuesPath() { return `${this.otherProps.conditionPath}.${this.op}.${this.key}`; } } exports.ConditionImpl = ConditionImpl; //# sourceMappingURL=condition.js.map