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

joi-md-doc

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

joi-md-doc - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "joi-md-doc",
"version": "0.0.1",
"version": "0.0.2",
"description": "",

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

@@ -10,6 +10,2 @@ const json2md = require('json2md');

const makeMarkdownWith = R.curry((path, schema) => {
const name = R.pipe(
ju.findMeta('name'),
ju.throwWhenNil('Required name meta tag not provided.'),
)(schema);
const filename = R.pipe(

@@ -19,2 +15,3 @@ ju.findMeta('filename'),

)(schema);
const name = R.pipe(ju.findMeta('name'), R.defaultTo(filename))(schema);
const nextPath = R.append({ name, filename }, path);

@@ -21,0 +18,0 @@

@@ -304,6 +304,6 @@ const joi = require('@hapi/joi');

it(`negative: should throw when no name meta tag`, () => {
it(`negative: should throw when no filename meta tag`, () => {
const joiSchema = {
describe: () => ({
metas: [{ filename: 'test' }],
metas: [{ name: 'Test' }],
}),

@@ -313,16 +313,17 @@ };

expect(() => makeMarkdownByFilename(joiSchema)).toThrowError(
'Required name meta tag not provided.',
'Required filename meta tag not provided.',
);
});
it(`negative: should throw when no filename meta tag`, () => {
it(`should default name to filename`, () => {
const joiSchema = {
describe: () => ({
metas: [{ name: 'Test' }],
metas: [{ filename: 'test' }],
keys: {
foo: { type: 'number' },
},
}),
};
expect(() => makeMarkdownByFilename(joiSchema)).toThrowError(
'Required filename meta tag not provided.',
);
expect(makeMarkdownByFilename(joiSchema)).toMatchSnapshot();
});

@@ -329,0 +330,0 @@ });

Sorry, the diff of this file is not supported yet

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