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

@architect/data

Package Overview
Dependencies
Maintainers
7
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@architect/data - npm Package Compare versions

Comparing version 2.0.17 to 2.1.0

src/_get-tables.js

3

package.json
{
"name": "@architect/data",
"version": "2.0.17",
"version": "2.1.0",
"description": "Dynamically generate a DynamoDB data access layer from an .arc file",

@@ -13,2 +13,3 @@ "homepage": "https://github.com/arc-repos/arc-data",

"scripts": {
"t": "NODE_ENV=testing tape 'test/cloudformation-test.js' | tap-spec",
"test": "NODE_ENV=testing tape 'test/*-test.js' | tap-spec",

@@ -15,0 +16,0 @@ "lint": "eslint . --fix --ignore-pattern node_modules"

@@ -1,6 +0,7 @@

var _db = require('./db')
var _doc = require('./doc')
var pfy = require('./_promisify-object')
var env = process.env.NODE_ENV || 'testing'
var testing = env === 'testing' || env === 'staging'
let _db = require('./db')
let _doc = require('./doc')
let tables = require('./_get-tables')
let pfy = require('./_promisify-object')
let env = process.env.NODE_ENV || 'testing'
let testing = env === 'testing' || env === 'staging'

@@ -11,4 +12,2 @@ /**

module.exports = function _init(arc) {
// the app namespace
let app = arc.app[0]

@@ -19,11 +18,8 @@

// otherwise falls back to the appname-tablename-env convention
var _name = name=> `${app}-${testing? 'staging' : process.env.NODE_ENV}-${name}`
let _name = name=> `${app}-${testing? 'staging' : process.env.NODE_ENV}-${name}`
// list of all tables (if any) defined in .arc
let tables = arc.tables? arc.tables.slice(0).map(t=> _name(Object.keys(t)[0])) : []
// create a map of data access methods for each table
var data = tables.map(TableName=> ({
let data = tables(arc).map(TableName=> ({
delete(key, callback) {
var params = {}
let params = {}
params.TableName = TableName

@@ -34,3 +30,3 @@ params.Key = key

get(key, callback) {
var params = {}
let params = {}
params.TableName = TableName

@@ -44,3 +40,3 @@ params.Key = key

put(item, callback) {
var params = {}
let params = {}
params.TableName = TableName

@@ -68,3 +64,3 @@ params.Item = item

// builds out a data layer object
var layer = {}
let layer = {}

@@ -71,0 +67,0 @@ // add _name, _db and _doc helper shortcuts

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