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

stumble-core

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stumble-core - npm Package Compare versions

Comparing version 0.0.1 to 1.0.0

lib/stack.js

53

lib/StumbleCore.js

@@ -7,2 +7,5 @@ 'use strict';

const stack = require('./stack');
const path = require('path');
module.exports = class StumbleCore extends EventEmitter {

@@ -22,5 +25,5 @@ constructor (opts) {

use (extension, pending) {
use (extension, pending, index) {
if (Array.isArray(extension))
extension.forEach(ext => this.use(ext, extension));
extension.forEach((ext, i) => this.use(ext, extension, i));
else {

@@ -35,10 +38,10 @@ if (!extension || !Object.keys(extension).length)

let missing = true;
let len = null;
let length = null;
if (pending && (len = pending.length)) {
for (let i = 0; i < len; i++) {
if (pending[i].handle === ext) {
if (pending && (length = pending.length))
for (let offset = index + 1 || 1; offset < length; offset++)
if (pending[offset].handle === ext) {
clearTimeout(this.__cachetimer);
this.use(pending[i], pending);
this.use(pending[offset], pending, offset);
this.__cache[ext] = true;

@@ -54,4 +57,2 @@

}
}
}

@@ -98,6 +99,7 @@ if (missing) throw new Error(`EXT: Missing required [ ${ext} ].`);

}
return this;
}
execute (handle, share, roll) {
execute (handle, data) {
const extension = this.extensions.get(handle);

@@ -107,11 +109,11 @@

if (extension.hooks) {
roll = extension.hooks.map(hook => this.execute(hook, share, roll));
}
const roll = extension.hooks ?
extension.hooks.map(hook => this.execute(hook, data)) : null;
return extension.exec.call(this, share, roll || null);
return extension.exec.call(this, data, roll);
}
define (command) {
if (Array.isArray(command)) command.forEach(cmd => this.define(cmd));
if (Array.isArray(command))
command.forEach(cmd => this.define(cmd));
else {

@@ -129,5 +131,3 @@ if (!command || !(command.handle && command.exec))

this.commands.set(handle, (
command instanceof Command ? command : new Command(command)
));
this.commands.set(handle, new Command(command));
}

@@ -140,3 +140,3 @@

if (!this.commands.has(handle))
throw new Error(`CMD: Attempted to invoke missing [ ${handle} ]`);
throw new Error(`CMD: Attempted to invoke missing [ ${handle} ].`);

@@ -146,2 +146,17 @@ const command = this.commands.get(handle);

}
static dequire (p) {
if (!path.isAbsolute(p)) {
const file = stack(2)[1].getFileName();
const dir = path.dirname(file);
p = path.resolve(dir, p);
}
const mod = require(p);
delete require.cache[require.resolve(p)];
return mod;
}
};
{
"name": "stumble-core",
"version": "0.0.1",
"description": "StumbleCore.",
"version": "1.0.0",
"description": "StumbleCore - extension loader.",
"main": "lib/StumbleCore",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"engines": {
"node": ">=5.0.0",
"npm": ">=3.0.0"
},

@@ -9,0 +10,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

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