Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stockshark-util

Package Overview
Dependencies
Maintainers
1
Versions
444
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stockshark-util - npm Package Compare versions

Comparing version 1.0.402 to 1.0.403

2

package.json
{
"name": "stockshark-util",
"version": "1.0.402",
"version": "1.0.403",
"description": "util",

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

@@ -0,41 +1,66 @@

const util = require("./util")
function getIndicatorKey({ live, instrument, indicatorName, interval, scaling }) {
const prefixLive = live ? "live" : "train"
const cacheKey = `Indicators/${prefixLive}/${instrument}/${indicatorName}-${interval}-${scaling}`
return cacheKey
const prefixLive = live ? "live" : "train"
const cacheKey = `Indicators/${prefixLive}/${instrument}/${indicatorName}-${interval}-${scaling}`
return cacheKey
}
function parseIndicatorKey(key) {
key = key.substring("Indicators/".length)
key = key.substring("Indicators/".length)
const parts1 = key.split("/")
const parts2 = parts1[2].split("-")
const parts1 = key.split("/")
const parts2 = parts1[2].split("-")
const live = parts1[0] === "live"
const instrument = parts1[1]
const live = parts1[0] === "live"
const instrument = parts1[1]
const indicatorName = parts2[0]
const interval = parts2[1]
const scaling = parts2[2]
return { live, instrument, indicatorName, interval, scaling }
const indicatorName = parts2[0]
const interval = parts2[1]
const scaling = parts2[2]
return { live, instrument, indicatorName, interval, scaling }
}
function getPredictorKey({ live, instrument, indicatorName, interval, scaling, modelId, num_of_loops }) {
modelId = util.replaceAll(modelId, "-", "")
const prefixLive = live ? "live" : "train"
const cacheKey = `Predictors/${prefixLive}/${instrument}/${indicatorName}-${interval}-${scaling}-${modelId}-${num_of_loops}`
return cacheKey
}
function parsePredictorKey(key) {
key = key.substring("Predictors/".length)
const parts1 = key.split("/")
const parts2 = parts1[2].split("-")
const live = parts1[0] === "live"
const instrument = parts1[1]
const indicatorName = parts2[0]
const interval = parts2[1]
const scaling = parts2[2]
const modelId = parts2[3]
const num_of_loops = parts2[4]
return { live, instrument, indicatorName, interval, scaling, modelId, num_of_loops }
}
function getSourceKey({ live, instrument, interval }) {
const prefixLive = live ? "live" : "train"
const cacheKey = `Sources/${prefixLive}/${instrument}/${interval}`
return cacheKey
const prefixLive = live ? "live" : "train"
const cacheKey = `Sources/${prefixLive}/${instrument}/${interval}`
return cacheKey
}
function getRegularizedSourceKey({ live, instrument, interval }) {
const prefixLive = live ? "live" : "train"
const cacheKey = `RegularizedSources/${prefixLive}/${instrument}/${interval}`
return cacheKey
const prefixLive = live ? "live" : "train"
const cacheKey = `RegularizedSources/${prefixLive}/${instrument}/${interval}`
return cacheKey
}
module.exports = {
getIndicatorKey,
parseIndicatorKey,
getSourceKey,
getRegularizedSourceKey
getIndicatorKey,
parseIndicatorKey,
getPredictorKey,
getSourceKey,
getRegularizedSourceKey,
}
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