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

gengojs-core-modules

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gengojs-core-modules - npm Package Compare versions

Comparing version 2.1.2 to 2.2.0

tests/optify/fixtures/options.toml

19

CHANGELOG.md

@@ -0,1 +1,8 @@

2.1.2 / 2015-10-09
==================
* Release v2.1.2.
* Fix
Fixed the plugins issue again.
2.1.1 / 2015-10-08

@@ -147,12 +154,2 @@ ==================

Added travis.
Updated README.
1.0.0 / 2015-08-29
==================
* Update
Updated package.
* Update
Added files.
Added tests.
* Initial commit
Updated README.

@@ -6,2 +6,3 @@ import _ from 'lodash';

import debug from 'gengojs-debug';
import toml from 'toml';

@@ -49,6 +50,10 @@ const log = debug('core');

this.options = settings;
} else if (/\.toml/.test(options)) {
// Load toml
settings = toml.parse(fs.readFileSync(options, 'utf8'));
this.options = settings;
} else {
throw new Error
('Oops! Did you forgt to add the extension? \n' +
'The supported extensions are .json, .js, and .yaml.');
('Oops! Did you forget to add the extension? \n' +
'The supported extensions are .json, .js, .toml, and .yaml.');
}

@@ -55,0 +60,0 @@ } else this.options = settings || {};

{
"name": "gengojs-core-modules",
"version": "2.1.2",
"version": "2.2.0",
"description": "gengo.js core modules is a set of modules that helps the core to function properly.",

@@ -50,4 +50,5 @@ "main": "src/modules/index.js",

"js-yaml": "^3.4.0",
"lodash": "^3.10.1"
"lodash": "^3.10.1",
"toml": "^2.3.0"
}
}

@@ -31,2 +31,6 @@ 'use strict';

var _toml = require('toml');
var _toml2 = _interopRequireDefault(_toml);
var log = (0, _gengojsDebug2['default'])('core');

@@ -73,4 +77,8 @@ /*

this.options = settings;
} else if (/\.toml/.test(options)) {
// Load toml
settings = _toml2['default'].parse(_fs2['default'].readFileSync(options, 'utf8'));
this.options = settings;
} else {
throw new Error('Oops! Did you forgt to add the extension? \n' + 'The supported extensions are .json, .js, and .yaml.');
throw new Error('Oops! Did you forget to add the extension? \n' + 'The supported extensions are .json, .js, .toml, and .yaml.');
}

@@ -77,0 +85,0 @@ } else this.options = settings || {};

@@ -22,3 +22,3 @@ var assert = require('chai').assert;

describe("JSON", function() {
var options = optify(path.join(fixtures, 'options.js'));
var options = optify(path.join(fixtures, 'options.json'));
it("should return the test options from path", function(){

@@ -31,3 +31,3 @@ assert.isObject(options);

describe("YAML", function() {
var options = optify(path.join(fixtures, 'options.js'));
var options = optify(path.join(fixtures, 'options.yaml'));
it("should return the test options from path", function(){

@@ -38,2 +38,10 @@ assert.isObject(options);

});
describe("TOML", function() {
var options = optify(path.join(fixtures, 'options.toml'));
it("should return the test options from path", function(){
assert.isObject(options);
assert.deepEqual(options, {greet:true});
});
});
});

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