{"version":3,"sources":["../../src/emitter/utils.ts"],"names":["assertValidNamespace","path","Array","isArray","EmitterError","forEach","part","assertValidName","name","test","context","value","createFullPath","concat","join","isPath","includes"],"mappings":";;;;;;AAkBO,SAASA,qBAAqBC,IAAc,EAAA;AACjD,EAAA,IAAI,CAACA,IAAQ,IAAA,CAACC,KAAMC,CAAAA,OAAAA,CAAQF,IAAAA,CAAO,EAAA;AACjC,IAAM,MAAA,IAAIG,wBAAa,6BAAA,CAAA;AACzB;AACAH,EAAAA,IAAAA,CAAKI,OAAQ,CAAA,CAACC,IAASC,KAAAA,eAAAA,CAAgBD,IAAAA,CAAAA,CAAAA;AACzC;AALgBN,MAAAA,CAAAA,oBAAAA,EAAAA,sBAAAA,CAAAA;AAOT,SAASO,gBAAgBC,IAAY,EAAA;AAC1C,EAAA,IAAI,CAACA,IAAQ,IAAA,CAAC,mBAAoBC,CAAAA,IAAAA,CAAKD,IAAAA,CAAO,EAAA;AAC5C,IAAA,MAAM,IAAIJ,uBAAAA,CACR,+FACA,EAAA,EACA,EAAA;MACEM,OAAS,EAAA;QAAEC,KAAOH,EAAAA;AAAK;KACzB,CAAA;AAEJ;AACF;AAVgBD,MAAAA,CAAAA,eAAAA,EAAAA,iBAAAA,CAAAA;AAYT,SAASK,cAAAA,CAAeX,MAAgBO,IAAY,EAAA;AACzD,EAAOA,OAAAA,IAAAA,GAAOP,IAAKY,CAAAA,MAAAA,CAAOL,IAAAA,CAAAA,CAAMM,KAAK,GAAA,CAAA,GAAOb,IAAKa,CAAAA,IAAAA,CAAK,GAAA,CAAA;AACxD;AAFgBF,MAAAA,CAAAA,cAAAA,EAAAA,gBAAAA,CAAAA;AAIT,SAASG,OAAOP,IAAY,EAAA;AACjC,EAAOA,OAAAA,IAAAA,CAAKQ,SAAS,GAAA,CAAA;AACvB;AAFgBD,MAAAA,CAAAA,MAAAA,EAAAA,QAAAA,CAAAA","file":"utils.cjs","sourcesContent":["/**\n * Copyright 2025 IBM Corp.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EmitterError } from \"@/emitter/errors.js\";\n\nexport function assertValidNamespace(path: string[]) {\n  if (!path || !Array.isArray(path)) {\n    throw new EmitterError(\"Event path cannot be empty!\");\n  }\n  path.forEach((part) => assertValidName(part));\n}\n\nexport function assertValidName(name: string) {\n  if (!name || !/(^[a-zA-Z0-9_]+$)/.test(name)) {\n    throw new EmitterError(\n      \"Event name or a namespace part must contain only letters, letters and optionally underscores.\",\n      [],\n      {\n        context: { value: name },\n      },\n    );\n  }\n}\n\nexport function createFullPath(path: string[], name: string) {\n  return name ? path.concat(name).join(\".\") : path.join(\".\");\n}\n\nexport function isPath(name: string) {\n  return name.includes(\".\");\n}\n"]}