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

dynamodb-admin

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamodb-admin - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

__tests__/parseKey.js

10

index.js

@@ -6,3 +6,3 @@ const express = require('express')

const errorhandler = require('errorhandler')
const { serializeKey, unserializeKey } = require('./util')
const { serializeKey, parseKey } = require('./util')
const bodyParser = require('body-parser')

@@ -68,3 +68,3 @@

return Object.assign({}, item, {
__key: serializeKey(item, description.Table)
__key: serializeKey(item, description.Table.KeySchema)
})

@@ -99,3 +99,3 @@ })

TableName,
Key: unserializeKey(req.params.key, result.Table)
Key: parseKey(req.params.key, result.Table)
}

@@ -114,3 +114,3 @@

TableName,
Key: unserializeKey(req.params.key, result.Table)
Key: parseKey(req.params.key, result.Table)
}

@@ -141,3 +141,3 @@

TableName,
Key: unserializeKey(req.params.key, result.Table)
Key: parseKey(req.params.key, result.Table)
}

@@ -144,0 +144,0 @@ return getItem(params).then((response) => {

{
"name": "dynamodb-admin",
"version": "1.5.0",
"version": "1.6.0",
"description": "GUI for DynamoDB. Useful for local development.",
"main": "index.js",
"bin": "./bin/dynamodb-admin.js",
"engines": {
"node": "6.4.0",
"npm": "3.10.3"
},
"scripts": {
"test": "jest"
},
"repository": {

@@ -29,3 +36,6 @@ "type": "git",

"express": "^4.14.0"
},
"devDependencies": {
"jest-cli": "^15.0.2"
}
}

@@ -1,23 +0,17 @@

exports.serializeKey = function (item, table) {
if (table.KeySchema.length === 2) {
return {
[table.KeySchema[0].AttributeName]: item[table.KeySchema[0].AttributeName],
[table.KeySchema[1].AttributeName]: item[table.KeySchema[1].AttributeName]
}
}
return {
id: item.id
}
exports.serializeKey = function (item, KeySchema) {
return KeySchema.reduce((prev, current) => {
return Object.assign({}, prev, {
[current.AttributeName]: item[current.AttributeName]
})
}, {})
}
exports.unserializeKey = function (keys, table) {
if (table.KeySchema.length === 2) {
return {
[table.KeySchema[0].AttributeName]: keys.split(',')[0],
[table.KeySchema[1].AttributeName]: typecastKey(table.KeySchema[1].AttributeName, keys.split(',')[1], table)
}
}
return {
id: keys
}
exports.parseKey = function (keys, table) {
const splitKeys = keys.split(',')
return table.KeySchema.reduce((prev, current, index) => {
return Object.assign({}, prev, {
[current.AttributeName]: typecastKey(current.AttributeName, splitKeys[index], table)
})
}, {})
}

@@ -24,0 +18,0 @@

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