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

cmacc-compiler

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmacc-compiler - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

test/parse/NpmImport.cmacc

4

package.json
{
"name": "cmacc-compiler",
"version": "1.0.8",
"version": "1.0.9",
"description": "Cmacc Compiler",

@@ -10,2 +10,4 @@ "main": "src/index.js",

"async": "^2.0.1",
"cmacc-lib-entity": "^1.0.0",
"find-root": "^1.0.0",
"marked": "^0.3.5",

@@ -12,0 +14,0 @@ "request": "^2.74.0",

var fs = require('fs');
var url = require('url');
var path = require('path');

@@ -29,4 +30,4 @@ var cash = {}

if(urlObj.protocol === 'file:'){
var path = decodeURI(urlObj.pathname);
return fs.readFileSync(path, 'utf8');
var location = decodeURI(urlObj.pathname);
return fs.readFileSync(location, 'utf8');
}

@@ -53,2 +54,10 @@

if(urlObj.protocol === 'npm:' || urlObj.protocol === 'yarn:'){
var findRoot = require('find-root');
var packageRoot = findRoot(process.cwd())
var nodeModules = path.join(packageRoot, 'node_modules')
var location = path.join(nodeModules, decodeURI(urlObj.host), decodeURI(urlObj.pathname));
return fs.readFileSync(location, 'utf8');
}
}

@@ -60,5 +69,4 @@

}
module.exports = fetch;

@@ -700,2 +700,34 @@ var assert = require('assert');

describe('Npm', function () {
describe('NpmImport.cmacc', function () {
it('should import from node_modules NpmImport.cmacc', function () {
var file = path.join(__dirname, 'parse', 'NpmImport.cmacc');
var result = parse('file://' + file);
assert.deepEqual(result, {
"$$file$$": "file:///Users/willemveelenturf/projects/commonaccord/cmacc-compiler/test/parse/NpmImport.cmacc",
"$$text$$": "{{npmImport}}",
"npmImport": {
"$$file$$": "npm://cmacc-lib-entity/gender/He.cmacc",
"He_She": {
"$$obj$$": result.npmImport,
"$$str$$": "He"
},
"His_Her": {
"$$obj$$": result.npmImport,
"$$str$$": "His"
},
"he_she": {
"$$obj$$": result.npmImport,
"$$str$$": "he"
},
"his_her": {
"$$obj$$": result.npmImport,
"$$str$$": "his"
}
}
})
});
});
});
});

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