fix(core): update

This commit is contained in:
Philipp Kunz 2021-08-24 11:40:44 +02:00
parent 97c57b2865
commit e5b072d99b
4 changed files with 14751 additions and 26 deletions

14749
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -55,4 +55,4 @@
"browserslist": [ "browserslist": [
"last 1 chrome versions" "last 1 chrome versions"
] ]
} }

View File

@ -2,7 +2,7 @@ import * as smartenv from '@pushrocks/smartenv';
const smartenvInstance = new smartenv.Smartenv(); const smartenvInstance = new smartenv.Smartenv();
// node native scope // node native scope
import type dnsType from 'dns'; import type dnsType from 'dns';
const dns: typeof dnsType = smartenvInstance.getSafeNodeModule('dns'); const dns: typeof dnsType = smartenvInstance.getSafeNodeModule('dns');
export { dns }; export { dns };
@ -21,6 +21,4 @@ export { tsclass };
const dns2 = smartenvInstance.getSafeNodeModule('dns2'); const dns2 = smartenvInstance.getSafeNodeModule('dns2');
export { export { dns2 };
dns2
}

View File

@ -2,6 +2,26 @@ import * as plugins from './dnsly.plugins';
export type TDnsProvider = 'google' | 'cloudflare'; export type TDnsProvider = 'google' | 'cloudflare';
export const makeNodeProcessUseDnsProvider = async (providerArg: TDnsProvider) => {
switch (providerArg) {
case 'cloudflare':
plugins.dns.setServers([
'1.1.1.1',
'1.0.0.1',
'[2606:4700:4700::1111]',
'[2606:4700:4700::1001]',
]);
break;
case 'google':
plugins.dns.setServers([
'8.8.8.8',
'8.8.4.4',
'[2001:4860:4860::8888]',
'[2606:4700:4700::1001]',
]);
}
};
export interface ISmartDnsConstructorOptions {} export interface ISmartDnsConstructorOptions {}
export interface IGoogleDNSHTTPSResponse { export interface IGoogleDNSHTTPSResponse {