Skip to content

Commit

Permalink
chore(examples): replace deprecated faker.datatype.number
Browse files Browse the repository at this point in the history
  • Loading branch information
piecyk committed Aug 20, 2024
1 parent 3b8a51f commit ce1ba17
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion examples/angular/dynamic/src/app/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { faker } from '@faker-js/faker'

export const generateRandomNumber = (min: number, max: number) =>
faker.datatype.number({ min, max })
faker.number.int({ min, max })

// 1000 because 10000 takes many seconds
export const sentences = new Array(1000)
Expand Down
6 changes: 3 additions & 3 deletions examples/angular/table/src/app/make-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const newPerson = (index: number): Person => {
id: index + 1,
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
age: faker.datatype.number(40),
visits: faker.datatype.number(1000),
progress: faker.datatype.number(100),
age: faker.number.int(40),
visits: faker.number.int(1000),
progress: faker.number.int(100),
createdAt: faker.datatype.datetime({ max: new Date().getTime() }),
status: faker.helpers.shuffle<Person['status']>([
'relationship',
Expand Down
2 changes: 1 addition & 1 deletion examples/lit/dynamic/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Column {
}

function randomNumber(min: number, max: number) {
return faker.datatype.number({ min, max })
return faker.number.int({ min, max })
}

const sentences = new Array(10000)
Expand Down
2 changes: 1 addition & 1 deletion examples/lit/fixed/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Column {
}

function randomNumber(min: number, max: number) {
return faker.datatype.number({ min, max })
return faker.number.int({ min, max })
}

const sentences = new Array(10000)
Expand Down
2 changes: 1 addition & 1 deletion examples/react/dynamic/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useVirtualizer, useWindowVirtualizer } from '@tanstack/react-virtual'
import './index.css'

const randomNumber = (min: number, max: number) =>
faker.datatype.number({ min, max })
faker.number.int({ min, max })

const sentences = new Array(10000)
.fill(true)
Expand Down
6 changes: 3 additions & 3 deletions examples/react/table/src/makeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const newPerson = (index: number): Person => {
id: index + 1,
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
age: faker.datatype.number(40),
visits: faker.datatype.number(1000),
progress: faker.datatype.number(100),
age: faker.number.int(40),
visits: faker.number.int(1000),
progress: faker.number.int(100),
createdAt: faker.datatype.datetime({ max: new Date().getTime() }),
status: faker.helpers.shuffle<Person['status']>([
'relationship',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
let virtualItemEls: HTMLDivElement[] = []
function randomNumber(min: number, max: number) {
return faker.datatype.number({ min, max })
return faker.number.int({ min, max })
}
const sentences = new Array(10000)
Expand Down
2 changes: 1 addition & 1 deletion examples/svelte/dynamic/src/RowVirtualizerDynamic.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
let virtualItemEls: HTMLDivElement[] = []
function randomNumber(min: number, max: number) {
return faker.datatype.number({ min, max })
return faker.number.int({ min, max })
}
const sentences = new Array(10000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
let virtualItemEls: HTMLDivElement[] = []
function randomNumber(min: number, max: number) {
return faker.datatype.number({ min, max })
return faker.number.int({ min, max })
}
const sentences = new Array(10000)
Expand Down
6 changes: 3 additions & 3 deletions examples/svelte/table/src/makeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const newPerson = (index: number): Person => {
id: index + 1,
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
age: faker.datatype.number(40),
visits: faker.datatype.number(1000),
progress: faker.datatype.number(100),
age: faker.number.int(40),
visits: faker.number.int(1000),
progress: faker.number.int(100),
createdAt: faker.datatype.datetime({ max: new Date().getTime() }),
status: faker.helpers.shuffle<Person['status']>([
'relationship',
Expand Down
2 changes: 1 addition & 1 deletion examples/vue/dynamic/src/components/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface Column {
}

export const generateRandomNumber = (min: number, max: number) =>
faker.datatype.number({ min, max })
faker.number.int({ min, max })

export const generateSentences = () =>
new Array(10000)
Expand Down
6 changes: 3 additions & 3 deletions examples/vue/table/src/makeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const newPerson = (index: number): Person => {
id: index + 1,
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
age: faker.datatype.number(40),
visits: faker.datatype.number(1000),
progress: faker.datatype.number(100),
age: faker.number.int(40),
visits: faker.number.int(1000),
progress: faker.number.int(100),
createdAt: faker.datatype.datetime({ max: new Date().getTime() }),
status: faker.helpers.shuffle<Person['status']>([
'relationship',
Expand Down

0 comments on commit ce1ba17

Please sign in to comment.