@eventcatalog/sdk 2.5.3 → 2.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -73,7 +73,8 @@ var readMdxFile = async (path4) => {
73
73
  return { ...frontmatter, markdown };
74
74
  };
75
75
  var searchFilesForId = async (files, id, version) => {
76
- const idRegex = new RegExp(`^id:\\s*(['"]|>-)?\\s*${id}['"]?\\s*$`, "m");
76
+ const escapedId = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
77
+ const idRegex = new RegExp(`^id:\\s*(['"]|>-)?\\s*${escapedId}['"]?\\s*$`, "m");
77
78
  const versionRegex = new RegExp(`^version:\\s*['"]?${version}['"]?\\s*$`, "m");
78
79
  const matches = files.map((file) => {
79
80
  const content = fsSync.readFileSync(file, "utf-8");
@@ -773,7 +774,7 @@ var getEventCatalogVersion = async (catalogDir) => {
773
774
  return "unknown";
774
775
  }
775
776
  };
776
- var hydrateResource = async (catalogDir, resources, { attachSchema = false } = {}) => {
777
+ var hydrateResource = async (catalogDir, resources = [], { attachSchema = false } = {}) => {
777
778
  return await Promise.all(
778
779
  resources.map(async (resource) => {
779
780
  const resourcePath = await getResourcePath(catalogDir, resource.id, resource.version);