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

bly

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bly - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

24

lib/app.js

@@ -176,10 +176,16 @@ var invariant = require('./invariant');

invariant(!!plugin.register ^ !!plugin.plugin, "Either 'plugin' or 'register' is required, cannot include both %s", hint);
invariant(
_.isFunction(plugin.register) ||
(plugin.plugin && _.isFunction(plugin.plugin.register)),
"Plugin register must be a function or a required plugin module %s", hint);
invariant(plugin.pluginName || plugin.name || (plugin.plugin && plugin.plugin.name), 'Plugin needs a name %s', hint);
var register = plugin.register || plugin.plugin.register;
var name = plugin.pluginName || plugin.name || plugin.plugin.name;
var pluginOptions;
var pluginMultiple;
if (plugin.plugin) {
pluginOptions = plugin.options;
pluginMultiple = plugin.multiple;
plugin = plugin.plugin;
}
invariant(_.isFunction(plugin.register), "Plugin register must be a function or a required plugin module %s", hint);
invariant(plugin.pluginName || plugin.name, 'Plugin needs a name %s', hint);
var register = plugin.register;
var name = plugin.pluginName || plugin.name;

@@ -191,4 +197,4 @@ invariant(name, "Missing plugin name %s", hint);

name: name,
multiple: plugin.multiple || false,
options: plugin.options
multiple: plugin.multiple || pluginMultiple || false,
options: pluginOptions
};

@@ -195,0 +201,0 @@ });

{
"name": "bly",
"version": "1.0.0",
"version": "1.0.1",
"description": "Flux app framework with hapi like interface",

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

@@ -80,3 +80,3 @@ var test = require('tape');

test('App#register - passing options to plugin register function', function(t) {
t.plan(2);
t.plan(3);

@@ -106,2 +106,13 @@ var app = new App();

}, "Can register with object containing plugin definition and options");
t.doesNotThrow(function() {
var fnPlugin = function() {};
fnPlugin.register = emptyRegisterFn;
fnPlugin.pluginName = 'acceptable-name';
app.register({
plugin: fnPlugin,
options: pluginOptions
}, emptyFn);
}, "When passing a function plugin the pluginName prop is required");
});

@@ -108,0 +119,0 @@

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