Socket
Socket
Sign inDemoInstall

gulp-json-validator

Package Overview
Dependencies
58
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.3 to 1.0.4

2

package.json
{
"name": "gulp-json-validator",
"version": "1.0.3",
"version": "1.0.4",
"description": "A json validator that has an option to check for duplicated keys",

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

@@ -10,5 +10,5 @@ # gulp-json-validator [![Build Status](https://travis-ci.org/jackyjieliu/gulp-json-validator.svg?branch=master)](https://travis-ci.org/jackyjieliu/gulp-json-validator)

var gulpJsonValidator = require('gulp-json-validator');
gulp.task('test', function() {
return gulp.src('./test/fixture/duplicated-key.json')
.pipe(gulpJsonValidator({ allowDuplicatedKeys: true }))
gulp.task('default', function() {
return gulp.src('./**/*.json')
.pipe(gulpJsonValidator({ allowDuplicatedKeys: false }))
});

@@ -15,0 +15,0 @@ ```

@@ -78,3 +78,3 @@ var gutil = require('gulp-util');

var content = fs.readFileSync('./test/fixture/duplicated-key.json', 'utf8') ;
var errMessage = 'Syntax error: duplicated key: a near "a": 345\n}';
var errMessage = 'Syntax error: duplicated keys "a" near "a": 345\n}';
expect(validator.validate(content, true)).to.equal(undefined);

@@ -81,0 +81,0 @@ expect(validator.validate(content, false)).to.equal(errMessage);

@@ -228,3 +228,3 @@ var backslash = require('backslash');

if(obj[key.value] !== undefined) {
throw _syntaxError(str, key.end, 'duplicated key: ' + key.value);
throw _syntaxError(str, key.end, 'duplicated keys "' + key.value + '"');
}

@@ -231,0 +231,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc