You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

postgres-array

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postgres-array - npm Package Compare versions

Comparing version

to
3.0.4

29

index.js

@@ -23,2 +23,10 @@ 'use strict'

return function parseArray (str) {
const rbraceIndex = str.length - 1
if (rbraceIndex === 1) {
return []
}
if (str[rbraceIndex] !== RBRACE) {
throw new Error('Invalid array text - must end with }')
}
// If starts with `[`, it is specifying the index boundas. Skip past first `=`.

@@ -33,6 +41,2 @@ let position = 0

}
const rbraceIndex = str.length - 1
if (str[rbraceIndex] !== RBRACE) {
throw new Error('Invalid array text - must end with }')
}
const output = []

@@ -43,4 +47,3 @@ let current = output

let currentStringStart = position
const currentStringParts = []
let hasStringParts = false
let currentString = ''
let expectValue = true

@@ -62,4 +65,3 @@

const part = str.slice(currentStringStart, position)
currentStringParts.push(part)
hasStringParts = true
currentString += part
currentStringStart = ++position

@@ -75,10 +77,5 @@ if (dquot === position++) {

const part = str.slice(currentStringStart, position)
if (hasStringParts) {
const final = currentStringParts.join('') + part
current.push(haveTransform ? transform(final) : final)
currentStringParts.length = 0
hasStringParts = false
} else {
current.push(haveTransform ? transform(part) : part)
}
currentString += part
current.push(haveTransform ? transform(currentString) : currentString)
currentString = ''
expectValue = false

@@ -85,0 +82,0 @@ } else if (char === LBRACE) {

{
"name": "postgres-array",
"main": "index.js",
"version": "3.0.3",
"version": "3.0.4",
"description": "Parse postgres array columns",

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