Skip to main content

DefaultValueUtils

Helps get the default or zero value for value types in Roblox

Functions

getDefaultValueForType

DefaultValueUtils.getDefaultValueForType(typeOfNamestring) → any

Returns the default value for a given value type. If the type is mutable than a new value will ge cosntructed.

toDefaultValue

DefaultValueUtils.toDefaultValue(valueT) → T

Converts this value to its default value. If it's a table, it applies it recursively.

Show raw api
{
    "functions": [
        {
            "name": "getDefaultValueForType",
            "desc": "Returns the default value for a given value type. If the type is mutable than\na new value will ge cosntructed.",
            "params": [
                {
                    "name": "typeOfName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 42,
                "path": "src/defaultvalueutils/src/Shared/DefaultValueUtils.lua"
            }
        },
        {
            "name": "toDefaultValue",
            "desc": "Converts this value to its default value. If it's a table, it applies it recursively.",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 68,
                "path": "src/defaultvalueutils/src/Shared/DefaultValueUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "DefaultValueUtils",
    "desc": "Helps get the default or zero value for value types in Roblox",
    "source": {
        "line": 5,
        "path": "src/defaultvalueutils/src/Shared/DefaultValueUtils.lua"
    }
}