Skip to content

Commit

Permalink
specific function names
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevitha011 committed Apr 24, 2024
1 parent 08c97d6 commit 683d878
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const cds = require('@sap/cds')

function _lazyRegisterCompileTargets() {
function _lazyRegisterCompileTarget() {
const value = require('./lib/compile/index')
Object.defineProperty(this, "asyncapi", { value })
return value
}

const registerCompileTargets = () => {
const registerAsyncapiCompileTarget = () => {
Object.defineProperty(cds.compile.to, "asyncapi", {
get: _lazyRegisterCompileTargets,
get: _lazyRegisterCompileTarget,
configurable: true
})
}


module.exports = { registerCompileTargets }
module.exports = { registerAsyncapiCompileTarget }
2 changes: 1 addition & 1 deletion test/lib/compile/asyncapiOptions.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const toAsyncAPI = require('../../../lib/compile');
require('../../../').registerCompileTargets();
require('../../../').registerAsyncapiCompileTarget();
const cds = require('@sap/cds');
const { readdir, read, path: { resolve } } = cds.utils;
const { join } = require('path');
Expand Down

0 comments on commit 683d878

Please sign in to comment.