Socket
Socket
Sign inDemoInstall

@equitysim/trkd-client

Package Overview
Dependencies
Maintainers
5
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@equitysim/trkd-client - npm Package Compare versions

Comparing version 0.2.9 to 0.2.10

2

package.json
{
"name": "@equitysim/trkd-client",
"version": "0.2.9",
"version": "0.2.10",
"description": "REST Client for TRKD API",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -5,4 +5,6 @@ import timeseriesFields from './field-maps/timeseries-fields'

const result = []
let previousClose = 0;
for (const values of trkdResponse['R'] || []) {
let previousClose = 0
const length = trkdResponse['R'] && trkdResponse['R'].length || 0
for (let i = 0; i < length; i++) {
const values = trkdResponse['R'][i]
const fields = {}

@@ -19,4 +21,4 @@ for (const [key, value] of Object.entries(values)) {

}
fields.netChange = fields.close - previousClose
fields.percentChange = fields.close / previousClose - 1
fields.netChange = i == 0 ? 0 : fields.close - previousClose
fields.percentChange = i == 0 ? 0 : fields.close / previousClose - 1
previousClose = fields.close

@@ -33,3 +35,3 @@ result.push(fields)

timezone: data['Timezone'],
tradingDays: data['TradingWeek']['TradingDay'].map(day => {
tradingDays: data['TradingWeek']['TradingDay'].map((day) => {
const values = day['Session'][0]

@@ -40,5 +42,5 @@ return {

endDay: values['EndDay'],
endTime: values['EndTime']
endTime: values['EndTime'],
}
})
}),
}

@@ -51,3 +53,3 @@ return result

const today = new Date();
const today = new Date()
function formatOffset(offset) {

@@ -72,3 +74,3 @@ const hours = Math.floor(offset / 60)

return data.map(zone => {
return data.map((zone) => {
const isSummer = zone['HasSummerTime'] && new Date(zone['SummerStart']) < today && new Date(zone['SummerEnd']) > today

@@ -79,5 +81,5 @@ const offset = formatOffset(isSummer ? zone['SummerOffset'] : zone['GMTOffset'])

name: zone['LongName'],
offset: offset
offset: offset,
}
})
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc