Skip to content

Commit

Permalink
update lint & types
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanrikulu committed Dec 18, 2023
1 parent f06a3e8 commit b1e3624
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 19 deletions.
6 changes: 3 additions & 3 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TextEncoder, TextDecoder } from 'util';
// import { TextEncoder, TextDecoder } from 'util';

global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder as any;
// global.TextEncoder = TextEncoder;
// global.TextDecoder = TextDecoder as any;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@ensdomains/ens-contracts": "^0.0.21",
"@types/chai": "^4.3.4",
"@types/chai-as-promised": "^7.1.5",
"@types/dns-packet": "^5.2.4",
"@types/dns-packet": "^5.6.4",
"@types/express": "^4.17.21",
"@types/supertest": "^2.0.11",
"bundlesize2": "^0.0.31",
Expand Down
12 changes: 8 additions & 4 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@ export function makeApp(
type: 'resolve',
func: async (args: ethers.utils.Result) => {
const [name, qtype] = args;
const decodedName = packet.name.decode(
const decodedName = (packet as any).name.decode(
Buffer.from(name.slice(2), 'hex')
);

if (trackEvent) {
trackEvent('resolve', {
props: { name: decodedName, qtype: qTypes.toString(qtype) },
}, true);
trackEvent(
'resolve',
{
props: { name: decodedName, qtype: qTypes.toString(qtype) },
},
true
);
}

const result = await prover.queryWithProof(
Expand Down
7 changes: 2 additions & 5 deletions src/utils/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,8 @@ export class Tracker {

const requestInfo = 'originalUrl' in req ? req : req.headers;

if (
requestInfo.get('Referrer')
) {
body.referrer = requestInfo.get('Referrer') ||
'';
if (requestInfo.get('Referrer')) {
body.referrer = requestInfo.get('Referrer') || '';
}

if (props) {
Expand Down
4 changes: 3 additions & 1 deletion src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ interface ENV {
DOH_GATEWAY_URL: string;
}

const tracker = new Tracker('ccip-read-dns-worker.ens-cf.workers.dev', { enableLogging: true });
const tracker = new Tracker('ccip-read-dns-worker.ens-cf.workers.dev', {
enableLogging: true,
});

const routeHandler = (env: ENV, trackEvent?: Function) => {
const { DOH_GATEWAY_URL } = env;
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"compilerOptions": {
"module": "esnext",
"lib": ["dom", "esnext"],
"types": ["@cloudflare/workers-types"],
"types": ["jest", "@cloudflare/workers-types"],
"importHelpers": true,
// output .d.ts declaration files for consumers
"declaration": true,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1888,10 +1888,10 @@
resolved "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz"
integrity sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==

"@types/dns-packet@^5.2.4":
version "5.2.4"
resolved "https://registry.yarnpkg.com/@types/dns-packet/-/dns-packet-5.2.4.tgz#0de4ee48f900a62b014ce61a3c9ab5d33dc06b0d"
integrity sha512-OAruArypdNxR/tzbmrtoyEuXeNTLaZCpO19BXaNC10T5ACIbvjmvhmV2RDEy2eLc3w8IjK7SY3cvUCcAW+sfoQ==
"@types/dns-packet@^5.6.4":
version "5.6.4"
resolved "https://registry.yarnpkg.com/@types/dns-packet/-/dns-packet-5.6.4.tgz#4467cea19002a135a73b0fbb6cb4a85ef216248a"
integrity sha512-R0ORTvCCeujG+upKfV4JlvozKLdQWlpsducXGd1L6ezBChwpjSj9K84F+KoMDsZQ9RhOLTR1hnNrwJHWagY24g==
dependencies:
"@types/node" "*"

Expand Down

0 comments on commit b1e3624

Please sign in to comment.