This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const input = require('./spec3.json') | |
function titleCase(snake) { | |
return snake.replace(/(^|_)([a-z])/g, (s) => s.replace('_', '').toUpperCase()) | |
} | |
function isPrimitive(schema) { | |
switch (schema.type) { | |
case 'boolean': | |
case 'number': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelector('#readme').setAttribute('style', 'position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; background-color: white') | |
document.querySelector('body').appendChild(document.querySelector('#readme')) | |
window.print() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var queryParams = window.location.search.substr(1).split('&').reduce(function (qs, query) { | |
var chunks = query.split('='); | |
var key = chunks[0]; | |
var value = decodeURIComponent(chunks[1] || ''); | |
var valueLower = value.trim().toLowerCase(); | |
if (valueLower === 'true' || value === 'false') { | |
value = Boolean(value); | |
} else if (!isNaN(Number(value))) { | |
value = Number(value); | |
} |