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

@architect/inventory

Package Overview
Dependencies
Maintainers
4
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@architect/inventory - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

4

changelog.md

@@ -5,3 +5,3 @@ # Architect Inventory changelog

## [1.0.1 - 1.0.2] 2020-09-08
## [1.0.1 - 1.0.3] 2020-09-08

@@ -11,3 +11,3 @@ ### Fixed

- Fixed issue where projects without `get /` would return an error during Lambda source dir population
- Fixed inventory rules around @http + @static
- Fixed inventory rules around @http + @static inferring each other
- Fixed getter when accessing pragmas with null values

@@ -14,0 +14,0 @@

{
"name": "@architect/inventory",
"version": "1.0.2",
"version": "1.0.3",
"description": "Architect project resource enumeration utility",

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

let populate = require('./populate-lambda')
module.exports = function configureHTTP ({ arc, inventory }) {
if (!arc.http) return null
// @http get / is inferred by @static
if (!arc.http && !arc.static) return null

@@ -6,0 +7,0 @@ // Populate normally returns null on an empty Lambda pragma

module.exports = function configureStatic ({ arc }) {
// @static is inferred by @http
if (!arc.static && !arc.http) return null

@@ -3,0 +4,0 @@

module.exports = function _get (inventory) {
function getter (pragma, name) {
let isType = type => typeof inventory[pragma] === type
if (inventory[pragma] === null) return null
if (Array.isArray(inventory[pragma])) {
return inventory[pragma].find(i => {
function getter (prag, name) {
let pragma = inventory[prag]
let isType = type => typeof pragma === type
// Getters
if (pragma === null) return null
if (Array.isArray(pragma)) {
return pragma.find(i => {
// Handle arrays of named entities

@@ -14,6 +17,6 @@ if (i.name) return i.name === name

else if (isType('object')) {
return inventory[pragma][name]
return pragma[name]
}
else if (isType('string') && !name) {
return inventory[pragma]
return pragma
}

@@ -20,0 +23,0 @@ return undefined // jic

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