Prefer camel case for module constants

This commit is contained in:
Franck Royer 2021-05-10 11:43:57 +10:00
parent cbe9559096
commit ace5f2776f
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 8 additions and 8 deletions

View File

@ -4,8 +4,8 @@ import { Reader } from 'protobufjs/minimal';
// Protecting the user from protobuf oddities // Protecting the user from protobuf oddities
import * as proto from '../proto/waku/v2/message'; import * as proto from '../proto/waku/v2/message';
export const DEFAULT_CONTENT_TOPIC = '/waku/2/default-content/proto'; export const DefaultContentTopic = '/waku/2/default-content/proto';
const DEFAULT_VERSION = 0; const DefaultVersion = 0;
export class WakuMessage { export class WakuMessage {
public constructor(public proto: proto.WakuMessage) {} public constructor(public proto: proto.WakuMessage) {}
@ -18,12 +18,12 @@ export class WakuMessage {
*/ */
static fromUtf8String( static fromUtf8String(
utf8: string, utf8: string,
contentTopic: string = DEFAULT_CONTENT_TOPIC contentTopic: string = DefaultContentTopic
): WakuMessage { ): WakuMessage {
const payload = Buffer.from(utf8, 'utf-8'); const payload = Buffer.from(utf8, 'utf-8');
return new WakuMessage({ return new WakuMessage({
payload, payload,
version: DEFAULT_VERSION, version: DefaultVersion,
contentTopic, contentTopic,
}); });
} }
@ -36,11 +36,11 @@ export class WakuMessage {
*/ */
static fromBytes( static fromBytes(
payload: Uint8Array, payload: Uint8Array,
contentTopic: string = DEFAULT_CONTENT_TOPIC contentTopic: string = DefaultContentTopic
): WakuMessage { ): WakuMessage {
return new WakuMessage({ return new WakuMessage({
payload, payload,
version: DEFAULT_VERSION, version: DefaultVersion,
contentTopic, contentTopic,
}); });
} }

View File

@ -2,14 +2,14 @@ import { Reader } from 'protobufjs/minimal';
import { v4 as uuid } from 'uuid'; import { v4 as uuid } from 'uuid';
import * as proto from '../../proto/waku/v2/store'; import * as proto from '../../proto/waku/v2/store';
import { DEFAULT_CONTENT_TOPIC } from '../waku_message'; import { DefaultContentTopic } from '../waku_message';
import { RelayDefaultTopic } from '../waku_relay'; import { RelayDefaultTopic } from '../waku_relay';
export class HistoryRPC { export class HistoryRPC {
public constructor(public proto: proto.HistoryRPC) {} public constructor(public proto: proto.HistoryRPC) {}
static createQuery( static createQuery(
contentTopics: string[] = [DEFAULT_CONTENT_TOPIC], contentTopics: string[] = [DefaultContentTopic],
cursor?: proto.Index, cursor?: proto.Index,
pubsubTopic: string = RelayDefaultTopic pubsubTopic: string = RelayDefaultTopic
): HistoryRPC { ): HistoryRPC {