Skip to content

Commit

Permalink
chore: unescape characters in regex + TODO since it is not required (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
smoya authored Jul 17, 2023
1 parent 6914a92 commit 5176b29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/bundler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ console.log(`Looking for binding version schemas in the following directory: ${b
console.log(`Using the following output directory: ${outputDirectory}`);

// definitionsRegex is used to transform the name of a definition into a valid one to be used in the -without-$id.json files.
const definitionsRegex = /http:\/\/asyncapi\.com\/definitions\/[^\/]*\/(.+)\.json\#?(.*)/i
const definitionsRegex = /http:\/\/asyncapi\.com\/definitions\/[^/]*\/(.+)\.json#?(.*)/i

// definitionsRegex is used to transform the name of a binding into a valid one to be used in the -without-$id.json files.
const bindingsRegex = /http:\/\/asyncapi\.com\/(bindings\/[^\/]+)\/([^\/]+)\/(.+)\.json(.*)/i
const bindingsRegex = /http:\/\/asyncapi\.com\/(bindings\/[^/]+)\/([^/]+)\/(.+)\.json(.*)/i

/**
* Function to load all the core AsyncAPI spec definition (except the root asyncapi schema, as that will be loaded later) into the bundler.
Expand Down Expand Up @@ -156,7 +156,7 @@ function getDefinitionName(def) {
if (result) return `${result[1].replace('/', '-')}-${result[2]}-${result[3]}`;
}

return path.basename(def, '.json') // TODO is this really needed?
return path.basename(def, '.json')
}

/**
Expand Down

0 comments on commit 5176b29

Please sign in to comment.