Skip to main content

Tables

Small table helpers the package shares: deep copy, sorted keys, a flat distance and a prefixed view. Exposed as VluxyAI.Tables.

Functions​

Prefixed​

Tables.Prefixed(
target: {[string]: any},
prefix: string
) → {[string]: any}--

target itself when prefix is empty, else a view whose reads and writes go to prefix .. key.

A prefixed view of a table, so a sense given Prefix = "Peripheral" writes PeripheralSeenTarget without knowing. Costs one small table per call; nothing at all when the prefix is empty, which is the default everywhere.

EditDistance​

Tables.EditDistance(
a: string,
b: string
) → number--

The edit distance: insertions, deletions and substitutions to turn a into b.

Show raw api
{
    "functions": [
        {
            "name": "Prefixed",
            "desc": "A prefixed view of a table, so a sense given `Prefix = \"Peripheral\"` writes\n`PeripheralSeenTarget` without knowing. Costs one small table per call; nothing at all when\nthe prefix is empty, which is the default everywhere.",
            "params": [
                {
                    "name": "target",
                    "desc": "",
                    "lua_type": "{ [string]: any }"
                },
                {
                    "name": "prefix",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "`target` itself when `prefix` is empty, else a view whose reads and writes go to `prefix .. key`.",
                    "lua_type": "{ [string]: any }"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 62,
                "path": "lib/Utility/Tables.luau"
            }
        },
        {
            "name": "EditDistance",
            "desc": "",
            "params": [
                {
                    "name": "a",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "b",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "The edit distance: insertions, deletions and substitutions to turn `a` into `b`.",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 83,
                "path": "lib/Utility/Tables.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Tables",
    "desc": "Small table helpers the package shares: deep copy, sorted keys, a flat distance and a\nprefixed view. Exposed as `VluxyAI.Tables`.",
    "source": {
        "line": 15,
        "path": "lib/Utility/Tables.luau"
    }
}