import { dataPack } from "sandstone/init"; /// This is stolen from "type-fest" library - this allows us to get autocomplete on the "string" type export type LiteralStringUnion = LiteralType | (string & Record); /** * Generates a unique child function name based on the given name & the current context. * * For example, if you're inside a MCFunction named "test", * getChildFunctionName("myFunction") will return "test/myFunction". * * This is useful to get meaningful names for child functions, instead of the standard "execute_as_1/2/3...". * * 👉 This brings more clarity to the generated functions tree, without impacting the datapack behavior. * * @param name The base name for the child function. * * @returns A meaningful child function name that is unique within the current context. */ export function getChildFunctionName(name: string): string { return dataPack.getUniqueChildName(name).fullName; }