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

app-conf

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

app-conf - npm Package Compare versions

Comparing version 0.3.6 to 0.4.0

2

package.json
{
"name": "app-conf",
"version": "0.3.6",
"version": "0.4.0",
"description": "",

@@ -5,0 +5,0 @@ "keywords": [],

@@ -27,2 +27,3 @@ # app-conf [![Build Status](https://travis-ci.org/julien-f/nodejs-app-conf.png?branch=master)](https://travis-ci.org/julien-f/nodejs-app-conf)

- [js-yaml](https://www.npmjs.org/package/js-yaml): to support YAML files;
- [json5](https://www.npmjs.com/package/json5): to support advanced JSON files;
- [strip-json-comments](https://www.npmjs.org/package/strip-json-comments): to support comments in JSON files.

@@ -29,0 +30,0 @@

@@ -7,11 +7,18 @@ 'use strict'

var stripJsonComments
try {
stripJsonComments = require('strip-json-comments')
} catch (error) {
stripJsonComments = function identity (val) {
return val
}
}
var formatJson = JSON.stringify
var parseJson = (function () {
try {
return require('json5').parse
} catch (_) {}
try {
var stripJsonComments = require('strip-json-comments')
return function parseJson (json) {
return JSON.parse(stripJsonComments(json))
}
} catch (_) {}
return JSON.parse
})()
var UnknownFormatError = require('./unknown-format-error')

@@ -26,3 +33,3 @@

test: function (file) {
return (file.path && /\.json$/i.test(file.path))
return (file.path && /\.json5?$/i.test(file.path))
},

@@ -32,3 +39,3 @@

unserialize: function (file) {
return JSON.parse(stripJsonComments(String(file.content)))
return parseJson(String(file.content))
},

@@ -41,3 +48,3 @@

return JSON.stringify(value, null, indent)
return formatJson(value, null, indent)
}

@@ -44,0 +51,0 @@ }

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