*Update dist

This commit is contained in:
Derrick Hammer 2022-08-18 14:03:40 -04:00
parent aa3502bf71
commit 223da6b2f0
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
5 changed files with 26 additions and 3 deletions

2
dist/types.d.ts vendored
View File

@ -4,7 +4,7 @@ export interface ResolverOptions {
options?: any;
}
export interface DNSResult {
records: any[];
records: DNSRecord[];
error?: Error;
}
export interface DNSRecord {

2
dist/types.d.ts.map vendored
View File

@ -1 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AACD,QAAA,MAAM,eAAe;;;;;;;;;CASpB,CAAC;AAIF,OAAO,EAAE,eAAe,EAAE,CAAC"}
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AACD,QAAA,MAAM,eAAe;;;;;;;;;CASpB,CAAC;AAIF,OAAO,EAAE,eAAe,EAAE,CAAC"}

4
dist/util.d.ts vendored
View File

@ -1,5 +1,9 @@
import { DNSRecord, DNSResult } from "./types.js";
export declare function getTld(domain: string): string;
export declare function getSld(domain: string): string;
export declare function isIp(ip: string): boolean;
export declare function isDomain(domain: string): boolean;
export declare function resolverEmptyResponse(): DNSResult;
export declare function resolverError(e: Error | string): DNSResult;
export declare function resolveSuccess(records: DNSRecord[]): DNSResult;
//# sourceMappingURL=util.d.ts.map

2
dist/util.d.ts.map vendored
View File

@ -1 +1 @@
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAM7C;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAS7C;AAED,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,WAI9B;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,WAItC"}
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAElD,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAM7C;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAS7C;AAED,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,WAI9B;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,WAItC;AACD,wBAAgB,qBAAqB,IAAI,SAAS,CAIjD;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAQ1D;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,SAAS,CAI9D"}

19
dist/util.js vendored
View File

@ -19,3 +19,22 @@ export function isIp(ip) {
export function isDomain(domain) {
return /(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain);
}
export function resolverEmptyResponse() {
return {
records: [],
};
}
export function resolverError(e) {
if (!(e instanceof Error)) {
e = new Error(e);
}
return {
records: [],
error: e,
};
}
export function resolveSuccess(records) {
return {
records,
};
}