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

heroku-cli-addons

Package Overview
Dependencies
Maintainers
7
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heroku-cli-addons - npm Package Compare versions

Comparing version 1.1.7 to 1.1.8

2

commands/addons/upgrade.js

@@ -125,3 +125,3 @@ 'use strict'

args: [{name: 'addon'}, {name: 'plan', optional: true}],
run: cli.command(co.wrap(run))
run: cli.command({preauth: true}, co.wrap(run))
}

@@ -128,0 +128,0 @@

@@ -5,3 +5,3 @@ 'use strict'

exports.addon = memoize(function (heroku, app, id, headers) {
const addonResolver = function (heroku, app, id, headers) {
headers = headers || {}

@@ -15,4 +15,33 @@ let getAddon = function (id) {

.catch(function (err) { if (err.statusCode === 404) return getAddon(id); else throw err })
}, (_, app, id) => `${app}-${id}`)
}
/**
* Replacing memoize with our own memoization function that works with promises
* https://github.com/lodash/lodash/blob/da329eb776a15825c04ffea9fa75ae941ea524af/lodash.js#L10534
*/
const memoizePromise = function (func, resolver) {
var memoized = function () {
const args = arguments
const key = resolver.apply(this, args)
const cache = memoized.cache
if (cache.has(key)) {
return cache.get(key)
}
const result = func.apply(this, args)
result.then(function () {
memoized.cache = cache.set(key, result) || cache
return arguments
})
return result
}
memoized.cache = new memoize.Cache()
return memoized
}
exports.addon = memoizePromise(addonResolver, (_, app, id) => `${app}|${id}`)
exports.attachment = function (heroku, app, id, headers) {

@@ -19,0 +48,0 @@ headers = headers || {}

{
"name": "heroku-cli-addons",
"description": "`heroku addons:*` commands",
"version": "1.1.7",
"version": "1.1.8",
"author": "Bo Jeanes @bjeanes",

@@ -6,0 +6,0 @@ "bugs": {

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