Skip to content

Commit

Permalink
fix: Remove namespace from initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
jlacivita committed Aug 24, 2023
1 parent 2163738 commit 8305308
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions languages/javascript/src/shared/Transport/MockTransport.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ function send(message) {

let [module, method] = json.method.split('.')

if (!method) {
[method, module] = [module, method]
}

if (testHarness && testHarness.onSend) {
testHarness.onSend(module, method, json.params, json.id)
}
Expand Down
3 changes: 2 additions & 1 deletion languages/javascript/src/shared/Transport/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ export default class Transport {
}

_createRequestJSON (module, method, params) {
return { jsonrpc: '2.0', method: module.toLowerCase() + '.' + method, params: params, id: this._id }
const rpcMethod = module ? module.toLowerCase() + '.' + method : method
return { jsonrpc: '2.0', method: rpcMethod, params: params, id: this._id }
}

_addPromiseToQueue (module, method, params, transforms) {
Expand Down
2 changes: 1 addition & 1 deletion src/openrpc/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const run = async ({
json = addExternalMarkdown(json, markdown)

// put module name in front of each method
json.methods.forEach(method => method.name = json.info.title + '.' + method.name)
json.methods.forEach(method => json.info.title && (method.name = json.info.title + '.' + method.name))

// merge any info['x-'] extension values (maps & arrays only..)
Object.keys(json.info).filter(key => key.startsWith('x-')).forEach(extension => {
Expand Down

0 comments on commit 8305308

Please sign in to comment.