Skip to content

Commit

Permalink
Merge pull request #1184 from gettakaro/renovate/faker-js-faker-8.x
Browse files Browse the repository at this point in the history
fix(deps): update dependency @faker-js/faker to v8
  • Loading branch information
niekcandaele authored Aug 25, 2024
2 parents cb50f5b + f0db656 commit a8d667f
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 22 deletions.
19 changes: 13 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"@aws-sdk/client-lambda": "^3.583.0",
"@aws-sdk/client-s3": "^3.583.0",
"@discordjs/rest": "^1.7.1",
"@faker-js/faker": "^7.6.0",
"@faker-js/faker": "^8.0.0",
"@hookform/resolvers": "^3.3.4",
"@ory/client": "^1.1.21",
"@ory/elements": "^0.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function getMockPlayer(extra: Partial<IGamePlayer> = {}): Promise<I
const data: Partial<IGamePlayer> = {
gameId: '1',
name: 'mock-player',
steamId: faker.random.alphaNumeric(17),
steamId: faker.string.alphanumeric(17),
...extra,
};

Expand Down
20 changes: 10 additions & 10 deletions packages/app-mock-gameserver/src/lib/gameserver/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ export class MockGameserver implements IMockGameServer {
const players = Array.from(Array(5).keys()).map((p) => ({
gameId: p.toString(),
name: faker.internet.userName(),
epicOnlineServicesId: faker.random.alphaNumeric(16),
steamId: faker.random.alphaNumeric(16),
xboxLiveId: faker.random.alphaNumeric(16),
positionX: 500 - parseInt(faker.random.numeric(3), 10),
positionY: 500 - parseInt(faker.random.numeric(3), 10),
positionZ: 500 - parseInt(faker.random.numeric(3), 10),
epicOnlineServicesId: faker.string.alphanumeric(16),
steamId: faker.string.alphanumeric(16),
xboxLiveId: faker.string.alphanumeric(16),
positionX: 500 - faker.number.int({ max: 999 }),
positionY: 500 - faker.number.int({ max: 999 }),
positionZ: 500 - faker.number.int({ max: 999 }),
online: 'true',
}));

Expand All @@ -116,7 +116,7 @@ export class MockGameserver implements IMockGameServer {
name: player.name,
ip: player.ip,
steamId: player.steamId,
ping: parseInt(faker.random.numeric(2), 10),
ping: faker.number.int({ max: 99 }),
});
}

Expand All @@ -138,7 +138,7 @@ export class MockGameserver implements IMockGameServer {
name: player.name,
ip: player.ip,
steamId: player.steamId,
ping: parseInt(faker.random.numeric(2), 10),
ping: faker.number.int({ max: 99 }),
}),
),
);
Expand Down Expand Up @@ -347,11 +347,11 @@ export class MockGameserver implements IMockGameServer {
return [
new IItemDTO({
code: 'wood',
amount: parseInt(faker.random.numeric(2), 10),
amount: faker.number.int({ max: 99 }),
}),
new IItemDTO({
code: 'stone',
amount: parseInt(faker.random.numeric(2), 10),
amount: faker.number.int({ max: 99 }),
}),
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ interface PingData {
function generateData() {
const data: PingData[] = [];
for (let i = 0; i < 100; i++) {
const timestamp = faker.date.between('2021-01-01T00:00:00Z', '2021-01-31T23:59:59Z').toISOString();
const latency = faker.datatype.number({ min: 0, max: 70, precision: 1 });
const timestamp = faker.date.between({ from: '2021-01-01T00:00:00Z', to: '2021-01-31T23:59:59Z' }).toISOString();
const latency = faker.number.float({ min: 0, max: 70, precision: 1 });
data.push({ timestamp, latency });
}
data.sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime());
Expand Down
4 changes: 2 additions & 2 deletions packages/lib-components/src/helpers/makeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const range = (len: number) => {
const newPerson = () => {
const statusChance = Math.random();
return {
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
age: Math.floor(Math.random() * 30),
visits: Math.floor(Math.random() * 100),
progress: Math.floor(Math.random() * 100),
Expand Down

0 comments on commit a8d667f

Please sign in to comment.