diff --git a/packages/input_secrets/src/input_secrets.ts b/packages/input_secrets/src/input_secrets.ts index a6fe9ae7d..d317ad9ea 100644 --- a/packages/input_secrets/src/input_secrets.ts +++ b/packages/input_secrets/src/input_secrets.ts @@ -1,7 +1,8 @@ -import ow from 'ow'; import { KeyObject } from 'crypto'; import { privateDecrypt, publicEncrypt } from '@apify/utilities'; +import { ow } from './ow'; + const BASE64_REGEXP = /[-A-Za-z0-9+/]*={0,3}/; const ENCRYPTED_INPUT_VALUE_PREFIX = 'ENCRYPTED_VALUE'; const ENCRYPTED_INPUT_VALUE_REGEXP = new RegExp(`^${ENCRYPTED_INPUT_VALUE_PREFIX}:(${BASE64_REGEXP.source}):(${BASE64_REGEXP.source})$`); diff --git a/packages/input_secrets/src/ow.ts b/packages/input_secrets/src/ow.ts new file mode 100644 index 000000000..63a8d72d8 --- /dev/null +++ b/packages/input_secrets/src/ow.ts @@ -0,0 +1,9 @@ +// This file is needed to solve ow's false representation of the package in older versions. + +// In CJS, to use ow, you need to call ow.default +// In ESM, you'd think `import ow from 'ow'` works, but it doesn't, because you need to import ow and use the default PROPERTY, not export. + +import type { Ow } from 'ow'; +import defOw = require('ow'); + +export const ow: Ow = defOw.default as Ow;