{"version":3,"file":"id.mjs","names":[],"sources":["../../../../../../src/modules/preprocessor/preprocess/transform/helper/id.ts"],"sourcesContent":["import type { Argument } from \"oxc-parser\";\n\nimport type { CompilerContext } from \"#/contexts/compiler\";\n\nimport { fixedFnv1a } from \"#/modules/processor/functions/hash\";\n\ntype CreateIdOptions = {\n    context: CompilerContext;\n    va: string;\n    arguments: Argument[];\n};\n\nconst createId = (options: CreateIdOptions): string => {\n    const ctx: CompilerContext = options.context;\n\n    if (ctx.isTest) return options.va;\n\n    const struct: string = JSON.stringify(options.arguments);\n\n    const hash: string = fixedFnv1a(struct, 8);\n\n    return hash;\n};\n\nexport type { CreateIdOptions };\nexport { createId };\n"],"mappings":";;AAYA,MAAM,YAAY,YAAqC;CAGnD,IAF6B,QAAQ,QAE7B,QAAQ,OAAO,QAAQ;CAM/B,OAFqB,WAFE,KAAK,UAAU,QAAQ,SAET,GAAG,CAE9B;AACd"}