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

apicase

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apicase - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

2

package.json
{
"name": "apicase",
"version": "0.1.2",
"version": "0.1.3",
"description": "Create, group and manage your APIs with json declaration",

@@ -5,0 +5,0 @@ "author": "kelin2025",

@@ -61,7 +61,7 @@ import pick from 'lodash/pick'

))
clone.config.mixins = mapValues({
...clone.container.mixins,
...clone.config.mixins,
...params.mixins || {}
}, Utils.normalizeMixin)
clone.config.mixins = mapValues(assign(
clone.container.mixins,
clone.config.mixins,
params.mixins || {}
), Utils.normalizeMixin)

@@ -85,11 +85,17 @@ let callback = async function callService (ctx, next) {

ctx.response = await fetch(url, options)
ctx.result = await ctx.response.json()
if (ctx.response.ok) {
ctx.result = await ctx.response.json()
} else {
throw new Error('Failed to fetch')
}
}
ctx.success = true
forEach(ctx.config.mixins, (mixin, name) => {
Object.defineProperty(ctx, name, {
...mapValues(pick(mixin), ['get', 'set'], mixin => mixin.bind(ctx)),
enumerable: true,
configurable: false
})
Object.defineProperty(ctx, name, assign(
{
enumerable: true,
configurable: false
},
mapValues(pick(mixin), ['get', 'set'], mixin => mixin.bind(ctx)),
))
})

@@ -96,0 +102,0 @@ next()

@@ -98,3 +98,3 @@ import has from 'lodash/has'

let url = `${ctx.container.base}${ctx.config.url}`
return pathToRegexp.compile((
return pathToRegexp.compile(
ctx.config.method === 'GET'

@@ -101,0 +101,0 @@ ? url + jsonToQueryString(data)

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