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

ranma

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ranma - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

10

cmdify.js

@@ -175,3 +175,11 @@ var type = require('./type');

});
code = code.slice(0, defDeps.params.start)
code = (defDeps.array ? (code.slice(0, defDeps.array.start)
+ code.slice(defDeps.array.start, defDeps.array.end).replace(/(["']).+?\1/g, function(s) {
if(/^['"][^./]/.test(s)) {
s = s.charAt(0) + './' + s.slice(1);
}
return s;
})
+ code.slice(defDeps.array.end, defDeps.params.start)
) : code.slice(0, defDeps.params.start))
+ 'require, exports, module' + code.slice(defDeps.params.end, defDeps.fnbody)

@@ -178,0 +186,0 @@ + req

2

package.json
{
"name": "ranma",
"version": "0.0.9",
"version": "0.0.10",
"description": "A converter between CommonJS/AMD/CMD/other",

@@ -5,0 +5,0 @@ "maintainers": [

@@ -249,8 +249,8 @@ var ranma = require('../');

it('define factory in amd style', function() {
var res = ranma.cmdify('define(["a", "b"], function(a, b) {})');
expect(res).to.eql('define(["a", "b"], function(require, exports, module) {var a = require("./a");var b = require("./b");})');
var res = ranma.cmdify('define(["./a", "./b"], function(a, b) {})');
expect(res).to.eql('define(["./a", "./b"], function(require, exports, module) {var a = require("./a");var b = require("./b");})');
});
it('define deps not compact to params', function() {
var res = ranma.cmdify('~function(){define(["a", "b"], function f(a){})}()');
expect(res).to.eql('~function(){define(["a", "b"], function f(require, exports, module){var a = require("./a");})}()');
expect(res).to.eql('~function(){define(["./a", "./b"], function f(require, exports, module){var a = require("./a");})}()');
});

@@ -257,0 +257,0 @@ it('commonjs', function() {

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