value/UnitReplaceCommand.ts
Function createReplacer
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected async createReplacer(context: HtmlRR0SsgContext): Promise<DomReplacer> {
return {
replace: async (itemEl: HTMLElement) => {
if (itemEl.getAttribute("itemtype") === "https://schema.org/QuantitativeValue") {
const propEls = Array.from(itemEl.querySelectorAll("*[itemprop]"))
Function replace
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
replace: async (itemEl: HTMLElement) => {
if (itemEl.getAttribute("itemtype") === "https://schema.org/QuantitativeValue") {
const propEls = Array.from(itemEl.querySelectorAll("*[itemprop]"))
const unitPropEl = propEls.find(propEl => propEl.getAttribute("itemprop") === "unitCode")
const unit = unitPropEl.getAttribute("content")