@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.
@@ -77,7 +77,8 @@ var readMdxFile = async (path4) => {
77
77
  return { ...frontmatter, markdown };
78
78
  };
79
79
  var searchFilesForId = async (files, id, version) => {
80
- const idRegex = new RegExp(`^id:\\s*(['"]|>-)?\\s*${id}['"]?\\s*$`, "m");
80
+ const escapedId = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
81
+ const idRegex = new RegExp(`^id:\\s*(['"]|>-)?\\s*${escapedId}['"]?\\s*$`, "m");
81
82
  const versionRegex = new RegExp(`^version:\\s*['"]?${version}['"]?\\s*$`, "m");
82
83
  const matches = files.map((file) => {
83
84
  const content = fsSync.readFileSync(file, "utf-8");
@@ -1458,7 +1459,7 @@ var getEventCatalogVersion = async (catalogDir) => {
1458
1459
  return "unknown";
1459
1460
  }
1460
1461
  };
1461
- var hydrateResource = async (catalogDir, resources, { attachSchema = false } = {}) => {
1462
+ var hydrateResource = async (catalogDir, resources = [], { attachSchema = false } = {}) => {
1462
1463
  return await Promise.all(
1463
1464
  resources.map(async (resource) => {
1464
1465
  const resourcePath = await getResourcePath(catalogDir, resource.id, resource.version);