Skip to content

Commit f9c5fa8

Browse files
committed
chore: remove typescript sugar from constructors
1 parent 6f77434 commit f9c5fa8

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/utils/PgLiteral.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,19 @@ export class PgLiteral {
2121
*/
2222
public readonly literal = true;
2323

24+
/**
25+
* Value of the literal.
26+
*/
27+
public readonly value: string;
28+
2429
/**
2530
* Creates a new `PgLiteral` instance.
2631
*
2732
* @param value The string value.
2833
*/
29-
constructor(public readonly value: string) {}
34+
constructor(value: string) {
35+
this.value = value;
36+
}
3037

3138
/**
3239
* Returns the string value.

src/utils/StringIdGenerator.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
// credits to https://stackoverflow.com/a/12504061/4790644
44
export class StringIdGenerator {
5+
private readonly chars: string;
6+
57
private ids: number[] = [0];
68

7-
constructor(private readonly chars = 'abcdefghijklmnopqrstuvwxyz') {}
9+
constructor(chars = 'abcdefghijklmnopqrstuvwxyz') {
10+
this.chars = chars;
11+
}
812

913
next(): string {
1014
const idsChars = this.ids.map((id) => this.chars[id]);

0 commit comments

Comments
 (0)