mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
polyfill fetch globals on nodeapi
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import { Utils } from '../misc/utils';
|
||||
import * as fe from 'node-fetch';
|
||||
|
||||
import { ApiService } from './api.service';
|
||||
|
||||
import { PlatformUtilsService } from '../abstractions/platformUtils.service';
|
||||
import { TokenService } from '../abstractions/token.service';
|
||||
|
||||
import * as fetch from 'node-fetch';
|
||||
(global as any).fetch = fe.default;
|
||||
(global as any).Request = fe.Request;
|
||||
(global as any).Response = fe.Response;
|
||||
(global as any).Headers = fe.Headers;
|
||||
|
||||
export class NodeApiService extends ApiService {
|
||||
constructor(tokenService: TokenService, platformUtilsService: PlatformUtilsService,
|
||||
|
||||
Reference in New Issue
Block a user