Skip to content

Commit

Permalink
fix(indy-vdr): move require statements to module
Browse files Browse the repository at this point in the history
Signed-off-by: Karim Stekelenburg <karim@animo.id>
  • Loading branch information
karimStekelenburg committed Feb 13, 2023
1 parent 5e979ab commit c9ca998
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 11 additions & 0 deletions packages/indy-vdr/src/IndyVdrModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ export class IndyVdrModule implements Module {
}

public register(dependencyManager: DependencyManager) {
try {
// eslint-disable-next-line import/no-extraneous-dependencies
require('@hyperledger/indy-vdr-nodejs')
} catch (error) {
try {
require('@hyperledger/indy-vdr-react-native')
} catch (error) {
throw new Error('Error registering nodejs bindings for Indy VDR')
}
}

// Config
dependencyManager.registerInstance(IndyVdrModuleConfig, this.config)

Expand Down
8 changes: 0 additions & 8 deletions packages/indy-vdr/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
export { IndyVdrSovDidResolver } from './dids'

try {
// eslint-disable-next-line import/no-extraneous-dependencies
require('@hyperledger/indy-vdr-nodejs')
} catch (error) {
throw new Error('Error registering nodejs bindings for Indy VDR')
}

export * from './IndyVdrModule'
export * from './IndyVdrModuleConfig'
export * from './anoncreds'
Expand Down

0 comments on commit c9ca998

Please sign in to comment.