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

bootprint-json-schema

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bootprint-json-schema - npm Package Compare versions

Comparing version 0.8.4 to 0.8.5

CHANGELOG.md~

13

CHANGELOG.md
# Release notes
# Fix
<a name="current-release"></a>
# Version 0.8.5 (Tue, 15 Mar 2016 14:27:33 GMT)
* [40ca080](https://github.com/bootprint/bootprint-json-schema/commit/40ca080) Generate README with "thought" - Nils Knappmeier
* [2222c27](https://github.com/bootprint/bootprint-json-schema/commit/2222c27) Add "require" to main-spec in order to get (low) coverage - Nils Knappmeier
* [2cfccb8](https://github.com/bootprint/bootprint-json-schema/commit/2cfccb8) Add mocha and chai as dev-dependencies - Nils Knappmeier
* [98a14f8](https://github.com/bootprint/bootprint-json-schema/commit/98a14f8) Adjust travis-configuration - Nils Knappmeier
* [3b7b322](https://github.com/bootprint/bootprint-json-schema/commit/3b7b322) Move to bootprint-organization and enable ghook for StandardJS - Nils Knappmeier
## v0.8.4 - 2015-10-21
# Fix
* Remove `bootprint` as peer-dependency, because `npm` versions 1 and 2 download it needlessly.

@@ -89,2 +99,1 @@

* You'll have to look through the commit log to get details.

57

handlebars/helpers.js

@@ -1,2 +0,2 @@

var util = require("util");
var util = require('util')

@@ -25,3 +25,3 @@ module.exports = {

var components = reference.split('#')
var url = components[0]
// var url = components[0]
var hash = components[1]

@@ -34,4 +34,4 @@ var hashParts = hash.split('/')

if (hashPart.trim().length > 0) {
if (typeof current==='undefined') {
throw new Error("Reference '"+reference+"' cannot be resolved. '"+hashPart+"' is undefined.");
if (typeof current === 'undefined') {
throw new Error("Reference '" + reference + "' cannot be resolved. '" + hashPart + "' is undefined.")
}

@@ -52,37 +52,36 @@ current = current[hashPart]

*/
'json-schema--range': function(range, options, bootprint) {
'json-schema--range': function (range, options, bootprint) {
var hasMinimum = range.minimum || range.minimum === 0
var hasMaximum = range.maximum || range.maximum === 0
var hasMinimum = range.minimum || range.minimum === 0;
var hasMaximum = range.maximum || range.maximum === 0;
if (!hasMinimum && !hasMaximum) {
// There is no range
return "";
return ''
}
var numberSet = "";
if (range.type === "integer") {
numberSet = "\u2208 \u2124" // ELEMENT OF - DOUBLE-STRUCK CAPITAL Z
} else if (range.type === "number") {
numberSet = "\u2208 \u211D" // ELEMENT OF - DOUBLE-STRUCK CAPITAL R
var numberSet = ''
if (range.type === 'integer') {
numberSet = '\u2208 \u2124' // ELEMENT OF - DOUBLE-STRUCK CAPITAL Z
} else if (range.type === 'number') {
numberSet = '\u2208 \u211D' // ELEMENT OF - DOUBLE-STRUCK CAPITAL R
}
if (hasMinimum && !hasMaximum) {
return util.format(", { x %s | x %s %d }",
numberSet,
range.minimumExclusive ? ">" : "\u2265",
range.minimum);
return util.format(', { x %s | x %s %d }',
numberSet,
range.minimumExclusive ? '>' : '\u2265',
range.minimum)
} else if (hasMaximum && !hasMinimum) {
return util.format(", { x %s | x %s %d }",
numberSet,
range.maximumExclusive ? "<" : "\u2264",
range.maximum);
return util.format(', { x %s | x %s %d }',
numberSet,
range.maximumExclusive ? '<' : '\u2264',
range.maximum)
} else {
// if (hasMaxmium && hasMinimum)
return util.format(", { x %s | %d %s x %s %d }",
numberSet,
range.minimum,
range.minimumExclusive ? "<" : "\u2264",
range.maximumExclusive ? "<" : "\u2264",
range.maximum);
return util.format(', { x %s | %d %s x %s %d }',
numberSet,
range.minimum,
range.minimumExclusive ? '<' : '\u2264',
range.maximumExclusive ? '<' : '\u2264',
range.maximum)
}

@@ -98,3 +97,3 @@ }

function dataType (value) {
if (!value) return null;
if (!value) return null
if (value['anyOf'] || value['allOf'] || value['oneOf']) {

@@ -101,0 +100,0 @@ return ''

@@ -1,23 +0,22 @@

var path = require("path");
var path = require('path')
// Export function to create new config (builder is passed in from outside)
module.exports = function(builder) {
return builder
.load(require("bootprint-base"))
.merge({
"handlebars": {
"partials": path.join(__dirname, "handlebars/partials"),
"helpers": require.resolve("./handlebars/helpers.js")
},
"less": {
"main": [
require.resolve("./less/theme.less"),
require.resolve("./less/variables.less")
]
}
});
};
module.exports = function (builder) {
return builder
.load(require('bootprint-base'))
.merge({
'handlebars': {
'partials': path.join(__dirname, 'handlebars/partials'),
'helpers': require.resolve('./handlebars/helpers.js')
},
'less': {
'main': [
require.resolve('./less/theme.less'),
require.resolve('./less/variables.less')
]
}
})
}
// Add "package" to be used by bootprint-doc-generator
module.exports.package = require("./package");
module.exports.package = require('./package')
{
"name": "bootprint-json-schema",
"version": "0.8.4",
"version": "0.8.5",
"description": "Converts a json-schema into a static html page",
"main": "index.js",
"scripts": {
"test": "nodeunit tests/"
"pretest": "standard --version || npm -g install standard",
"test": "mocha && standard",
"preformat": "standard --version || npm -g install standard",
"format": "standard --format",
"thought": "thought run -a",
"prethoughtcheck": "thought --version || npm -g install thought",
"thoughtcheck": "thought check-engines",
"version": "thoughtful changelog -o -a && npm run thought",
"preversion": "npm run thoughtcheck"
},

@@ -12,3 +20,3 @@ "preferGlobal": true,

"type": "git",
"url": "https://github.com/nknapp/bootprint-json-schema.git"
"url": "https://github.com/bootprint/bootprint-json-schema.git"
},

@@ -18,5 +26,5 @@ "author": "Nils Knappmeier",

"bugs": {
"url": "https://github.com/nknapp/bootprint-json-schema/issues"
"url": "https://github.com/bootprint/bootprint-json-schema/issues"
},
"homepage": "https://github.com/nknapp/bootprint-json-schema",
"homepage": "https://github.com/bootprint/bootprint-json-schema",
"dependencies": {

@@ -29,3 +37,14 @@ "bootprint-base": "<1.0.0"

"index.js"
]
],
"config": {
"ghooks": {
"pre-commit": "standard"
}
},
"devDependencies": {
"chai": "^3.5.0",
"ghooks": "^1.0.3",
"mocha": "^2.4.5",
"thoughtful-release": "^0.3.0"
}
}

@@ -1,8 +0,14 @@

## Overview
# bootprint-json-schema
This package contains a template, partials and styles for [bootprint](http://npmjs.com/bootprint) to convert
JSON-schema files into a static HTML-page.
[![NPM version](https://badge.fury.io/js/bootprint-json-schema.svg)](http://badge.fury.io/js/bootprint-json-schema)
[![Travis Build Status](https://travis-ci.org/bootprint/bootprint-json-schema.svg?branch=master)](https://travis-ci.org/bootprint/bootprint-json-schema)
[![Coverage Status](https://img.shields.io/coveralls/bootprint/bootprint-json-schema.svg)](https://coveralls.io/r/bootprint/bootprint-json-schema)
## Usage
> Converts a json-schema into a static html page
This module is meant for use with the [bootprint](https://npmjs.com/package/bootprint) module:
```bash

@@ -17,5 +23,18 @@ npm install -g bootprint

## API-reference
*More documentation coming soon*
## Style details
## License
`bootprint-json-schema` is published under the MIT-license.
See [LICENSE](LICENSE) for details.
## Release-Notes
For release notes, see [CHANGELOG.md](CHANGELOG.md)
## Contributing guidelines
See [CONTRIBUTING.md](CONTRIBUTING.md).
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