New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bkwld/json-ld-formatters

Package Overview
Dependencies
Maintainers
7
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.4.1 to 0.5.0

src/formatters/career.coffee

233

dist/main.js

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

$parcel$export(module.exports, "makeJsonLdArticleTag", () => $5481b6a2b1eb1639$export$8edec034e5425182);
$parcel$export(module.exports, "makeJsonLdBreadcrumbsTag", () => $5481b6a2b1eb1639$export$38f0a148ac0f1762);
$parcel$export(module.exports, "makeJsonLdCareerTag", () => $5481b6a2b1eb1639$export$339b7f68be19ab72);
$parcel$export(module.exports, "makeJsonLdFAQPageTag", () => $5481b6a2b1eb1639$export$b90bb08e6a28eba6);
$parcel$export(module.exports, "makeJsonLdOrganizationTag", () => $5481b6a2b1eb1639$export$66bd74c8c00bc085);
$parcel$export(module.exports, "makeJsonLdProductTag", () => $5481b6a2b1eb1639$export$ed912fd0e21f068e);
$parcel$export(module.exports, "makeJsonLdRecipeTag", () => $5481b6a2b1eb1639$export$996972a851106ff7);
$parcel$export(module.exports, "makeJsonLdSearchTag", () => $5481b6a2b1eb1639$export$9fa68bface6198c1);
$parcel$export(module.exports, "makeJsonLdBreadcrumbsTag", () => $5481b6a2b1eb1639$export$38f0a148ac0f1762);
$parcel$export(module.exports, "makeJsonLdRecipeTag", () => $5481b6a2b1eb1639$export$996972a851106ff7);
$parcel$export(module.exports, "makeJsonLdFAQPageTag", () => $5481b6a2b1eb1639$export$b90bb08e6a28eba6);
function $22a09b144049ac17$export$2e2bcd8739ae039({ type: type , title: title , image: image , publishedAt: publishedAt , updatedAt: updatedAt , author: author } = {

@@ -40,4 +41,93 @@ }) {

function $fc8db55aa9638d5e$export$2e2bcd8739ae039({ name: name , url: url , logo: logo , publishedAt: publishedAt , updatedAt: updatedAt } = {
// 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: breadcrumbsList = [] , name: name = 'Breadcrumbs' }) {
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",
name: name,
"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;
};
function $3a4992275335a3e4$export$2e2bcd8739ae039({ title: title , description: description , organization: { name: organizationName , url: organizationUrl , logo: organizationLogo } = {
} , location: { address: address , city: city , state: state , zip: zip } = {
} , type: type = 'FULL_TIME' , publishedAt: publishedAt } = {
}) {
var hasLoc;
// Is there a location
hasLoc = address && city && state && zip;
return {
// Make the JSON LD
'@type': 'JobPosting',
title: title,
description: description,
employmentType: type,
datePosted: publishedAt != null ? typeof publishedAt.toISOString === "function" ? publishedAt.toISOString() : void 0 : void 0,
hiringOrganization: {
'@type': 'Organization',
name: organizationName || process.env.SITE_NAME,
sameAs: organizationUrl || process.env.URL,
logo: organizationLogo
},
...!hasLoc ? {
jobLocationType: 'TELECOMMUTE'
} : {
jobLocation: {
'@type': 'Place',
address: {
'@type': 'PostalAddress',
streetAddress: address,
addressLocality: city,
addressRegion: state,
postalCode: zip
}
}
}
};
}
function $50aa924191cebc25$export$2e2bcd8739ae039({ questions: questions } = {
}) {
return {
// Make the JSON LD
'@type': 'FAQPage',
mainEntity: questions.map(function(question) {
return {
"@type": "Question",
name: question.question,
acceptedAnswer: {
"@type": "Answer",
text: question.answer
}
};
})
};
}
function $fc8db55aa9638d5e$export$2e2bcd8739ae039({ name: name , logo: logo , url: url , otherUrls: otherUrls = [] , phone: phone , address: address , city: city , state: state , zip: zip } = {
}) {
// Set defaults and cast vars

@@ -50,4 +140,31 @@ name = name || process.env.SITE_NAME;

name: name,
logo: logo,
url: url,
logo: logo
...!otherUrls.length ? {
} : {
sameAs: otherUrls
},
...!phone ? {
} : {
contactPoint: [
{
'@type': 'ContactPoint',
telephone: phone,
contactType: 'sales'
}
]
},
...!(address && city && state && zip) ? {
} : {
location: {
'@type': 'Place',
address: {
'@type': 'PostalAddress',
streetAddress: address,
addressLocality: city,
addressRegion: state,
postalCode: zip
}
}
}
};

@@ -90,59 +207,2 @@ }

function $22693166a170759d$export$2e2bcd8739ae039({ siteName: siteName , siteUrl: siteUrl , urlTemplate: urlTemplate , urlTemplatePlaceholder: urlTemplatePlaceholder } = {
}) {
// Set defaults and cast vars
siteName = siteName || process.env.SITE_NAME;
siteUrl = siteUrl || process.env.URL;
urlTemplate = urlTemplate || '/search?q={query}';
urlTemplatePlaceholder = urlTemplatePlaceholder || 'query';
return {
// Make the JSON LD
'@type': 'Website',
name: siteName,
url: siteUrl,
potentialAction: {
'@type': 'SearchAction',
name: siteName + ' Search',
target: {
'@type': 'EntryPoint',
urlTemplate: siteUrl + urlTemplate
},
'query-input': `required name=${urlTemplatePlaceholder}`
}
};
}
// 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: breadcrumbsList = [] , name: name = 'Breadcrumbs' }) {
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",
name: name,
"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;
};
// Create Recipe JSON LD data

