Skip to content

Commit 9a53e2c

Browse files
committed
style: 💄 run formatter
1 parent f26fcca commit 9a53e2c

3 files changed

Lines changed: 26 additions & 20 deletions

File tree

‎src/json-random/RandomJson.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {randomString, Token} from "./string";
1+
import {randomString, Token} from './string';
22

33
type JsonValue = unknown;
44

@@ -241,13 +241,13 @@ export class RandomJson {
241241
this.opts.nodeCount = 0;
242242
} else {
243243
this.root =
244-
this.opts.rootNode === 'object'
245-
? {}
246-
: this.opts.rootNode === 'array'
247-
? []
248-
: this.pickContainerType() === 'object'
249-
? {}
250-
: [];
244+
this.opts.rootNode === 'object'
245+
? {}
246+
: this.opts.rootNode === 'array'
247+
? []
248+
: this.pickContainerType() === 'object'
249+
? {}
250+
: [];
251251
this.containers.push(this.root as ContainerNode);
252252
}
253253
}

‎src/json-random/__tests__/RandomJson.spec.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,15 @@ test('random strings can be converted to UTF-8', () => {
122122
});
123123

124124
test('can specify string generation schema', () => {
125-
const str =RandomJson.generate({
125+
const str = RandomJson.generate({
126126
rootNode: 'string',
127-
strings: ['list', [
128-
['repeat', 2, 2, 'xx'],
129-
['pick', ['y']],
130-
]]
127+
strings: [
128+
'list',
129+
[
130+
['repeat', 2, 2, 'xx'],
131+
['pick', ['y']],
132+
],
133+
],
131134
});
132135
expect(str).toBe('xxxxy');
133136
});

‎src/json-random/__tests__/string.spec.ts‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,16 @@ describe('randomString', () => {
2323

2424
// test tlist token
2525
it('executes a list of tokens', () => {
26-
const token: Token = ['list', [
27-
['pick', ['monkey', 'dog', 'cat']],
28-
['pick', [' ']],
29-
['pick', ['ate', 'threw', 'picked']],
30-
['pick', [' ']],
31-
['pick', ['apple', 'banana', 'cherry']],
32-
]];
26+
const token: Token = [
27+
'list',
28+
[
29+
['pick', ['monkey', 'dog', 'cat']],
30+
['pick', [' ']],
31+
['pick', ['ate', 'threw', 'picked']],
32+
['pick', [' ']],
33+
['pick', ['apple', 'banana', 'cherry']],
34+
],
35+
];
3336
const result = randomString(token);
3437
expect(/monkey|dog|cat/.test(result)).toBe(true);
3538
expect(/ate|threw|picked/.test(result)).toBe(true);

0 commit comments

Comments
 (0)