New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@amory/core

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amory/core - npm Package Compare versions

Comparing version 2018.8.31-3 to 2018.8.31-4

47

index.js

@@ -8,2 +8,16 @@ #!/usr/bin/env node

const onError = (error) => {
switch (error.toString ()) {
case "Error: Invalid arguments to tap(options: Object, fn: function)":
console.error (`Export a "name" property from each plugin.\n`)
break
case "TypeError: Cannot destructure property `config` of 'undefined' or 'null'.":
console.error (`Add to "package.json":\n\n "amory": { "apis": [], "plugins": [] },\n`)
break
default:
console.error (error)
break
}
}
class AmoryCore {

@@ -26,8 +40,13 @@ constructor (options = {}) {

this.plugins,
async (plugin) =>
plugin[api] &&
this.hooks[api].tap (
plugin.name,
await plugin[api] ({ ... options, ... this }, plugin.options)
)
async (plugin) => {
try {
plugin[api] &&
this.hooks[api].tap (
plugin.name,
await plugin[api] ({ ... options, ... this }, plugin.options)
)
} catch (error) {
onError (error)
}
}
))

@@ -44,16 +63,6 @@ }

["markup", "script"].map ((stage) => {
const define = { stage }
return new AmoryCore ({ apis, define, plugins }).run ()
})
["markup", "script"].map ((stage) =>
new AmoryCore ({ apis, "define": { stage }, plugins }).run ())
} catch (error) {
switch (error.toString ()) {
case "TypeError: Cannot destructure property `config` of 'undefined' or 'null'.":
console.error (`Add configuration to "package.json":\n\n "amory": { "apis": [], "plugins": [] },\n`)
break
default:
console.error (error)
break
}
onError (error)
}

@@ -60,0 +69,0 @@ }

@@ -28,3 +28,3 @@ {

"repository": "https://github.com/ptb/amory/tree/master/core",
"version": "2018.8.31-3"
"version": "2018.8.31-4"
}
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