= P extends Builtin
function longToNumber(long: Long): number {
if (long.gt(Number.MAX_SAFE_INTEGER)) {
- throw new globalThis.Error('Value is larger than Number.MAX_SAFE_INTEGER');
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
}
return long.toNumber();
}
diff --git a/examples/web-chat/src/setupTests.ts b/examples/web-chat/src/setupTests.ts
index 8f2609b7b3..1dd407a63e 100644
--- a/examples/web-chat/src/setupTests.ts
+++ b/examples/web-chat/src/setupTests.ts
@@ -2,4 +2,4 @@
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
-import '@testing-library/jest-dom';
+import "@testing-library/jest-dom";
diff --git a/examples/web-chat/src/types/types.d.ts b/examples/web-chat/src/types/types.d.ts
index 869f21a7f3..6109448386 100644
--- a/examples/web-chat/src/types/types.d.ts
+++ b/examples/web-chat/src/types/types.d.ts
@@ -1 +1 @@
-declare module '@livechat/ui-kit';
+declare module "@livechat/ui-kit";
diff --git a/karma-live-data.conf.js b/karma-live-data.conf.js
index 4d2d777bac..114ee6ff7b 100644
--- a/karma-live-data.conf.js
+++ b/karma-live-data.conf.js
@@ -1,6 +1,6 @@
// import settings from default config file
let properties = null;
-const originalConfigFn = require('./karma.conf.js');
+const originalConfigFn = require("./karma.conf.js");
originalConfigFn({
set: function (arg) {
properties = arg;
@@ -8,7 +8,7 @@ originalConfigFn({
});
// pass `--grep '[live data]'` to mocha to only run live data tests
-properties.client.args = ['--grep', '[live data]]'];
+properties.client.args = ["--grep", "[live data]]"];
// export settings
module.exports = function (config) {
diff --git a/karma.conf.js b/karma.conf.js
index 865f28f330..2c2de03117 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -1,21 +1,21 @@
-process.env.CHROME_BIN = require('puppeteer').executablePath();
+process.env.CHROME_BIN = require("puppeteer").executablePath();
module.exports = function (config) {
config.set({
- frameworks: ['mocha', 'karma-typescript'],
- files: ['src/lib/**/*.ts', 'src/proto/**/*.ts'],
+ frameworks: ["mocha", "karma-typescript"],
+ files: ["src/lib/**/*.ts", "src/proto/**/*.ts"],
preprocessors: {
- '**/*.ts': ['karma-typescript', 'env'],
+ "**/*.ts": ["karma-typescript", "env"],
},
- envPreprocessor: ['CI'],
+ envPreprocessor: ["CI"],
plugins: [
- require('karma-mocha'),
- require('karma-typescript'),
- require('karma-chrome-launcher'),
- require('karma-env-preprocessor'),
+ require("karma-mocha"),
+ require("karma-typescript"),
+ require("karma-chrome-launcher"),
+ require("karma-env-preprocessor"),
],
- reporters: ['progress', 'karma-typescript'],
- browsers: ['ChromeHeadless'],
+ reporters: ["progress", "karma-typescript"],
+ browsers: ["ChromeHeadless"],
singleRun: true,
client: {
mocha: {
@@ -29,17 +29,17 @@ module.exports = function (config) {
coverageOptions: {
instrumentation: false,
},
- tsconfig: './tsconfig.json',
+ tsconfig: "./tsconfig.json",
compilerOptions: {
noEmit: false,
},
include: {
- mode: 'replace',
- values: ['src/lib/**/*.ts', 'src/proto/**/*.ts'],
+ mode: "replace",
+ values: ["src/lib/**/*.ts", "src/proto/**/*.ts"],
},
exclude: {
- mode: 'replace',
- values: ['node_modules/**'],
+ mode: "replace",
+ values: ["node_modules/**"],
},
},
});
diff --git a/package.json b/package.json
index af284a215a..4ef416271e 100644
--- a/package.json
+++ b/package.json
@@ -140,9 +140,6 @@
"LICENSE",
"README.md"
],
- "prettier": {
- "singleQuote": true
- },
"nyc": {
"extends": "@istanbuljs/nyc-config-typescript",
"exclude": [
diff --git a/src/index.ts b/src/index.ts
index d3a72319e6..0938485c5c 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,33 +1,33 @@
-export { getNodesFromHostedJson } from './lib/discovery';
-export * as discovery from './lib/discovery';
+export { getNodesFromHostedJson } from "./lib/discovery";
+export * as discovery from "./lib/discovery";
-export * as enr from './lib/enr';
+export * as enr from "./lib/enr";
-export * as utils from './lib/utils';
+export * as utils from "./lib/utils";
-export * as waku from './lib/waku';
-export { Waku, DefaultPubSubTopic } from './lib/waku';
+export * as waku from "./lib/waku";
+export { Waku, DefaultPubSubTopic } from "./lib/waku";
-export * as waku_message from './lib/waku_message';
-export { WakuMessage } from './lib/waku_message';
+export * as waku_message from "./lib/waku_message";
+export { WakuMessage } from "./lib/waku_message";
export {
generatePrivateKey,
generateSymmetricKey,
getPublicKey,
-} from './lib/waku_message/version_1';
+} from "./lib/waku_message/version_1";
-export * as waku_light_push from './lib/waku_light_push';
+export * as waku_light_push from "./lib/waku_light_push";
export {
WakuLightPush,
LightPushCodec,
PushResponse,
-} from './lib/waku_light_push';
+} from "./lib/waku_light_push";
-export * as waku_relay from './lib/waku_relay';
-export { WakuRelay, RelayCodecs } from './lib/waku_relay';
+export * as waku_relay from "./lib/waku_relay";
+export { WakuRelay, RelayCodecs } from "./lib/waku_relay";
-export * as waku_store from './lib/waku_store';
-export { PageDirection, WakuStore, StoreCodec } from './lib/waku_store';
+export * as waku_store from "./lib/waku_store";
+export { PageDirection, WakuStore, StoreCodec } from "./lib/waku_store";
-export * as proto from './proto';
+export * as proto from "./proto";
diff --git a/src/lib/discovery/bootstrap.ts b/src/lib/discovery/bootstrap.ts
index f34b4eff8d..bc56cd14c9 100644
--- a/src/lib/discovery/bootstrap.ts
+++ b/src/lib/discovery/bootstrap.ts
@@ -1,11 +1,11 @@
-import debug from 'debug';
-import { Multiaddr } from 'multiaddr';
+import debug from "debug";
+import { Multiaddr } from "multiaddr";
-import { DnsNodeDiscovery } from './dns';
+import { DnsNodeDiscovery } from "./dns";
-import { getNodesFromHostedJson, getPseudoRandomSubset } from './index';
+import { getNodesFromHostedJson, getPseudoRandomSubset } from "./index";
-const dbg = debug('waku:discovery:bootstrap');
+const dbg = debug("waku:discovery:bootstrap");
/**
* Setup discovery method used to bootstrap.
@@ -55,7 +55,7 @@ export class Bootstrap {
const maxPeers = opts.maxPeers ?? Bootstrap.DefaultMaxPeers;
if (opts.default) {
- dbg('Use hosted list of peers.');
+ dbg("Use hosted list of peers.");
this.getBootstrapPeers = getNodesFromHostedJson.bind(
{},
@@ -69,13 +69,13 @@ export class Bootstrap {
);
const peers = getPseudoRandomSubset(allPeers, maxPeers);
dbg(
- 'Use provided list of peers (reduced to maxPeers)',
+ "Use provided list of peers (reduced to maxPeers)",
allPeers.map((ma) => ma.toString())
);
this.getBootstrapPeers = (): Promise = P extends Builtin
function longToNumber(long: Long): number {
if (long.gt(Number.MAX_SAFE_INTEGER)) {
- throw new globalThis.Error('Value is larger than Number.MAX_SAFE_INTEGER');
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
}
return long.toNumber();
}
diff --git a/src/test_utils/async_fs.ts b/src/test_utils/async_fs.ts
index fff62e3903..05eb5d07ed 100644
--- a/src/test_utils/async_fs.ts
+++ b/src/test_utils/async_fs.ts
@@ -5,10 +5,10 @@
* @module
*/
-import fs, { promises as asyncFs } from 'fs';
-import { promisify } from 'util';
+import fs, { promises as asyncFs } from "fs";
+import { promisify } from "util";
-import { delay } from '../lib/delay';
+import { delay } from "../lib/delay";
export const existsAsync = (filepath: string): Promise