patch-node-modules.js 526 B

12345678910111213
  1. const fs = require('fs');
  2. const path = require('path');
  3. const ssbRefPath = path.resolve(__dirname, '../src/server/node_modules/ssb-ref/index.js');
  4. if (fs.existsSync(ssbRefPath)) {
  5. const data = fs.readFileSync(ssbRefPath, 'utf8');
  6. const patchedData = data.replace('exports.parseAddress = deprecate(\'ssb-ref.parseAddress\', parseAddress)', 'exports.parseAddress = parseAddress');
  7. fs.writeFileSync(ssbRefPath, patchedData);
  8. console.log('[OASIS] [PATCH] Patched ssb-ref to remove deprecated usage of parseAddress');
  9. }