yaml-validator
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -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>`, |
14
index.js
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
208479
5463
Yes
9
8
217
+ Added@bcoe/v8-coverage@0.2.3(transitive)
+ Added@eslint-community/eslint-utils@4.4.0(transitive)
+ Added@eslint-community/regexpp@4.5.0(transitive)
+ Added@eslint/eslintrc@2.0.3(transitive)
+ Added@eslint/js@8.42.0(transitive)
+ Added@humanwhocodes/config-array@0.11.10(transitive)
+ Added@humanwhocodes/module-importer@1.0.1(transitive)
+ Added@humanwhocodes/object-schema@1.2.1(transitive)
+ Added@istanbuljs/schema@0.1.3(transitive)
+ Added@jridgewell/resolve-uri@3.1.0(transitive)
+ Added@jridgewell/sourcemap-codec@1.4.14(transitive)
+ Added@jridgewell/trace-mapping@0.3.17(transitive)
+ Added@nodelib/fs.scandir@2.1.5(transitive)
+ Added@nodelib/fs.stat@2.0.5(transitive)
+ Added@nodelib/fs.walk@1.2.8(transitive)
+ Added@sinonjs/commons@2.0.03.0.0(transitive)
+ Added@sinonjs/fake-timers@10.2.0(transitive)
+ Added@sinonjs/samsam@8.0.0(transitive)
+ Added@sinonjs/text-encoding@0.7.2(transitive)
+ Added@tootallnate/once@1.1.2(transitive)
+ Added@types/istanbul-lib-coverage@2.0.4(transitive)
+ Added@types/node@14.18.48(transitive)
+ Addedacorn@8.8.2(transitive)
+ Addedacorn-jsx@5.3.2(transitive)
+ Addedagent-base@6.0.2(transitive)
+ Addedajv@6.12.6(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedargparse@1.0.10(transitive)
+ Addedargv@0.0.2(transitive)
+ Addedarray.prototype.every@1.1.4(transitive)
+ Addedavailable-typed-arrays@1.0.5(transitive)
+ Addedbalanced-match@1.0.0(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedc8@7.14.0(transitive)
+ Addedcall-bind@1.0.2(transitive)
+ Addedcallsites@3.1.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcliui@7.0.4(transitive)
+ Addedcodecov@3.8.3(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconvert-source-map@1.7.0(transitive)
+ Addedcross-spawn@7.0.2(transitive)
+ Addeddebug@4.3.3(transitive)
+ Addeddeep-equal@2.2.0(transitive)
+ Addeddeep-is@0.1.3(transitive)
+ Addeddefine-properties@1.1.4(transitive)
+ Addeddefined@1.0.1(transitive)
+ Addeddiff@5.1.0(transitive)
+ Addeddoctrine@3.0.0(transitive)
+ Addeddotignore@0.1.2(transitive)
+ Addedes-abstract@1.21.1(transitive)
+ Addedes-get-iterator@1.1.2(transitive)
+ Addedes-set-tostringtag@2.0.1(transitive)
+ Addedes-to-primitive@1.2.1(transitive)
+ Addedescalade@3.1.1(transitive)
+ Addedescape-string-regexp@4.0.0(transitive)
+ Addedeslint@8.42.0(transitive)
+ Addedeslint-config-paazmaya@9.0.1(transitive)
+ Addedeslint-plugin-es@3.0.1(transitive)
+ Addedeslint-plugin-node@11.1.0(transitive)
+ Addedeslint-scope@7.2.0(transitive)
+ Addedeslint-utils@2.1.0(transitive)
+ Addedeslint-visitor-keys@1.3.03.4.1(transitive)
+ Addedespree@9.5.2(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedesquery@1.4.2(transitive)
+ Addedesrecurse@4.3.0(transitive)
+ Addedestraverse@5.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedfast-url-parser@1.1.3(transitive)
+ Addedfastq@1.13.0(transitive)
+ Addedfile-entry-cache@6.0.1(transitive)
+ Addedfind-up@5.0.0(transitive)
+ Addedflat-cache@3.0.4(transitive)
+ Addedflatted@3.2.5(transitive)
+ Addedfor-each@0.3.3(transitive)
+ Addedforeground-child@2.0.0(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfunction-bind@1.1.1(transitive)
+ Addedfunction.prototype.name@1.1.5(transitive)
+ Addedfunctions-have-names@1.2.3(transitive)
+ Addedget-caller-file@2.0.5(transitive)
+ Addedget-intrinsic@1.2.0(transitive)
+ Addedget-package-type@0.1.0(transitive)
+ Addedget-symbol-description@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedglob-parent@6.0.2(transitive)
+ Addedglobals@13.18.013.19.013.20.0(transitive)
+ Addedglobalthis@1.0.3(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedgraphemer@1.4.0(transitive)
+ Addedhas@1.0.3(transitive)
+ Addedhas-bigints@1.0.2(transitive)
+ Addedhas-dynamic-import@2.0.1(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedhas-property-descriptors@1.0.0(transitive)
+ Addedhas-proto@1.0.1(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhas-tostringtag@1.0.0(transitive)
+ Addedhtml-escaper@2.0.2(transitive)
+ Addedhttp-proxy-agent@4.0.1(transitive)
+ Addedhttps-proxy-agent@5.0.0(transitive)
+ Addedignore@5.2.0(transitive)
+ Addedignore-walk@3.0.4(transitive)
+ Addedimport-fresh@3.3.0(transitive)
+ Addedimurmurhash@0.1.4(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedinternal-slot@1.0.4(transitive)
+ Addedis-arguments@1.1.1(transitive)
+ Addedis-array-buffer@3.0.1(transitive)
+ Addedis-bigint@1.0.4(transitive)
+ Addedis-boolean-object@1.1.2(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-core-module@2.10.0(transitive)
+ Addedis-date-object@1.0.5(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-map@2.0.2(transitive)
+ Addedis-negative-zero@2.0.2(transitive)
+ Addedis-number-object@1.0.7(transitive)
+ Addedis-path-inside@3.0.3(transitive)
+ Addedis-regex@1.1.4(transitive)
+ Addedis-set@2.0.2(transitive)
+ Addedis-shared-array-buffer@1.0.2(transitive)
+ Addedis-string@1.0.7(transitive)
+ Addedis-symbol@1.0.4(transitive)
+ Addedis-typed-array@1.1.10(transitive)
+ Addedis-weakmap@2.0.1(transitive)
+ Addedis-weakref@1.0.2(transitive)
+ Addedis-weakset@2.0.2(transitive)
+ Addedisarray@0.0.12.0.5(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedistanbul-lib-coverage@3.2.0(transitive)
+ Addedistanbul-lib-report@3.0.0(transitive)
+ Addedistanbul-reports@3.1.5(transitive)
+ Addedjs-yaml@3.14.1(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stable-stringify-without-jsonify@1.0.1(transitive)
+ Addedjust-extend@4.2.1(transitive)
+ Addedlocate-path@6.0.0(transitive)
+ Addedlodash.get@4.4.2(transitive)
+ Addedlodash.merge@4.6.2(transitive)
+ Addedmake-dir@3.1.0(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminimist@1.2.7(transitive)
+ Addedms@2.1.2(transitive)
+ Addednatural-compare@1.4.0(transitive)
+ Addednise@5.1.4(transitive)
+ Addednode-fetch@2.6.7(transitive)
+ Addedobject-inspect@1.12.3(transitive)
+ Addedobject-is@1.1.5(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedobject.assign@4.1.4(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedoptionator@0.9.1(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedp-locate@5.0.0(transitive)
+ Addedparent-module@1.0.1(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-to-regexp@1.8.0(transitive)
+ Addedpunycode@1.4.12.1.1(transitive)
+ Addedqueue-microtask@1.2.3(transitive)
+ Addedregexp.prototype.flags@1.4.3(transitive)
+ Addedregexpp@3.2.0(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedresolve@1.19.02.0.0-next.4(transitive)
+ Addedresolve-from@4.0.0(transitive)
+ Addedresumer@0.0.0(transitive)
+ Addedreusify@1.0.4(transitive)
+ Addedrimraf@3.0.2(transitive)
+ Addedrun-parallel@1.2.0(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsafe-regex-test@1.0.0(transitive)
+ Addedsemver@6.3.0(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedside-channel@1.0.4(transitive)
+ Addedsignal-exit@3.0.2(transitive)
+ Addedsinon@15.1.0(transitive)
+ Addedsprintf-js@1.0.3(transitive)
+ Addedstream-events@1.0.5(transitive)
+ Addedstring-width@4.2.0(transitive)
+ Addedstring.prototype.trim@1.2.7(transitive)
+ Addedstring.prototype.trimend@1.0.6(transitive)
+ Addedstring.prototype.trimstart@1.0.6(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedstrip-json-comments@3.1.1(transitive)
+ Addedstubs@3.0.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedtape@5.6.3(transitive)
+ Addedteeny-request@7.1.1(transitive)
+ Addedtest-exclude@6.0.0(transitive)
+ Addedtext-table@0.2.0(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedtype-detect@4.0.8(transitive)
+ Addedtype-fest@0.20.2(transitive)
+ Addedtyped-array-length@1.0.4(transitive)
+ Addedtypescript@4.9.5(transitive)
+ Addedunbox-primitive@1.0.2(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedurlgrey@1.0.0(transitive)
+ Addedv8-to-istanbul@9.0.1(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwhich-boxed-primitive@1.0.2(transitive)
+ Addedwhich-collection@1.0.1(transitive)
+ Addedwhich-typed-array@1.1.9(transitive)
+ Addedword-wrap@1.2.3(transitive)
+ Addedwrap-ansi@7.0.0(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedy18n@5.0.8(transitive)
+ Addedyargs@16.2.0(transitive)
+ Addedyargs-parser@20.2.9(transitive)
+ Addedyocto-queue@0.1.0(transitive)
- Removeddeep-is@0.1.4(transitive)
- Removedoptionator@0.9.4(transitive)
- Removedword-wrap@1.2.5(transitive)
Updatedcheck-type@0.4.11
Updatedjs-yaml@4.1.0
Updatedoptionator@0.9.1