Comparing version 0.0.5-patch.3 to 0.0.5-patch.4
@@ -31,2 +31,3 @@ import type { HtmlAnalyzer } from "./html-analyzer"; | ||
getKeywordInTitle(keyword?: string | null): KeywordDensity; | ||
getPosition(text: string, keyword: string): number; | ||
getSubKeywordsInTitle(): KeywordDensity[]; | ||
@@ -33,0 +34,0 @@ getKeywordInMetaDescription(keyword?: string | null): KeywordDensity; |
@@ -60,5 +60,10 @@ "use strict"; | ||
density, | ||
position: this.content.title ? this.content.title.split(keyword).indexOf(keyword) : -1 | ||
position: this.getPosition(this.content.title, keyword) | ||
}; | ||
} | ||
getPosition(text, keyword) { | ||
if (!text || !keyword) | ||
return -1; | ||
return text.split(keyword)[0].split(' ').length; | ||
} | ||
getSubKeywordsInTitle() { | ||
@@ -79,3 +84,3 @@ let subKeywordsInTitle = []; | ||
density, | ||
position: this.content.metaDescription ? this.content.metaDescription.split(keyword).indexOf(keyword) : -1 | ||
position: this.getPosition(this.content.title, keyword) | ||
}; | ||
@@ -82,0 +87,0 @@ } |
{ | ||
"name": "seord", | ||
"version": "0.0.5-patch.3", | ||
"version": "0.0.5-patch.4", | ||
"description": "Advanced SEO Analyzer", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
65441
727