@endo/evasive-transform
Source transforms for evading censorship in SES-enabled applications
This package provides a function which transforms comments contained in source code which would otherwise be rejected outright by SES.
Example
import { evadeCensor } from '@endo/evasive-transform';
import fs from 'node:fs/promises';
const source = await fs.readFile('./dist/index.js', 'utf8');
const sourceMap = await fs.readFile('./dist/index.js.map', 'utf8');
const sourceUrl = 'index.js';
const sourceType = 'script';
const { code, map } = await evadeCensor(source, {
sourceMap,
sourceUrl,
sourceType,
});
await fs.writeFile('./dist/index.ses.js', code);
await fs.writeFile('./dist/index.ses.js.map', JSON.stringify(map));
License
Apache-2.0