{"version":3,"file":"lazy-CAN0oaXD.cjs","names":[],"sources":["../lib/helpers/lazy.ts"],"sourcesContent":["/**\n * Creates a lazily initialized function.\n *\n * The returned function will call the initializer function on its first call and\n * store the result. On subsequent calls, it will return the stored result.\n *\n * @param initializer The function to be called for initialization.\n * @returns A function that calls the initializer function on its first call and\n *          returns the stored result on subsequent calls.\n */\nexport function lazy<T>(initializer: () => T): () => T {\n  let value: T | undefined;\n  let initialized = false;\n\n  return () => {\n    if (!initialized) {\n      value = initializer();\n      initialized = true;\n    }\n    return value!;\n  };\n}\n"],"mappings":";;;;;;;;;;;AAUA,SAAgB,KAAQ,aAA+B;CACrD,IAAI;CACJ,IAAI,cAAc;CAElB,aAAa;EACX,IAAI,CAAC,aAAa;GAChB,QAAQ,YAAY;GACpB,cAAc;EAChB;EACA,OAAO;CACT;AACF"}