repo stringclasses 350
values | file_path stringlengths 29 200 | language stringclasses 2
values | file_type stringclasses 4
values | code stringlengths 2 1.01M | tokens int64 2 598k |
|---|---|---|---|---|---|
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/flatMap.luau | luau | .luau | --!optimize 2
--!strict
local flat = require("./flat")
local map = require("./map")
local types = require("@packages/ES7Types")
local __DEV__ = _G.__DEV__
type Array<T> = types.Array<T>
type callbackFn<T, U> = (element: T, index: number, array: Array<T>) -> U
type callbackFnWithThisArg<T, U, V> = (thisArg: V, elemen... | 234 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/forEach.luau | luau | .luau | --!optimize 2
--!strict
local types = require("@packages/ES7Types")
local __DEV__ = _G.__DEV__
type Array<T> = types.Array<T>
type Object = types.Object
type callbackFn<T> = (element: T, index: number, array: Array<T>) -> ()
type callbackFnWithThisArg<T, U> = (thisArg: U, element: T, index: number, array: Array<T>) ->... | 354 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/from.luau | luau | .luau | --!optimize 2
--!strict
local ES7Types = require("@packages/ES7Types")
local InstanceOf = require("@packages/InstanceOf")
local Map = require("../Map/Map")
local Set = require("../Set")
local fromString = require("./fromString")
local isArray = require("./isArray")
type Array<T> = ES7Types.Array<T>
type Map<K, V> = ... | 1,138 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/fromString.luau | luau | .luau | --!optimize 2
--!strict
local ES7Types = require("@packages/ES7Types")
type Object = ES7Types.Object
type FromStringFunction<T, U> = (element: T, index: number) -> U
type FromStringThisFunction<T, U> = (thisArg: any, element: T, index: number) -> U
local function FromString<T, U>(
value: string,
callback: FromStri... | 293 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/includes.luau | luau | .luau | --!optimize 2
--!strict
local indexOf = require("./indexOf")
local types = require("@packages/ES7Types")
type Array<T> = types.Array<T>
return function<T>(array: Array<T>, searchElement: T, fromIndex: number?): boolean
return indexOf(array, searchElement, fromIndex) ~= -1
end
| 74 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/indexOf.luau | luau | .luau | --!optimize 2
--!strict
local types = require("@packages/ES7Types")
type Array<T> = types.Array<T>
-- Implements equivalent functionality to JavaScript's `array.indexOf`,
-- implementing the interface and behaviors defined at:
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/i... | 253 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/init.luau | luau | .luau | --!optimize 2
--!strict
export type Array<T> = {T}
return table.freeze({
concat = require("@self/concat");
every = require("@self/every");
filter = require("@self/filter");
find = require("@self/find");
findIndex = require("@self/findIndex");
flat = require("@self/flat");
flatMap = require("@self/flatMap");
f... | 213 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/isArray.luau | luau | .luau | --!optimize 2
--!strict
return function(value: any): boolean
if type(value) ~= "table" then
return false
end
if next(value) == nil then
-- an empty table is an empty array
return true
end
local length = #value
if length == 0 then
return false
end
local count = 0
local sum = 0
for key in next, val... | 169 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/join.luau | luau | .luau | --!optimize 2
--!strict
local map = require("./map")
type Array<T> = {T}
return function<T>(arr: {T}, separator: string?): string
if #arr == 0 then
return ""
end
-- JS does tostring conversion implicitely but in Lua we need to do that explicitely
return table.concat(map(arr, tostring), separator or ",")
end
| 86 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/map.luau | luau | .luau | --!optimize 2
--!strict
local types = require("@packages/ES7Types")
local __DEV__ = _G.__DEV__
type Array<T> = types.Array<T>
type Object = types.Object
type callbackFn<T, U> = (element: T, index: number, array: Array<T>) -> U
type callbackFnWithThisArg<T, U, V> = (thisArg: V, element: T, index: number, array: Array<T... | 375 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/reduce.luau | luau | .luau | --!optimize 2
--!strict
local types = require("@packages/ES7Types")
local __DEV__ = _G.__DEV__
type Array<T> = types.Array<T>
type reduceFn<T, U> = (previousValue: U, currentValue: T, currentIndex: number, array: Array<T>) -> U
-- Implements Javascript's `Array.prototype.reduce` as defined below
-- https://developer.... | 325 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/reverse.luau | luau | .luau | --!optimize 2
--!strict
-- https://programming-idioms.org/idiom/19/reverse-a-list/1314/lua
local types = require("@packages/ES7Types")
type Array<T> = types.Array<T>
return function<T>(t: Array<T>): Array<T>
local n = #t
local i = 1
while i < n do
t[i], t[n] = t[n], t[i]
i += 1
n -= 1
end
return t
end
| 116 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/shift.luau | luau | .luau | --!optimize 2
--!strict
local isArray = require("./isArray")
local types = require("@packages/ES7Types")
local __DEV__ = _G.__DEV__
type Array<T> = types.Array<T>
return function<T>(value: Array<T>): T?
if __DEV__ and not isArray(value) then
error(string.format("Array.shift called on non-array %s", typeof(value)))... | 108 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/slice.luau | luau | .luau | --!optimize 2
--!strict
local types = require("@packages/ES7Types")
type Array<T> = types.Array<T>
-- Implements Javascript's `Array.prototype.slice` as defined below, but with 1-indexing
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice
return function<T>(t: Array<T>, st... | 308 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/some.luau | luau | .luau | --!optimize 2
--!strict
local types = require("@packages/ES7Types")
type Array<T> = types.Array<T>
type Object = types.Object
-- note: JS version can return anything that's truthy, but that won't work for us since Lua deviates (0 is truthy)
type callbackFn<T> = (element: T, index: number, array: Array<T>) -> boolean
... | 335 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/sort.luau | luau | .luau | --!optimize 2
--!strict
local None = require("../Object/None")
local types = require("@packages/ES7Types")
type Array<T> = types.Array<T>
type Comparable = (any, any) -> number
local defaultSort = function<T>(a: T, b: T): boolean
return type(a) .. tostring(a) < type(b) .. tostring(b)
end
return function<T>(array: A... | 289 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/splice.luau | luau | .luau | --!optimize 2
--!strict
local types = require("@packages/ES7Types")
type Array<T> = types.Array<T>
-- Implements equivalent functionality to JavaScript's `array.splice`, including
-- the interface and behaviors defined at:
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splic... | 447 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Array/unshift.luau | luau | .luau | --!optimize 2
--!strict
local isArray = require("./isArray")
local types = require("@packages/ES7Types")
local __DEV__ = _G.__DEV__
type Array<T> = types.Array<T>
return function<T>(array: Array<T>, ...: T): number
if __DEV__ and not isArray(array) then
error(string.format("Array.unshift called on non-array %s", ... | 153 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Map/Map.luau | luau | .luau | --!optimize 2
--!strict
local ES7Types = require("@packages/ES7Types")
local InstanceOf = require("@packages/InstanceOf")
local arrayForEach = require("../Array/forEach")
local arrayMap = require("../Array/map")
local isArray = require("../Array/isArray")
local __DEV__ = _G.__DEV__
type Object = ES7Types.Object
typ... | 1,426 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Map/coerceToMap.luau | luau | .luau | --!optimize 2
--!strict
local Map = require("./Map")
local Object = require("../Object")
local instanceOf = require("@packages/InstanceOf")
local types = require("@packages/ES7Types")
type Map<K, V> = types.Map<K, V>
type Table<K, V> = types.Table<K, V>
local function coerceToMap(mapLike: Map<any, any> | Table<any, ... | 149 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Map/coerceToTable.luau | luau | .luau | --!optimize 2
--!strict
local Map = require("./Map")
local arrayReduce = require("../Array/reduce")
local instanceOf = require("@packages/InstanceOf")
local types = require("@packages/ES7Types")
type Map<K, V> = types.Map<K, V>
type Table<K, V> = types.Table<K, V>
local function coerceToTable(mapLike: Map<any, any> ... | 168 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Map/init.luau | luau | .luau | --!optimize 2
--!strict
local ES7Types = require("@packages/ES7Types")
local Map = require("@self/Map")
local coerceToMap = require("@self/coerceToMap")
local coerceToTable = require("@self/coerceToTable")
export type Map<K, V> = ES7Types.Map<K, V>
return table.freeze({
Map = Map;
coerceToMap = coerceToMap;
coerc... | 103 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Object/None.luau | luau | .luau | --!optimize 2
--!strict
-- Marker used to specify that the value is nothing, because nil cannot be
-- stored in tables.
local None = newproxy(true)
local metatable = getmetatable(None)
metatable.__tostring = function()
return "Object.None"
end
return None
| 63 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Object/assign.luau | luau | .luau | --!optimize 2
--!
local None = require("./None")
local types = require("@packages/ES7Types")
type Object = types.Object
--[[
Merges values from zero or more tables onto a target table. If a value is
set to None, it will instead be removed from the table.
This function is identical in functionality to JavaScript'... | 519 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Object/freeze.luau | luau | .luau | --!optimize 2
--!strict
local types = require("@packages/ES7Types")
type Array<T> = types.Array<T>
type Object = types.Object
return function<T>(t: T & (Object | Array<any>)): T
-- Luau FIXME: model freeze better so it passes through the type constraint and doesn't erase
return (table.freeze(t :: any) :: any) :: T
... | 90 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Object/init.luau | luau | .luau | --!optimize 2
--!strict
return table.freeze({
assign = require("@self/assign");
entries = require("@self/entries");
freeze = require("@self/freeze");
is = require("@self/is");
isFrozen = require("@self/isFrozen");
keys = require("@self/keys");
preventExtensions = require("@self/preventExtensions");
seal = requ... | 131 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Object/is.luau | luau | .luau | --!optimize 2
--!strict
-- Implements Javascript's `Object.is` as defined below
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
return function(value1: any, value2: any): boolean
return if value1 == value2 then value1 ~= 0 or 1 / value1 == 1 / value2 else value1 ~= value... | 97 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Object/isFrozen.luau | luau | .luau | --!optimize 2
--!strict
local types = require("@packages/ES7Types")
type Array<T> = types.Array<T>
type Object = types.Object
local __DEV__ = _G.__DEV__
return function(t: Object | Array<any>): boolean
if __DEV__ then
print("Luau now has a direct table.isfrozen call that can save the overhead of this library func... | 99 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Object/keys.luau | luau | .luau | --!optimize 2
--!strict
local ES7Types = require("@packages/ES7Types")
local InstanceOf = require("@packages/InstanceOf")
local Set = require("../Set")
type Array<T> = ES7Types.Array<T>
type Set<T> = ES7Types.Set<T>
type Table = {[any]: any}
return function(value: Set<any> | Table | string): Array<string>
if value ... | 215 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Object/preventExtensions.luau | luau | .luau | --!optimize 2
--!strict
local types = require("@packages/ES7Types")
type Array<T> = types.Array<T>
type Object = types.Object
-- FIXME: This should be updated to be closer to the actual
-- `Object.preventExtensions` functionality in JS. This requires additional
-- support from the VM
local function preventExtensions<... | 168 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Object/values.luau | luau | .luau | --!optimize 2
--!strict
local types = require("@packages/ES7Types")
type Array<T> = types.Array<T>
-- TODO Luau: needs overloads to model this more correctly
return function<T>(value: {[string]: T} | Array<T> | string): Array<T> | Array<string>
if value == nil then
error("cannot extract values from a nil value")
... | 229 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/Set.luau | luau | .luau | --!optimize 2
--!nonstrict
local arrayForEach = require("./Array/forEach")
local arrayFromString = require("./Array/fromString")
local inspect = require("./inspect")
local isArray = require("./Array/isArray")
local types = require("@packages/ES7Types")
local __DEV__ = _G.__DEV__
type Array<T> = types.Array<T>
type O... | 1,051 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/WeakMap.luau | luau | .luau | --!optimize 2
--!strict
local ES7Types = require("@packages/ES7Types")
type WeakMap<K, V> = ES7Types.WeakMap<K, V>
type WeakMapPrivate<K, V> = {
_weakMap: {[K]: V},
-- method definitions
get: (self: WeakMapPrivate<K, V>, K) -> V,
set: (self: WeakMapPrivate<K, V>, K, V) -> WeakMapPrivate<K, V>,
has: (self: WeakMa... | 296 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Collections/init.luau | luau | .luau | --!optimize 2
--!strict
local Array = require("@self/Array")
local Map = require("@self/Map")
local Object = require("@self/Object")
local Set = require("@self/Set")
local WeakMap = require("@self/WeakMap")
local inspect = require("@self/inspect")
local types = require("@packages/ES7Types")
export type Array<T> = typ... | 191 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Console/MakeConsole.luau | luau | .luau | --!optimize 2
--!strict
local Chalk = require("@packages/Chalk")
local Collections = require("../Collections")
local Debug = require("@packages/Debug")
local Map = Collections.Map
local inspect = Collections.inspect
local INDENT = " "
local RED = Chalk.Rgb(243, 53, 53)
local YELLOW = Chalk.Rgb(243, 174, 53)
local... | 1,329 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Console/init.luau | luau | .luau | --!optimize 2
--!strict
local MakeConsole = require("@self/MakeConsole")
local console = MakeConsole()
return console
| 30 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Error.luau | luau | .luau | --!optimize 2
--!strict
local ES7Types = require("@packages/ES7Types")
type Function = ES7Types.Function
export type Error = {
name: string,
message: string,
stack: string?,
}
type Private = Error & {__stack: string?}
local Error = {}
local DEFAULT_NAME = "Error"
Error.__index = Error
Error.__tostring = function... | 747 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Math.luau | luau | .luau | --!optimize 2
--!strict
return table.freeze({
clz32 = bit32.countlz;
})
| 24 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Number/MAX_SAFE_INTEGER.luau | luau | .luau | --!optimize 2
--!strict
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
return 9007199254740991
| 44 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Number/MIN_SAFE_INTEGER.luau | luau | .luau | --!optimize 2
--!strict
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER
return -9007199254740991
| 44 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Number/init.luau | luau | .luau | --!optimize 2
--!strict
return table.freeze({
isFinite = require("@self/isFinite");
isInteger = require("@self/isInteger");
isNaN = require("@self/isNaN");
isSafeInteger = require("@self/isSafeInteger");
MAX_SAFE_INTEGER = require("@self/MAX_SAFE_INTEGER");
MIN_SAFE_INTEGER = require("@self/MIN_SAFE_INTEGER");
... | 99 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Number/isFinite.luau | luau | .luau | --!optimize 2
--!strict
return function(value: unknown)
return type(value) == "number" and value == value and value ~= math.huge and value ~= -math.huge
end
| 44 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Number/isInteger.luau | luau | .luau | --!optimize 2
--!strict
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger
return function(value: unknown)
return type(value) == "number" and value ~= math.huge and value == math.floor(value)
end
| 62 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Number/isNaN.luau | luau | .luau | --!optimize 2
--!strict
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN
return function(value: unknown)
return type(value) == "number" and value ~= value
end
| 54 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Number/isSafeInteger.luau | luau | .luau | --!optimize 2
--!strict
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger
local MAX_SAFE_INTEGER = require("./MAX_SAFE_INTEGER")
local isInteger = require("./isInteger")
return function(value: unknown)
return isInteger(value) and math.abs(value :: number) <= MAX... | 79 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Number/toExponential.luau | luau | .luau | --!optimize 2
--!strict
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential
return function(value: number | string, fractionDigits: number?): string?
local num = value
if type(value) == "string" then
-- ROBLOX FIXME: add parseInt to encapsulate this logic and us... | 285 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Promise.luau | luau | .luau | --!optimize 2
-- this maps onto community promise libraries which won't support Luau, so we inline
local Promise = require("@packages/Promise")
export type PromiseLike<T> = {
Then: (
self: PromiseLike<T>,
resolve: ((T) -> ...(nil | T | PromiseLike<T>))?,
reject: ((any) -> ...(nil | T | PromiseLike<T>))?
) -> ... | 112 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/String/charCodeAt.luau | luau | .luau | --!optimize 2
--!strict
local Number = require("../Number")
local NaN = Number.NaN
-- js https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt
-- lua http://www.lua.org/manual/5.4/manual.html#pdf-utf8.codepoint
return function(value: string, index: number): number
if typ... | 245 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/String/endsWith.luau | luau | .luau | --!optimize 2
--!strict
local function endsWith(value: string, substring: string, optionalLength: number?): boolean
local substringLength = #substring
if substringLength == 0 then
return true
end
local valueLength = #value
local length = optionalLength or valueLength
if length > valueLength then
length = va... | 125 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/String/findOr.luau | luau | .luau | --!optimize 2
--!strict
type Match = {
index: number,
match: string,
}
-- excluding the `+` and `*` character, since findOr tests and graphql use them explicitly
local luauPatternCharacters = "([" .. string.gsub("$%^()-[].?", "(.)", "%%%1") .. "])"
local function findOr(value: string, patternTable: {string}, initi... | 425 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/String/includes.luau | luau | .luau | --!optimize 2
--!strict
-- excluding the `+` and `*` character, since findOr tests and graphql use them explicitly
local luauPatternCharacters = "([" .. string.gsub("$%^()-[].?", "(.)", "%%%1") .. "])"
local function includes(value: string, substring: string, position: nil | number | string): boolean
local stringLen... | 248 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/String/indexOf.luau | luau | .luau | --!optimize 2
--!strict
-- excluding the `+` and `*` character, since findOr tests and graphql use them explicitly
local luauPatternCharacters = "([" .. string.gsub("$%^()-[].?", "(.)", "%%%1") .. "])"
-- Implements equivalent functionality to JavaScript's `String.indexOf`,
-- implementing the interface and behaviors... | 274 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/String/init.luau | luau | .luau | --!optimize 2
--!strict
return table.freeze({
charCodeAt = require("@self/charCodeAt");
endsWith = require("@self/endsWith");
findOr = require("@self/findOr");
includes = require("@self/includes");
indexOf = require("@self/indexOf");
lastIndexOf = require("@self/lastIndexOf");
slice = require("@self/slice");
s... | 169 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/String/lastIndexOf.luau | luau | .luau | --!optimize 2
--!strict
local function lastIndexOf(value: string, searchValue: string, fromIndex: number?): number
local valueLength = #value
local calculatedFromIndex
if fromIndex then
calculatedFromIndex = fromIndex
else
calculatedFromIndex = valueLength
end
if fromIndex and fromIndex < 1 then
calculate... | 322 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/String/slice.luau | luau | .luau | --!optimize 2
--!strict
local function slice(value: string, startIndexStr: string | number, lastIndexStr: (string | number)?): string
local strLen, invalidBytePosition = utf8.len(value)
assert(strLen ~= nil, string.format("string `%*` has an invalid byte at position %*", value, invalidBytePosition))
local startInd... | 333 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/String/split.luau | luau | .luau | --!optimize 2
--!strict
local Number = require("../Number")
local findOr = require("./findOr")
local slice = require("./slice")
local MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER
type Array<T> = {T}
type Pattern = string | Array<string>
local function split(str: string, _pattern: Pattern?, _limit: number?): Array<str... | 484 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/String/startsWith.luau | luau | .luau | --!optimize 2
--!strict
local function startsWith(value: string, substring: string, position: number?): boolean
if #substring == 0 then
return true
end
-- Luau FIXME: we have to use a tmp variable, as Luau doesn't understand the logic below narrow position to `number`
local position_
if position == nil or posit... | 136 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/String/substr.luau | luau | .luau | --!optimize 2
--!strict
return function(value: string, startIndex: number, numberOfCharacters: number?): string
if numberOfCharacters and numberOfCharacters <= 0 then
return ""
end
return string.sub(value, startIndex, numberOfCharacters and startIndex + numberOfCharacters - 1 or nil)
end
| 65 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/String/trim.luau | luau | .luau | --!optimize 2
--!strict
local trimEnd = require("./trimEnd")
local trimStart = require("./trimStart")
return function(source: string): string
return trimStart(trimEnd(source))
end
| 45 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/String/trimEnd.luau | luau | .luau | --!optimize 2
--!strict
return function(source: string): string
return (string.gsub(source, "[%s]+$", ""))
end
| 31 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/String/trimStart.luau | luau | .luau | --!optimize 2
--!strict
return function(source: string): string
return (string.gsub(source, "^[%s]+", ""))
end
| 32 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Symbol/RegistryGlobal.luau | luau | .luau | --!optimize 2
--!strict
local Symbol = require("./Symbol")
local GlobalRegistry: {[string]: Symbol.Symbol} = {}
return table.freeze({
getOrInit = function(name: string): Symbol.Symbol
if GlobalRegistry[name] == nil then
GlobalRegistry[name] = Symbol.new(name)
end
return GlobalRegistry[name]
end;
-- Use... | 96 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Symbol/Symbol.luau | luau | .luau | --!optimize 2
--!strict
--[[
Symbols have the type 'userdata', but when printed or coerced to a string,
the symbol will turn into the string given as its name.
**This implementation provides only the `Symbol()` constructor and the
global registry via `Symbol.for_`.**
Other behaviors, including the ability to fin... | 176 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Symbol/init.luau | luau | .luau | --!optimize 2
--!strict
--[[
A 'Symbol' is an opaque marker type, implemented to behave similarly to JS:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol
]]
local GlobalRegistry = require("@self/RegistryGlobal")
local Symbol = require("@self/Symbol")
export type Symbol = Symbo... | 175 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Timers/init.luau | luau | .luau | --!optimize 2
--!strict
local task = require("@lune/task")
local MakeInterval = require("@self/makeIntervalImpl")
local MakeTimer = require("@self/makeTimerImpl")
export type Timeout = MakeTimer.Timeout
export type Interval = MakeInterval.Interval
local Interval = MakeInterval(task.delay)
local Timer = MakeTimer(ta... | 113 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Timers/makeIntervalImpl.luau | luau | .luau | --!optimize 2
--!strict
local Status = newproxy(false)
type TaskStatus = number
export type Interval = {[typeof(Status)]: TaskStatus}
local SCHEDULED = 1
local CANCELLED = 3
return function(taskDelay)
local function setInterval(callback, intervalTime: number?, ...): Interval
local arguments = {...}
local inter... | 265 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/Timers/makeTimerImpl.luau | luau | .luau | --!optimize 2
local Status = newproxy(false)
type TaskStatus = number
export type Timeout = {[typeof(Status)]: TaskStatus}
local SCHEDULED = 1
local DONE = 2
local CANCELLED = 3
return function(taskDelay)
local function setTimeout(callback, delayTime: number?, ...): Timeout
local arguments = {...}
local timeout... | 256 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/encodeURIComponent.luau | luau | .luau | --!optimize 2
--!strict
-- reference documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
local Error = require("./Error")
local String = require("./String")
local net = require("@lune/net")
local charCodeAt = String.charCodeAt
local function encodeURICom... | 385 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/extends.luau | luau | .luau | --!optimize 2
--!strict
--[[
deviation: Our constructors currently have no notion of 'super' so any
such behavior in upstream JS must be implemented manually by setting fields
A constructor passed to this class would typically look along the lines of:
function(self, arg, otherArg)
self.arg = arg
self.otherArg... | 294 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/init.luau | luau | .luau | --!optimize 2
--!strict
local AssertionError = require("@self/AssertionError")
local Boolean = require("@self/Boolean")
local Collections = require("@self/Collections")
local Console = require("@self/Console")
local Error = require("@self/Error")
local Math = require("@self/Math")
local Number = require("@self/Number"... | 428 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LunePolyfill/Utf8.luau | luau | .luau | --!optimize 2
--!strict
local Utf8 = {}
function Utf8.Graphemes(value: string, start: number?, finish: number?): () -> (number, number)
local trueStart = start or 1
local trueFinish = finish or #value
local codePoints = {}
local length = 0
for point in utf8.codes(value) do
if point >= trueStart and point <= t... | 200 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LunePolyfill/init.luau | luau | .luau | --!optimize 2
--!strict
local Utf8 = require("@self/Utf8")
local LunePolyfill = table.freeze({
Utf8 = Utf8;
})
return LunePolyfill
| 44 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/Option.luau | luau | .luau | --!nonstrict
--!optimize 2
-- Option
-- Stephen Leitnick
-- August 28, 2020
--[[
MatchTable {
Some: (value: any) -> any
None: () -> any
}
CONSTRUCTORS:
Option.Some(anyNonNilValue): Option<any>
Option.Wrap(anyValue): Option<any>
STATIC FIELDS:
Option.None: Option<None>
STATIC METHODS:
Option.Is(obj... | 3,628 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/PathFileSystem.luau | luau | .luau | --!optimize 2
--!strict
local LuauPath = require("@packages/LuauPath")
local LuauPolyfill = require("@packages/LuauPolyfill")
local fs = require("@lune/fs")
local process = require("@lune/process")
local PathFileSystem = {}
local Path = LuauPath.Path
local console = LuauPolyfill.console
export type AsPath = LuauPat... | 2,027 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/PromiseUtilities/AsyncMulti.luau | luau | .luau | --!optimize 2
--!strict
local Promise = require("@packages/Promise")
local function PackRest<S, T...>(statusOrSuccess: S, ...: T...)
-- table.pack cringes with typed varargs, so we do this instead.
-- selene: allow(mixed_table)
return statusOrSuccess, {
n = select("#", ...);
select(1, ...);
}
end
--[=[
A fu... | 420 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/PromiseUtilities/Await.luau | luau | .luau | --!optimize 2
--!strict
local Promise = require("@packages/Promise")
--[=[
The functionality of this is meant to be the same as the `await` keyword in
ECMAScript.
```ts
async function promiseGet(url: string) {
return HttpService.GetAsync(url);
}
const result = await promiseGet("https://example.com");
```
... | 349 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/PromiseUtilities/AwaitMulti.luau | luau | .luau | --!optimize 2
--!strict
local Promise = require("@packages/Promise")
local function PackRest<S, T...>(statusOrSuccess: S, ...: T...)
-- table.pack cringes with typed varargs, so we do this instead.
-- selene: allow(mixed_table)
return statusOrSuccess, {
n = select("#", ...);
select(1, ...);
}
end
--[=[
The ... | 431 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/PromiseUtilities/FastAsync.luau | luau | .luau | --!optimize 2
--!strict
local Promise = require("@packages/Promise")
local ThreadUtilities = require("@packages/ThreadUtilities")
--[=[
A function that turns another function into the same as an async function
in ECMAScript. This uses a thread recycling "fast spawn" function instead
of `coroutine.wrap`.
```ts
a... | 369 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/PromiseUtilities/FastAsyncMulti.luau | luau | .luau | --!optimize 2
--!strict
local Promise = require("@packages/Promise")
local ThreadUtilities = require("@packages/ThreadUtilities")
local function PackRest<S, T...>(statusOrSuccess: S, ...: T...)
-- table.pack cringes with typed varargs, so we do this instead.
-- selene: allow(mixed_table)
return statusOrSuccess, {
... | 395 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/PromiseUtilities/init.luau | luau | .luau | --!optimize 2
--!strict
local Promise = require("@packages/Promise")
local Async = require("@self/Async")
local AsyncMulti = require("@self/AsyncMulti")
local Await = require("@self/Await")
local AwaitMulti = require("@self/AwaitMulti")
local FastAsync = require("@self/FastAsync")
local FastAsyncMulti = require("@sel... | 255 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/SemanticVersion.luau | luau | .luau | --!optimize 2
--!strict
local GreenTea = require("@packages/GreenTea")
local LuauPolyfill = require("@packages/LuauPolyfill")
local PathFileSystem = require("@packages/PathFileSystem")
local serde = require("@lune/serde")
local console = LuauPolyfill.console
local isWallyPackage = GreenTea.build({
dependencies = Gr... | 2,397 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/SortedArray.luau | luau | .luau | --!optimize 2
--!strict
local Error = require("@packages/Error")
local GreenTea = require("@packages/GreenTea")
local GreenTeaUtilities = require("@packages/GreenTeaUtilities")
local TableUtilities = require("@packages/TableUtilities")
type ComparisonFunction<T> = (a: T, b: T) -> boolean
export type SortedArray<T> =... | 6,107 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/CopyDeep.luau | luau | .luau | --!optimize 2
--!strict
-- types are wonky here, but it's cause i can assure
-- that i am right
local function FastCopyDeep<T>(object: T): T
local newObject = table.clone(object :: never)
for key, value in pairs(object :: never) do
if type(value) == "table" then
newObject[key] = FastCopyDeep(value)
end
end
... | 316 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/EqualObjects.luau | luau | .luau | --!optimize 2
--!strict
--[=[
Compares two or more tables to see if they are equal.
```lua
local a = {hello = "world"}
local b = {hello = "world"}
local equal = EqualObjects(a, b) -- false
```
```lua
local a, b = table.unpack(table.create(2, {}), 1, 2)
local equal = EqualObjects(a, b) -- true
```
@funct... | 203 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/Equals.luau | luau | .luau | --!optimize 2
--!strict
local EqualObjects = require("./EqualObjects")
--@native
local function Compare(a: unknown, b: unknown): boolean
if type(a) ~= "table" or type(b) ~= "table" then
return a == b
end
local castA = a :: {[unknown]: unknown}
local castB = b :: {[unknown]: unknown}
-- can't use generalized ... | 378 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/EqualsDeep.luau | luau | .luau | --!optimize 2
--!strict
local EqualObjects = require("./EqualObjects")
--@native
local function CompareDeep(a: unknown, b: unknown): boolean
if type(a) ~= "table" or type(b) ~= "table" then
return a == b
end
local castA = a :: {[unknown]: unknown}
local castB = b :: {[unknown]: unknown}
-- can't use generali... | 400 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/FastMerge.luau | luau | .luau | --!optimize 2
--!strict
--[=[
A fast merge function that doesn't support a `None` value. Uses if branches
to avoid iteration. Does NOT do any type validation, be aware of what you
pass to it.
@function FastMerge
@within TableUtilities
@param ... ...{[unknown]: unknown} -- The tables to merge.
@return T -- The... | 540 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/FastMergeDeep.luau | luau | .luau | --!optimize 2
--!strict
local CopyDeep = require("./CopyDeep")
--[=[
Merges the given dictionaries into a single dictionary. This is recursive.
The parameters may be any number of dictionaries or `nil`. Non-dictionaries
will be ignored. Uses if branches to avoid iteration as much as possible.
@function FastMerge... | 717 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/GetLength.luau | luau | .luau | --!optimize 2
--!strict
--[=[
Gets the length of any table. This has a really bad time complexity of O(n)
so I would just not use this unless you absolutely have to. And if you
absolutely do have to, I'd just suggest inlining.
This uses `pairs` to avoid weird `__call` issues with generalized
iteration.
```lua
... | 224 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/IsArray.luau | luau | .luau | --!optimize 2
--!strict
--[=[
Checks if the given value as an array.
@function IsArray
@within TableUtilities
@param value unknown -- The value to check.
@return boolean -- Whether the value is an array.
]=]
local function IsArray(value: any): boolean
if type(value) ~= "table" then
return false
end
if nex... | 212 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/LockDeep.luau | luau | .luau | --!optimize 2
--!strict
local function FastLockDeep<T>(object: T): T
local newObject = table.clone(object :: never)
for key, value in pairs(object :: never) do
if type(value) == "table" then
newObject[key] = FastLockDeep(value)
end
end
return table.freeze(newObject) :: never
end
--[=[
Does a deep copy and... | 285 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/Repr.luau | luau | .luau | --!optimize 2
--!strict
local DateTime = require("@lune/datetime")
local FastMergeDeep = require("./FastMergeDeep")
local IsArray = require("./IsArray")
local roblox = require("@lune/roblox")
type DateTime = DateTime.DateTime
export type Locale = DateTime.Locale
--[=[
Indicates that [DateTime]s should be formatted ... | 3,150 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/SortedArrays/FindInsertIndex.luau | luau | .luau | --!optimize 2
--!strict
export type Comparison<T> = (a: T, b: T) -> boolean
--[=[
Used to find where to insert an element into a sorted array. You will
need to provide a compare function to use and possible an equality check.
If you are using numbers or strings, you can get away with
[TableUtilities.FindInsertInd... | 647 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/SortedArrays/FindInsertIndexSimple.luau | luau | .luau | --!optimize 2
--!strict
--[=[
Used to find where to insert an element into a sorted array. This requires
the elements to be either a number or a string.
:::danger Warning
Your array *MUST* be already sorted because this uses a binary search. This
function will not sort for you.
:::
```lua
local array: {numbe... | 472 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/SortedArrays/SortedInsert.luau | luau | .luau | --!optimize 2
--!strict
local FindInsertIndex = require("./FindInsertIndex")
type Comparison<T> = FindInsertIndex.Comparison<T>
--[=[
Inserts a value into a sorted array using a binary search. This requires
the elements to be either a number or a string.
Inserts a value into a sorted array using a binary search. ... | 503 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/SortedArrays/SortedInsertSimple.luau | luau | .luau | --!native
--!optimize 2
--!strict
local FindInsertIndexSimple = require("./FindInsertIndexSimple")
--[=[
Inserts a value into a sorted array using a binary search. This requires
the elements to be either a number or a string.
:::danger Warning
Your array *MUST* be already sorted because this uses a binary search... | 322 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/init.luau | luau | .luau | --!optimize 2
--!strict
local CopyDeep = require("@self/CopyDeep")
local EqualObjects = require("@self/EqualObjects")
local Equals = require("@self/Equals")
local EqualsDeep = require("@self/EqualsDeep")
local FastMerge = require("@self/FastMerge")
local FastMergeDeep = require("@self/FastMergeDeep")
local GetLength =... | 389 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/ThreadUtilities/FastDefer.luau | luau | .luau | --!optimize 2
--!strict
local task = require("@lune/task")
local FreeThreads: {thread} = table.create(500)
local function RunFunction<Arguments...>(callback: (Arguments...) -> (), thread: thread, ...: Arguments...)
callback(...)
table.insert(FreeThreads, thread)
end
local function Yield()
while true do
RunFunct... | 260 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/ThreadUtilities/FastDeferSafe.luau | luau | .luau | --!optimize 2
--!strict
local task = require("@lune/task")
local FreeThreads: {thread} = table.create(500)
local function RunFunction<Arguments...>(callback: (Arguments...) -> (), thread: thread, ...: Arguments...)
callback(...)
table.insert(FreeThreads, thread)
end
local function Yield()
while true do
RunFunct... | 337 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/ThreadUtilities/FastDelay.luau | luau | .luau | --!optimize 2
--!strict
local task = require("@lune/task")
local FreeThreads: {thread} = table.create(500)
local function RunFunction<Arguments...>(callback: (Arguments...) -> (), thread: thread, ...: Arguments...)
callback(...)
table.insert(FreeThreads, thread)
end
local function Yield()
while true do
RunFunct... | 315 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.