Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: unescape characters in regex + TODO since it is not required #410

Merged
merged 2 commits into from
Jul 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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