@@ -181,17 +241,23 @@ // https://developers.google.com/search/docs/advanced/structured-data/recipe

function $50aa924191cebc25$export$2e2bcd8739ae039({ questions: questions } = {
function $22693166a170759d$export$2e2bcd8739ae039({ siteName: siteName , siteUrl: siteUrl , urlTemplate: urlTemplate , urlTemplatePlaceholder: urlTemplatePlaceholder } = {
}) {
// Set defaults and cast vars
siteName = siteName || process.env.SITE_NAME;
siteUrl = siteUrl || process.env.URL;
urlTemplate = urlTemplate || '/search?q={query}';
urlTemplatePlaceholder = urlTemplatePlaceholder || 'query';
return {
// Make the JSON LD
'@type': 'FAQPage',
mainEntity: questions.map(function(question) {
return {
"@type": "Question",
name: question.question,
acceptedAnswer: {
"@type": "Answer",
text: question.answer
}
};
})
'@type': 'Website',
name: siteName,
url: siteUrl,
potentialAction: {
'@type': 'SearchAction',
name: siteName + ' Search',
target: {
'@type': 'EntryPoint',
urlTemplate: siteUrl + urlTemplate
},
'query-input': `required name=${urlTemplatePlaceholder}`
}
};

@@ -207,2 +273,11 @@ }

};
var $5481b6a2b1eb1639$export$38f0a148ac0f1762 = function(props) {
return $5481b6a2b1eb1639$var$makeTag($4699710f68157ac2$export$2e2bcd8739ae039(props));
};
var $5481b6a2b1eb1639$export$339b7f68be19ab72 = function(props) {
return $5481b6a2b1eb1639$var$makeTag($3a4992275335a3e4$export$2e2bcd8739ae039(props));
};
var $5481b6a2b1eb1639$export$b90bb08e6a28eba6 = function(props) {
return $5481b6a2b1eb1639$var$makeTag($50aa924191cebc25$export$2e2bcd8739ae039(props));
};
var $5481b6a2b1eb1639$export$66bd74c8c00bc085 = function(props) {

@@ -214,13 +289,7 @@ return $5481b6a2b1eb1639$var$makeTag($fc8db55aa9638d5e$export$2e2bcd8739ae039(props));

};
var $5481b6a2b1eb1639$export$9fa68bface6198c1 = function(props) {
return $5481b6a2b1eb1639$var$makeTag($22693166a170759d$export$2e2bcd8739ae039(props));
};
var $5481b6a2b1eb1639$export$38f0a148ac0f1762 = function(props) {
return $5481b6a2b1eb1639$var$makeTag($4699710f68157ac2$export$2e2bcd8739ae039(props));
};
var $5481b6a2b1eb1639$export$996972a851106ff7 = function(props) {
return $5481b6a2b1eb1639$var$makeTag($ae5ed1fa6538eda4$export$2e2bcd8739ae039(props));
};
var $5481b6a2b1eb1639$export$b90bb08e6a28eba6 = function(props) {
return $5481b6a2b1eb1639$var$makeTag($50aa924191cebc25$export$2e2bcd8739ae039(props));
var $5481b6a2b1eb1639$export$9fa68bface6198c1 = function(props) {
return $5481b6a2b1eb1639$var$makeTag($22693166a170759d$export$2e2bcd8739ae039(props));
};

@@ -227,0 +296,0 @@ // Wrap the json ld data in the stucture needed by vue meta

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

function $4f99b21ae4e13d20$export$2e2bcd8739ae039({ name: name , url: url , logo: logo , publishedAt: publishedAt , updatedAt: updatedAt } = {
// 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: breadcrumbsList = [] , name: name = 'Breadcrumbs' }) {
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",
name: name,
"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;
};
function $59479ccf7ce82310$export$2e2bcd8739ae039({ title: title , description: description , organization: { name: organizationName , url: organizationUrl , logo: organizationLogo } = {
} , location: { address: address , city: city , state: state , zip: zip } = {
} , type: type = 'FULL_TIME' , publishedAt: publishedAt } = {
}) {
var hasLoc;
// Is there a location
hasLoc = address && city && state && zip;
return {
// Make the JSON LD
'@type': 'JobPosting',
title: title,
description: description,
employmentType: type,
datePosted: publishedAt != null ? typeof publishedAt.toISOString === "function" ? publishedAt.toISOString() : void 0 : void 0,
hiringOrganization: {
'@type': 'Organization',
name: organizationName || process.env.SITE_NAME,
sameAs: organizationUrl || process.env.URL,
logo: organizationLogo
},
...!hasLoc ? {
jobLocationType: 'TELECOMMUTE'
} : {
jobLocation: {
'@type': 'Place',
address: {
'@type': 'PostalAddress',
streetAddress: address,
addressLocality: city,
addressRegion: state,
postalCode: zip
}
}
}
};
}
function $14d632c4ef1eadd1$export$2e2bcd8739ae039({ questions: questions } = {
}) {
return {
// Make the JSON LD
'@type': 'FAQPage',
mainEntity: questions.map(function(question) {
return {
"@type": "Question",
name: question.question,
acceptedAnswer: {
"@type": "Answer",
text: question.answer
}
};
})
};
}
function $4f99b21ae4e13d20$export$2e2bcd8739ae039({ name: name , logo: logo , url: url , otherUrls: otherUrls = [] , phone: phone , address: address , city: city , state: state , zip: zip } = {
}) {
// Set defaults and cast vars

@@ -38,4 +127,31 @@ name = name || process.env.SITE_NAME;

name: name,
logo: logo,
url: url,
logo: logo
...!otherUrls.length ? {
} : {
sameAs: otherUrls
},
...!phone ? {
} : {
contactPoint: [
{
'@type': 'ContactPoint',
telephone: phone,
contactType: 'sales'
}
]
},
...!(address && city && state && zip) ? {
} : {
location: {
'@type': 'Place',
address: {
'@type': 'PostalAddress',
streetAddress: address,
addressLocality: city,
addressRegion: state,
postalCode: zip
}
}
}
};

@@ -78,59 +194,2 @@ }

function $553204017497ca93$export$2e2bcd8739ae039({ siteName: siteName , siteUrl: siteUrl , urlTemplate: urlTemplate , urlTemplatePlaceholder: urlTemplatePlaceholder } = {
}) {
// Set defaults and cast vars
siteName = siteName || process.env.SITE_NAME;
siteUrl = siteUrl || process.env.URL;
urlTemplate = urlTemplate || '/search?q={query}';
urlTemplatePlaceholder = urlTemplatePlaceholder || 'query';
return {
// Make the JSON LD
'@type': 'Website',
name: siteName,
url: siteUrl,
potentialAction: {
'@type': 'SearchAction',
name: siteName + ' Search',
target: {
'@type': 'EntryPoint',
urlTemplate: siteUrl + urlTemplate
},
'query-input': `required name=${urlTemplatePlaceholder}`
}
};
}
// 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: breadcrumbsList = [] , name: name = 'Breadcrumbs' }) {
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",
name: name,
"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;
};
// Create Recipe JSON LD data

@@ -169,17 +228,23 @@ // https://developers.google.com/search/docs/advanced/structured-data/recipe

function $14d632c4ef1eadd1$export$2e2bcd8739ae039({ questions: questions } = {
function $553204017497ca93$export$2e2bcd8739ae039({ siteName: siteName , siteUrl: siteUrl , urlTemplate: urlTemplate , urlTemplatePlaceholder: urlTemplatePlaceholder } = {
}) {
// Set defaults and cast vars
siteName = siteName || process.env.SITE_NAME;
siteUrl = siteUrl || process.env.URL;
urlTemplate = urlTemplate || '/search?q={query}';
urlTemplatePlaceholder = urlTemplatePlaceholder || 'query';
return {
// Make the JSON LD
'@type': 'FAQPage',
mainEntity: questions.map(function(question) {
return {
"@type": "Question",
name: question.question,
acceptedAnswer: {
"@type": "Answer",
text: question.answer
}
};
})
'@type': 'Website',
name: siteName,
url: siteUrl,
potentialAction: {
'@type': 'SearchAction',
name: siteName + ' Search',
target: {
'@type': 'EntryPoint',
urlTemplate: siteUrl + urlTemplate
},
'query-input': `required name=${urlTemplatePlaceholder}`
}
};

@@ -195,2 +260,11 @@ }

};
var $a56e88318c4367d9$export$38f0a148ac0f1762 = function(props) {
return $a56e88318c4367d9$var$makeTag($a91c8d8b967f5f70$export$2e2bcd8739ae039(props));
};
var $a56e88318c4367d9$export$339b7f68be19ab72 = function(props) {
return $a56e88318c4367d9$var$makeTag($59479ccf7ce82310$export$2e2bcd8739ae039(props));
};
var $a56e88318c4367d9$export$b90bb08e6a28eba6 = function(props) {
return $a56e88318c4367d9$var$makeTag($14d632c4ef1eadd1$export$2e2bcd8739ae039(props));
};
var $a56e88318c4367d9$export$66bd74c8c00bc085 = function(props) {

@@ -202,13 +276,7 @@ return $a56e88318c4367d9$var$makeTag($4f99b21ae4e13d20$export$2e2bcd8739ae039(props));

};
var $a56e88318c4367d9$export$9fa68bface6198c1 = function(props) {
return $a56e88318c4367d9$var$makeTag($553204017497ca93$export$2e2bcd8739ae039(props));
};
var $a56e88318c4367d9$export$38f0a148ac0f1762 = function(props) {
return $a56e88318c4367d9$var$makeTag($a91c8d8b967f5f70$export$2e2bcd8739ae039(props));
};
var $a56e88318c4367d9$export$996972a851106ff7 = function(props) {
return $a56e88318c4367d9$var$makeTag($b4e444b79bc24c17$export$2e2bcd8739ae039(props));
};
var $a56e88318c4367d9$export$b90bb08e6a28eba6 = function(props) {
return $a56e88318c4367d9$var$makeTag($14d632c4ef1eadd1$export$2e2bcd8739ae039(props));
var $a56e88318c4367d9$export$9fa68bface6198c1 = function(props) {
return $a56e88318c4367d9$var$makeTag($553204017497ca93$export$2e2bcd8739ae039(props));
};

@@ -228,3 +296,3 @@ // Wrap the json ld data in the stucture needed by vue meta

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, $a56e88318c4367d9$export$996972a851106ff7 as makeJsonLdRecipeTag, $a56e88318c4367d9$export$b90bb08e6a28eba6 as makeJsonLdFAQPageTag};
export {$a56e88318c4367d9$export$8edec034e5425182 as makeJsonLdArticleTag, $a56e88318c4367d9$export$38f0a148ac0f1762 as makeJsonLdBreadcrumbsTag, $a56e88318c4367d9$export$339b7f68be19ab72 as makeJsonLdCareerTag, $a56e88318c4367d9$export$b90bb08e6a28eba6 as makeJsonLdFAQPageTag, $a56e88318c4367d9$export$66bd74c8c00bc085 as makeJsonLdOrganizationTag, $a56e88318c4367d9$export$ed912fd0e21f068e as makeJsonLdProductTag, $a56e88318c4367d9$export$996972a851106ff7 as makeJsonLdRecipeTag, $a56e88318c4367d9$export$9fa68bface6198c1 as makeJsonLdSearchTag};
//# sourceMappingURL=module.js.map
{
"name": "@bkwld/json-ld-formatters",
"version": "0.4.1",
"version": "0.5.0",
"description": "A library of helper functions for creating common JSON LD schemas.",

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

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

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