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

duh-core

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

duh-core - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

.github/workflows/nodejs.yml

16

lib/read-duh.js

@@ -7,2 +7,8 @@ 'use strict';

const fmt = {
error: {head: '\u001b[31;1m', tail: '\u001b[0m '},
warn: {head: '\u001b[33;1m', tail: '\u001b[0m '},
info: {head: '\u001b[32;1m', tail: '\u001b[0m '}
};
module.exports = argv => new Promise(resolve => {

@@ -16,3 +22,11 @@ if (argv.verbose) console.log('reading spec');

processContent: function (res, cb) {
let ml = JSON5.parse(res.text);
let ml;
try {
ml = JSON5.parse(res.text);
} catch(err) {
console.error(
fmt.error.head + 'Error' + fmt.error.tail + err.message + ' in ' + res.location
);
return;
}
cb(undefined, ml);

@@ -19,0 +33,0 @@ }

8

lib/validate-schema.js

@@ -16,3 +16,3 @@ 'use strict';

const hfmt = [
const headFormat = [
{head: '\u001b[4m', tail: '\u001b[0m '},

@@ -23,3 +23,3 @@ {head: '\u001b[4m', tail: '\u001b[0m '},

const bfmt = [
const bodyFormat = [
{head: '\u001b[33;1m', tail: '\u001b[0m '},

@@ -40,4 +40,4 @@ {head: '\u001b[34;1m', tail: '\u001b[0m '},

'DUH document does not match schema:',
['data path', 'schema path', 'message'].reduce(formatter(hfmt, widths), ''),
errora.map(row => row.reduce(formatter(bfmt, widths), '')).join('\n')
['data path', 'schema path', 'message'].reduce(formatter(headFormat, widths), ''),
errora.map(row => row.reduce(formatter(bodyFormat, widths), '')).join('\n')
].join('\n');

@@ -44,0 +44,0 @@ };

{
"name": "duh-core",
"version": "0.8.0",
"version": "0.8.1",
"description": "DUH core",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

[![NPM version](https://img.shields.io/npm/v/duh-core.svg)](https://www.npmjs.org/package/duh-core)
[![Travis build Status](https://travis-ci.org/sifive/duh-core.svg?branch=master)](https://travis-ci.org/sifive/duh-core)
[![Actions Status](https://github.com/sifive/duh-core/workflows/Tests/badge.svg)](https://github.com/sifive/duh-core/actions)

@@ -4,0 +4,0 @@ DUH core library

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