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

code-jinni

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code-jinni - npm Package Compare versions

Comparing version

to
2.0.0

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

## 2.0.0
* Changed the behavior of how duplicate imports are de-duped.
## 1.2.0

@@ -2,0 +5,0 @@ * Added use strict option

@@ -107,28 +107,7 @@ const Assert = require('assert');

let imp = new Import(name, this, mod);
const imp = new Import(name, this, mod);
// check if we have dup imports or var name conflicts
const existingImp = this.imports.find(im =>
String(im.reference) === String(imp.reference));
const existingImp = this.imports.find(im => String(im.reference) === String(imp.reference));
if (existingImp) {
if (existingImp.name === name) {
return existingImp;
}
// create a reference to the existing import
imp = new Proxy({
name
}, {
get(target, prop) {
if (typeof prop === 'string') {
return target.hasOwnProperty(prop) ? target[prop] : existingImp[prop];
}
return target[prop];
},
set(target, prop, value) {
if (typeof prop === 'string' && target.hasOwnProperty(prop)) {
target[prop] = value;
}
// change is not allowed for other properties
}
});
return existingImp;
}

@@ -135,0 +114,0 @@ // now check if we have var name cpnflict

{
"name": "code-jinni",
"version": "1.2.0",
"version": "2.0.0",
"description": "Generic javascript code generator that uses actual code snippets and mantains relationship ebtween artifacts to simplify DOM construction and eventual code generation",

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

code-jinni
==================
The module allow to create a simple way to onstruct dom of code snippets that can be rendered at the end into javascript code.
[![codecov](https://codecov.io/gh/dimichgh/code-jinni/branch/master/graph/badge.svg)](https://codecov.io/gh/dimichgh/code-jinni)
[![Build Status](https://travis-ci.org/dimichgh/code-jinni.svg?branch=master)](https://travis-ci.org/dimichgh/code-jinni) [![NPM](https://img.shields.io/npm/v/code-jinni.svg)](https://www.npmjs.com/package/code-jinni)
[![Downloads](https://img.shields.io/npm/dm/code-jinni.svg)](http://npm-stat.com/charts.html?package=code-jinni)
[![Known Vulnerabilities](https://snyk.io/test/github/dimichgh/code-jinni/badge.svg)](https://snyk.io/test/github/dimichgh/code-jinni)
[![Greenkeeper badge](https://badges.greenkeeper.io/dimichgh/code-jinni.svg)](https://greenkeeper.io/)
One way to use it is to create templates for code generation with dynamic elements that can be related to each other. This would allow, for example, by changing base for some modules, it will modify imports in the module that import the affected modules.
The module allows to create a simple way to construct dom of code snippets that can be rendered at the end into javascript code.
One way to use it is to create templates for code generation with dynamic elements that can be related to each other. This would allow, for example, by changing base for some modules, it will modify imports in the module that imports the affected modules.
## Install

@@ -9,0 +15,0 @@