Updates
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
'use strict'
|
||||
/**
|
||||
* CJS bridge: `require('bare-crypto/lib/key.js')` bypasses package `exports` on Node and avoids
|
||||
* pulling Bare-only addon graphs into ESM static analysis. Pear/Bare executes this file with CJS
|
||||
* `require` (no Node `module` built-in needed from our ESM entry).
|
||||
* CJS bridge for Pear/Bare + Node. `bare-crypto` does not export `./lib/key.js`; resolve it from
|
||||
* the package root via `bare-crypto/package` (the only `exports` entry that points at package.json).
|
||||
*/
|
||||
const path = require('path')
|
||||
const { verify } = require('bare-crypto')
|
||||
const { Ed25519PublicKey } = require('bare-crypto/lib/key.js')
|
||||
const pkgJson = require.resolve('bare-crypto/package')
|
||||
const keyModule = path.join(path.dirname(pkgJson), 'lib', 'key.js')
|
||||
const { Ed25519PublicKey } = require(keyModule)
|
||||
module.exports = { verify, Ed25519PublicKey }
|
||||
|
||||
Reference in New Issue
Block a user