@dosgato/templating
Advanced tools
Comparing version 0.0.36 to 0.0.37
@@ -195,3 +195,3 @@ import { ComponentData, DataData, PageData } from './component.js'; | ||
*/ | ||
export declare function extractLinksFromText(text: string): LinkDefinition[]; | ||
export declare function extractLinksFromText(text: string | undefined): LinkDefinition[]; | ||
/** | ||
@@ -201,4 +201,4 @@ * This function is used by API template definitions to help them identify all the searchable | ||
*/ | ||
export declare function getKeywords(text: string, options?: { | ||
export declare function getKeywords(text?: string, options?: { | ||
stopwords?: boolean; | ||
}): string[]; |
@@ -13,2 +13,4 @@ import { stopwords } from './stopwords.js'; | ||
export function extractLinksFromText(text) { | ||
if (!text) | ||
return []; | ||
const matches = text.matchAll(/{.*"type"\s?:\s+"\w+".*?}/gi); | ||
@@ -22,2 +24,4 @@ return Array.from(matches).map(m => JSON.parse(m[0])); | ||
export function getKeywords(text, options) { | ||
if (!text) | ||
return []; | ||
return Array.from(new Set(text | ||
@@ -24,0 +28,0 @@ .toLocaleLowerCase() |
{ | ||
"name": "@dosgato/templating", | ||
"version": "0.0.36", | ||
"version": "0.0.37", | ||
"description": "A library to support building templates for dosgato CMS.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
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
50577
1157