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

yaml-validator

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yaml-validator - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

23

bin/yaml-validator.js

@@ -11,22 +11,13 @@ #!/usr/bin/env node

const fs = require('fs'),
path = require('path');
import fs from 'fs';
import path from 'path';
const optionator = require('optionator');
import optionator from 'optionator';
const YamlValidator = require('../index');
import YamlValidator from '../index.js';
let pkg;
/* import pkg from '../package.json' assert { type: 'json' };*/
const packageFile = new URL('../package.json', import.meta.url);
const pkg = JSON.parse(fs.readFileSync(packageFile, 'utf8'));
try {
const packageJson = fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8');
pkg = JSON.parse(packageJson);
}
catch (error) {
console.error('Could not read/parse "package.json", quite strange...');
console.error(error);
process.exit(1);
}
const optsParser = optionator({

@@ -33,0 +24,0 @@ prepend: `${pkg.name} [options] <files>`,

@@ -9,9 +9,11 @@ /**

const fs = require('fs');
import fs from 'fs';
const yaml = require('js-yaml');
const check = require('check-type').init();
import yaml from 'js-yaml';
import checkType from 'check-type';
const FIND_LINENUMBER = /line (\d+)/u;
const check = checkType.init();
const FIND_LINENUMBER = /(\d+):\d+/u;
class YamlValidatore {

@@ -134,4 +136,4 @@ constructor (options) {

'unknown';
this.errored(`Failed to load the Yaml file "${filepath}:${lineNumber}"\n${error.message}`);
console.error(`${filepath}:${lineNumber}\n${error.message}`);
onWarning(`Failed to load the Yaml file "${filepath}:${lineNumber}"\n${error.message}`);

@@ -233,2 +235,2 @@ return null;

module.exports = YamlValidatore;
export default YamlValidatore;
{
"name": "yaml-validator",
"version": "4.0.0",
"version": "4.0.1",
"description": "Validate Yaml files and enforce a given structure",
"main": "index.js",
"type": "module",
"typings": "typings/index.d.ts",
"bin": "bin/yaml-validator.js",
"scripts": {
"test": "nyc --all --exclude tests --exclude typings tape tests/*_test.js",
"test": "c8 --exclude tests --exclude typings tape tests/*_test.js",
"test:typings": "tsc -p tsconfig.json",
"coverage": "nyc --all --exclude tests --exclude typings report --reporter=text-lcov > coverage.lcov && codecov",
"lint": "eslint index.js bin"
"coverage": "c8 --exclude tests --exclude typings report --reporter=text-lcov > coverage.lcov && codecov",
"lint": "eslint *.js bin tests"
},

@@ -36,16 +37,17 @@ "repository": {

"dependencies": {
"check-type": "^0.4.11",
"js-yaml": "^4.1.0",
"optionator": "^0.9.1"
"check-type": "0.4.11",
"js-yaml": "4.1.0",
"optionator": "0.9.1"
},
"devDependencies": {
"@types/node": "14.18.10",
"@types/node": "14.18.48",
"c8": "7.14.0",
"codecov": "3.8.3",
"eslint": "8.8.0",
"eslint-config-paazmaya": "7.2.0",
"eslint": "8.42.0",
"eslint-config-paazmaya": "9.0.1",
"eslint-plugin-node": "11.1.0",
"nyc": "15.1.0",
"tape": "5.5.0",
"typescript": "4.5.5"
"sinon": "15.1.0",
"tape": "5.6.3",
"typescript": "4.9.5"
}
}

@@ -5,6 +5,5 @@ # yaml-validator

[![Ubuntu Build Status](https://paazmaya.semaphoreci.com/badges/yaml-validator.svg)](https://paazmaya.semaphoreci.com/projects/yaml-validator)
[![Ubuntu Build Status](https://paazmaya.semaphoreci.com/badges/yaml-validator/branches/master.svg)](https://paazmaya.semaphoreci.com/projects/yaml-validator)
[![Windows build status](https://ci.appveyor.com/api/projects/status/rxt9kv7geq8vyny7/branch/master?svg=true)](https://ci.appveyor.com/project/paazmaya/yaml-validator)
[![code coverage](https://codecov.io/gh/paazmaya/yaml-validator/branch/master/graph/badge.svg)](https://codecov.io/gh/paazmaya/yaml-validator)
[![dependencies Status](https://david-dm.org/paazmaya/yaml-validator/status.svg)](https://david-dm.org/paazmaya/yaml-validator)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=paazmaya_yaml-validator&metric=code_smells)](https://sonarcloud.io/dashboard?id=paazmaya_yaml-validator)

@@ -11,0 +10,0 @@

Sorry, the diff of this file is too big to display

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