Skip to content

Commit

Permalink
fix(cli): update script arrow func syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
ysfscream authored and Red-Asuka committed May 18, 2023
1 parent 88e60ef commit 96dc501
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cli/src/scenarios/IEM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const calculateEnergyConsumption = (faker: Faker, maxPower: number) => {
const dataCache: Record<string, any> = {}
let factoryList: { id: string; name: string }[] = []

const generator = function (faker: Faker, options: SimulatePubOptions) {
const generator = (faker: Faker, options: SimulatePubOptions) => {
// Some fields will not change every time data is generated, so store them according to id
const { clientId, count } = options
// Initialize the factory list
Expand Down
2 changes: 1 addition & 1 deletion cli/src/scenarios/smart_home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const generateRoomData = (faker: Faker, roomType: string): RoomData | KitchenDat
return baseData
}

const generator = function (faker: Faker, options: SimulatePubOptions) {
const generator = (faker: Faker, options: SimulatePubOptions) => {
const { clientId } = options
if (!dataCache[clientId]) {
dataCache[clientId] = {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/scenarios/tesla.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Faker } from '@faker-js/faker'

const dataCache: Record<string, any> = {}

const generator = function (faker: Faker, options: SimulatePubOptions) {
const generator = (faker: Faker, options: SimulatePubOptions) => {
// Some fields will not change every time data is generated, so store them according to id
const { clientId } = options
if (!dataCache[clientId]) {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/scenarios/weather.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function getTimeOfDay() {
return 'Evening'
}

const generator = function (faker: Faker, options: SimulatePubOptions) {
const generator = (faker: Faker, options: SimulatePubOptions) => {
const { clientId } = options
if (!dataCache[clientId]) {
dataCache[clientId] = {
Expand Down
2 changes: 1 addition & 1 deletion scripts-example/IoT-data-scenarios/IEM.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const calculateEnergyConsumption = (faker, maxPower) => {
const dataCache = {}
let factoryList = []

const generator = function (faker, options) {
const generator = (faker, options) => {
// Some fields will not change every time data is generated, so store them according to id
const { clientId, count } = options
// Initialize the factory list
Expand Down
2 changes: 1 addition & 1 deletion scripts-example/IoT-data-scenarios/smart_home.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const generateRoomData = (faker, roomType) => {
return baseData
}

const generator = function (faker, options) {
const generator = (faker, options) => {
const { clientId } = options
if (!dataCache[clientId]) {
dataCache[clientId] = {
Expand Down
2 changes: 1 addition & 1 deletion scripts-example/IoT-data-scenarios/tesla.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

const dataCache = {}

const generator = function (faker, options) {
const generator = (faker, options) => {
// Some fields will not change every time data is generated, so store them according to id
const { clientId } = options
if (!dataCache[clientId]) {
Expand Down
4 changes: 2 additions & 2 deletions scripts-example/IoT-data-scenarios/weather.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function getTimeOfDay() {
return 'Evening'
}

const generator = function (faker, options) {
const generator = (faker, options) => {
const { clientId } = options
if (!dataCache[clientId]) {
dataCache[clientId] = {
Expand Down Expand Up @@ -125,4 +125,4 @@ const dataFormat = 'JSON'
const version = '0.0.1'
const description = "Simulation to generate advanced weather station's data."

module.export = { generator, name, author, dataFormat, version, description }
module.exports = { generator, name, author, dataFormat, version, description }

0 comments on commit 96dc501

Please sign in to comment.