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

@exodus/module

Package Overview
Dependencies
Maintainers
86
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@exodus/module - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

7

package.json
{
"name": "@exodus/module",
"version": "1.1.0",
"version": "1.2.0",
"description": "Exodus base module implementation.",

@@ -30,3 +30,3 @@ "author": "diegomura <diegomuracciole@gmail.com>",

"@exodus/basic-utils": "^1.0.0",
"events": "^1.1.1",
"events": "^3.3.0",
"lodash": "^4.17.11",

@@ -36,5 +36,6 @@ "proxy-freeze": "^1.0.0"

"devDependencies": {
"eslint": "^8.33.0",
"jest": "^29.1.2"
},
"gitHead": "d293d2fc68887f11bd7a925cda043a2a01cc2899"
"gitHead": "1a38fcc193bcc0fda4fb13b6025bc61470f5306d"
}

@@ -1,5 +0,4 @@

import EventEmitter from 'events/' // '/' forces it to use the module from node_modules
import EventEmitter from 'events/'
import { bindAll, clone, functions } from 'lodash'
import { pick } from '@exodus/basic-utils'
import { bindAll, functions } from 'lodash'
import proxyFreeze from 'proxy-freeze'

@@ -12,5 +11,3 @@ import { InvalidModuleError } from './errors'

const dependencyInjectionFields = ['id', 'dependencies']
export default class ExodusModule extends EventEmitter {
class ExodusModule extends EventEmitter {
_name

@@ -44,21 +41,2 @@ _logger

const defineDependencyInjectionField = (target, field, value) =>
Object.defineProperty(target, field, {
writable: false,
value: Object.freeze(clone(value)),
})
export const exportModuleFactoryFromConstructor = (Clazz) => {
validateModule(Clazz)
const factory = (opts) => new Clazz(pick(opts, Clazz.dependencies))
const dependencyInjectionFieldValues = pick(Clazz, dependencyInjectionFields)
setDependencyInjectionFields(factory, dependencyInjectionFieldValues)
validateModule(factory)
return factory
}
// e.g. setDependencyInjectionFields(factory, { id, dependencies })
export const setDependencyInjectionFields = (factory, dependencyInjectionFieldValues) =>
dependencyInjectionFields.forEach((field) =>
defineDependencyInjectionField(factory, field, dependencyInjectionFieldValues[field])
)
export default ExodusModule
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