ditto/src/workers/policy.ts
2024-05-15 20:35:35 -05:00

21 lines
463 B
TypeScript

import * as Comlink from 'comlink';
import { Conf } from '@/config.ts';
import type { CustomPolicy } from '@/workers/policy.worker.ts';
export const policyWorker = Comlink.wrap<CustomPolicy>(
new Worker(
new URL('./policy.worker.ts', import.meta.url),
{
type: 'module',
deno: {
permissions: {
read: [Conf.policy],
write: false,
net: 'inherit',
env: false,
},
},
},
),
);