rapidoc-core
Advanced tools
Comparing version 0.0.1-alfa.7 to 0.0.1-alfa.8
{ | ||
"name": "rapidoc-core", | ||
"version": "0.0.1-alfa.7", | ||
"version": "0.0.1-alfa.8", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/rapidoc-core.js", |
@@ -1,18 +0,16 @@ | ||
import _ from 'lodash'; | ||
import { html, renderToString } from '@popeindustries/lit-html-server'; | ||
// import html from '@popeindustries/lit-html-server'; | ||
import numRef from './ref.json'; | ||
import { | ||
html, | ||
renderToString, | ||
renderToStream, | ||
renderToBuffer, | ||
} from '@popeindustries/lit-html-server'; | ||
export function numToWord(num) { | ||
return _.reduce(numRef, (accum, ref) => (ref.num === num ? ref.word : accum), ''); | ||
export function helloWorld(name) { | ||
return `Hello ${name}`; | ||
} | ||
export function wordToNum(word) { | ||
return _.reduce(numRef, (accum, ref) => (ref.word === word && word.toLowerCase() ? ref.num : accum), -1); | ||
} | ||
function cardTemplate(data) { | ||
/* Dont work across node packages */ | ||
function cardHtml(data, type) { | ||
return html` | ||
<h1> ${data.title}</h1> | ||
<h1> ${data.title} - ${type} </h1> | ||
<h3> ${data.text}</h3> | ||
@@ -22,5 +20,13 @@ `; | ||
export async function cardHtml(data) { | ||
const resultHtml = await renderToString(cardTemplate(data)); | ||
return resultHtml; | ||
export async function cardString(data = { title: 'My Title', text: 'My Text' }) { | ||
const result = await renderToString(cardHtml(data, 'String')); | ||
return result; | ||
} | ||
export async function cardStream(data = { title: 'My Title', text: 'My Text' }) { | ||
return renderToStream(cardHtml(data, 'Stream')); | ||
} | ||
export async function cardBuffer(data = { title: 'My Title', text: 'My Text' }) { | ||
return renderToBuffer(cardHtml(data, 'Buffer')); | ||
} |
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
818425
16341