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

@bkwld/json-ld-formatters

Package Overview
Dependencies
Maintainers
5
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bkwld/json-ld-formatters - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

src/formatters/breadcrumbs.coffee

35

dist/main.js

@@ -9,2 +9,3 @@ function $parcel$export(e, n, v, s) {

$parcel$export(module.exports, "makeJsonLdSearchTag", () => $5481b6a2b1eb1639$export$9fa68bface6198c1);
$parcel$export(module.exports, "makeJsonLdBreadcrumbsTag", () => $5481b6a2b1eb1639$export$38f0a148ac0f1762);
function $22a09b144049ac17$export$2e2bcd8739ae039({ type: type , title: title , image: image , publishedAt: publishedAt , updatedAt: updatedAt , author: author } = {

@@ -110,2 +111,33 @@ }) {

// Create a JSON LD breadcrumb tag
// https://developers.google.com/search/docs/advanced/structured-data/breadcrumb
// Set defaults and cast vars
var $4699710f68157ac2$var$getItem, $4699710f68157ac2$var$url;
$4699710f68157ac2$var$url = $4699710f68157ac2$var$url || process.env.URL;
function $4699710f68157ac2$export$2e2bcd8739ae039(breadcrumbsList = []) {
var breadcrumbs;
// Make the breadcrumbs
breadcrumbs = breadcrumbsList.map(function(data, index, array) {
return {
'@type': 'ListItem',
position: index + 1,
name: data.name,
item: $4699710f68157ac2$var$getItem(data)
};
});
return {
// Make the JSON LD
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": breadcrumbs
};
}
// Helper to get breadcrumb item
$4699710f68157ac2$var$getItem = function(breadcrumb) {
if (!(breadcrumb.url || breadcrumb.path)) return;
if (breadcrumb.url) return breadcrumb.url;
else return $4699710f68157ac2$var$url + breadcrumb.path;
};
/*

@@ -126,2 +158,5 @@ Render the script tag that renders json-ld

};
var $5481b6a2b1eb1639$export$38f0a148ac0f1762 = function(props) {
return $5481b6a2b1eb1639$var$makeTag($4699710f68157ac2$export$2e2bcd8739ae039(props));
};
// Wrap the json ld data in the stucture needed by vue meta

@@ -128,0 +163,0 @@ $5481b6a2b1eb1639$var$makeTag = function(data) {

36

dist/module.js

@@ -101,2 +101,33 @@ function $84ce8bef1b4ff9bb$export$2e2bcd8739ae039({ type: type , title: title , image: image , publishedAt: publishedAt , updatedAt: updatedAt , author: author } = {

// Create a JSON LD breadcrumb tag
// https://developers.google.com/search/docs/advanced/structured-data/breadcrumb
// Set defaults and cast vars
var $a91c8d8b967f5f70$var$getItem, $a91c8d8b967f5f70$var$url;
$a91c8d8b967f5f70$var$url = $a91c8d8b967f5f70$var$url || process.env.URL;
function $a91c8d8b967f5f70$export$2e2bcd8739ae039(breadcrumbsList = []) {
var breadcrumbs;
// Make the breadcrumbs
breadcrumbs = breadcrumbsList.map(function(data, index, array) {
return {
'@type': 'ListItem',
position: index + 1,
name: data.name,
item: $a91c8d8b967f5f70$var$getItem(data)
};
});
return {
// Make the JSON LD
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": breadcrumbs
};
}
// Helper to get breadcrumb item
$a91c8d8b967f5f70$var$getItem = function(breadcrumb) {
if (!(breadcrumb.url || breadcrumb.path)) return;
if (breadcrumb.url) return breadcrumb.url;
else return $a91c8d8b967f5f70$var$url + breadcrumb.path;
};
/*

@@ -117,2 +148,5 @@ Render the script tag that renders json-ld

};
var $a56e88318c4367d9$export$38f0a148ac0f1762 = function(props) {
return $a56e88318c4367d9$var$makeTag($a91c8d8b967f5f70$export$2e2bcd8739ae039(props));
};
// Wrap the json ld data in the stucture needed by vue meta

@@ -131,3 +165,3 @@ $a56e88318c4367d9$var$makeTag = function(data) {

export {$a56e88318c4367d9$export$8edec034e5425182 as makeJsonLdArticleTag, $a56e88318c4367d9$export$66bd74c8c00bc085 as makeJsonLdOrganizationTag, $a56e88318c4367d9$export$ed912fd0e21f068e as makeJsonLdProductTag, $a56e88318c4367d9$export$9fa68bface6198c1 as makeJsonLdSearchTag};
export {$a56e88318c4367d9$export$8edec034e5425182 as makeJsonLdArticleTag, $a56e88318c4367d9$export$66bd74c8c00bc085 as makeJsonLdOrganizationTag, $a56e88318c4367d9$export$ed912fd0e21f068e as makeJsonLdProductTag, $a56e88318c4367d9$export$9fa68bface6198c1 as makeJsonLdSearchTag, $a56e88318c4367d9$export$38f0a148ac0f1762 as makeJsonLdBreadcrumbsTag};
//# sourceMappingURL=module.js.map

2

package.json
{
"name": "@bkwld/json-ld-formatters",
"version": "0.1.2",
"version": "0.2.0",
"description": "A library of helper functions for creating common JSON LD schemas.",

@@ -5,0 +5,0 @@ "author": "Bukwild",

@@ -53,4 +53,5 @@ # json-ld-formatters

- [article](./formatters/article.coffee) - `makeJsonLdArticleTag`
- [breadcrumbs](./formatters/breadcrumbs.coffee) - `makeJsonLdBreadcrumbsTag`
- [organization](./formatters/organization.coffee) - `makeJsonLdOrganizationTag`
- [product](./formatters/product.coffee) `makeJsonLdProductTag`
- [search](./formatters/search.coffee) - `makeJsonLdSearchTag`

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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