File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import * as crypto from 'crypto'
22import { createECDH , hkdfSync } from 'crypto'
33import * as https from 'https'
4- import * as FormData from 'form-data'
4+ import * as FormDataModule from 'form-data'
55import NodeRSA from 'node-rsa'
66import * as WebSocket from 'faye-websocket'
77
@@ -13,6 +13,12 @@ import { normal64 } from '../utils'
1313import { logger } from '../log'
1414import type { KeeperHttpResponse } from '../commands'
1515
16+ // `form-data` uses CommonJS `export =`. Depending on the consumer/build target,
17+ // a namespace import may expose the constructor as either the module itself or
18+ // its `default` property.
19+ const FormData =
20+ ( FormDataModule as unknown as { default ?: typeof FormDataModule } ) . default || FormDataModule
21+
1622const base64ToBytes = ( data : string ) : Uint8Array => {
1723 return Buffer . from ( data , 'base64' )
1824}
You can’t perform that action at this time.
0 commit comments