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

easy-app

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-app - npm Package Compare versions

Comparing version 1.0.0-alpha to 1.0.0-alpha.1

26

lib/app.js

@@ -26,2 +26,3 @@ const parseArguments = require('parse-fn-args')

if (name == 'evaluate') throw new Error("Name 'evaluate' is reserved")
if (name == 'namespace') throw new Error("Name 'namespace' is reserved")
if (name[0] == '_') throw new Error(`Bad name '${name}'. Names begining with underscore are reserved`)

@@ -75,3 +76,3 @@ if (name[name.length - 1] == '$') throw new Error(

app = ns
ns = ''
ns = null
}

@@ -99,2 +100,9 @@

if (def.ns) {
def.ns = add_namespace(ns, def.ns)
} else {
def.ns = ns
}
this.defs[add_namespace(ns, key)] = def

@@ -116,4 +124,12 @@ }

App.prototype.compile = function(main) {
let app = analyze(this.defs, main)
App.prototype._analyze = function(main, seeds) {
let defs = clone(this.defs)
let root = main + '$' // Some reserved name
defs[root] = {main, seeds: seeds || []}
return analyze(defs, root)
}
App.prototype.compile = function(main, seeds) {
let app = this._analyze(main, seeds)
let js = generate(app)

@@ -130,6 +146,6 @@ let fn = new Function('rt', 'defs', js)

App.prototype.printJS = function(main) {
let app = analyze(this.defs, main)
App.prototype.printJS = function(main, seeds) {
let app = this._analyze(main, seeds)
let js = generate(app)
console.log(js)
}

@@ -135,2 +135,4 @@

rhs = `rt.getEval(this, '${name}')`
} else if (dep == 'namespace') {
rhs = `this._ns_${name}`
} else if (def.lazy[dep]) {

@@ -199,2 +201,3 @@ rhs = `rt.getLazy(this, this._get_${dep})`

out.line(`_${level.name}.prototype._uses_${name} = defs.${name}.uses`)
out.line(`_${level.name}.prototype._ns_${name} = defs.${name}.ns || null`)
}

@@ -201,0 +204,0 @@

8

lib/objs.js

@@ -54,2 +54,3 @@ const forOwn = require('lodash.forown')

this.pre = opts.pre || []
this.ns = opts.ns

@@ -72,3 +73,3 @@ this.uses = (opts.uses || []).reduce(function(uses, name) {

Fn.prototype.forEachDependency = function(cb) {
let call_cb = unique(cb)
let call_cb = unique(cb, {evaluate: true, namespace: true})
forOwn(this.uses, (mapping, name) => call_cb(mapping))

@@ -80,6 +81,7 @@ this.pre.forEach(call_cb)

function unique(cb) {
function unique(cb, forbidden) {
forbidden = forbidden || {}
let seen = {}
return function(i) {
if (seen[i]) return
if (seen[i] || forbidden[i]) return
seen[i] = true

@@ -86,0 +88,0 @@ cb(i)

{
"name": "easy-app",
"version": "1.0.0-alpha",
"version": "1.0.0-alpha.1",
"description": "Powerful container for applications",

@@ -5,0 +5,0 @@ "author": "Eldar Gabdullin <eldargab@gmail.com>",

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