Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

postgres-interval

Package Overview
Dependencies
0
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.1 to 4.0.2

39

index.js

@@ -160,30 +160,23 @@ 'use strict'

function parseMillisecond (interval) {
const previousPosition = position.value
const currentValue = readNextNum(interval)
const valueStringLength = position.value - previousPosition
if (currentValue < 10) {
return currentValue * 100
switch (valueStringLength) {
case 1:
return currentValue * 100
case 2:
return currentValue * 10
case 3:
return currentValue
case 4:
return currentValue / 10
case 5:
return currentValue / 100
case 6:
return currentValue / 1000
}
if (currentValue < 100) {
return currentValue * 10
}
if (currentValue < 1000) {
return currentValue
}
if (currentValue < 10000) {
return currentValue / 10
}
if (currentValue < 100000) {
return currentValue / 100
}
if (currentValue < 1000000) {
return currentValue / 1000
}
// slow path
const remainder = currentValue.toString().length - 3
const remainder = valueStringLength - 3
return currentValue / Math.pow(10, remainder)

@@ -190,0 +183,0 @@ }

{
"name": "postgres-interval",
"main": "index.js",
"version": "4.0.1",
"version": "4.0.2",
"description": "Parse Postgres interval columns",

@@ -6,0 +6,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc