Skip to main content

AccessFactContributionStateUtils

Moving between an AccessFactContributionState and the plain values authors write.

Authoring stays cheap -- a resolver may still return true, false, or an observable of boolean? -- and the boundary names what arrived. What is no longer possible is an unlabelled nil reaching the merge, where it used to mean two different things depending on where you looked.

Functions​

fromValue​

AccessFactContributionStateUtils.fromValue(value: boolean?) → string

The state a plain authored value means. nil becomes UNRESOLVED, which is the only reading that was ever intended -- a source that has not answered yet is saying "I cannot say", not "skip me".

toValue​

AccessFactContributionStateUtils.toValue(state: string) → boolean?

The boolean a state carries, for the callers that still work in booleans. ALLOW and DENY only; anything else is nil, because neither UNRESOLVED nor ABSTAIN is a yes-or-no.

contributes​

AccessFactContributionStateUtils.contributes(state: string) → boolean

Whether a layer said anything at all. False only for ABSTAIN -- the merge skips those and asks the next layer down.

isDefinite​

AccessFactContributionStateUtils.isDefinite(state: string) → boolean

Whether a state is a definite yes or no, as opposed to a non-answer.

invert​

AccessFactContributionStateUtils.invert(state: string) → string

The opposite answer, where there is one.

isContributionState​

AccessFactContributionStateUtils.isContributionState(value: any) → boolean
Show raw api
{
    "functions": [
        {
            "name": "fromValue",
            "desc": "The state a plain authored value means. `nil` becomes UNRESOLVED, which is the only reading that was\never intended -- a source that has not answered yet is saying \"I cannot say\", not \"skip me\".",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 25,
                "path": "src/access/src/Shared/AccessFactContributionStateUtils.lua"
            }
        },
        {
            "name": "toValue",
            "desc": "The boolean a state carries, for the callers that still work in booleans. ALLOW and DENY only;\nanything else is nil, because neither UNRESOLVED nor ABSTAIN is a yes-or-no.",
            "params": [
                {
                    "name": "state",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 42,
                "path": "src/access/src/Shared/AccessFactContributionStateUtils.lua"
            }
        },
        {
            "name": "contributes",
            "desc": "Whether a layer said anything at all. False only for ABSTAIN -- the merge skips those and asks the\nnext layer down.",
            "params": [
                {
                    "name": "state",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 59,
                "path": "src/access/src/Shared/AccessFactContributionStateUtils.lua"
            }
        },
        {
            "name": "isDefinite",
            "desc": "Whether a state is a definite yes or no, as opposed to a non-answer.",
            "params": [
                {
                    "name": "state",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 69,
                "path": "src/access/src/Shared/AccessFactContributionStateUtils.lua"
            }
        },
        {
            "name": "invert",
            "desc": "The opposite answer, where there is one.",
            "params": [
                {
                    "name": "state",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 79,
                "path": "src/access/src/Shared/AccessFactContributionStateUtils.lua"
            }
        },
        {
            "name": "isContributionState",
            "desc": "",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 96,
                "path": "src/access/src/Shared/AccessFactContributionStateUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "AccessFactContributionStateUtils",
    "desc": "Moving between an [AccessFactContributionState] and the plain values authors write.\n\nAuthoring stays cheap -- a resolver may still return `true`, `false`, or an observable of `boolean?`\n-- and the boundary names what arrived. What is no longer possible is an unlabelled nil reaching the\nmerge, where it used to mean two different things depending on where you looked.",
    "source": {
        "line": 11,
        "path": "src/access/src/Shared/AccessFactContributionStateUtils.lua"
    }
}