@tinkoff/meta-tags-generate
Advanced tools
Comparing version 0.5.9 to 0.5.10
@@ -18,7 +18,9 @@ import identity from '@tinkoff/utils/function/identity'; | ||
this.metaWalk.eachMeta((val, key) => { | ||
const value = this.transformValue(val); | ||
const converter = this.converters[key]; | ||
const res = (converter || defaultConverter)(value.value); | ||
if (res) { | ||
result = result.concat(isArray(res) ? res.filter(identity) : res); | ||
if (val.value !== null) { | ||
const value = this.transformValue(val); | ||
const converter = this.converters[key]; | ||
const res = (converter || defaultConverter)(value.value); | ||
if (res) { | ||
result = result.concat(isArray(res) ? res.filter(identity) : res); | ||
} | ||
} | ||
@@ -25,0 +27,0 @@ }); |
@@ -9,2 +9,2 @@ import type { MetaWalk, WalkItem } from './MetaWalk'; | ||
}; | ||
export type Converter = (value: string | TagRecord) => TagRecord | TagRecord[] | null; | ||
export type Converter = (value: string | TagRecord | null) => TagRecord | TagRecord[] | null; |
@@ -28,7 +28,9 @@ 'use strict'; | ||
this.metaWalk.eachMeta((val, key) => { | ||
const value = this.transformValue(val); | ||
const converter = this.converters[key]; | ||
const res = (converter || defaultConverter)(value.value); | ||
if (res) { | ||
result = result.concat(isArray__default["default"](res) ? res.filter(identity__default["default"]) : res); | ||
if (val.value !== null) { | ||
const value = this.transformValue(val); | ||
const converter = this.converters[key]; | ||
const res = (converter || defaultConverter)(value.value); | ||
if (res) { | ||
result = result.concat(isArray__default["default"](res) ? res.filter(identity__default["default"]) : res); | ||
} | ||
} | ||
@@ -35,0 +37,0 @@ }); |
import type { TagRecord } from './Meta.h'; | ||
export type WalkItem = { | ||
value: string | TagRecord; | ||
value: string | TagRecord | null; | ||
priority: number; | ||
@@ -10,5 +10,5 @@ }; | ||
eachMeta(func: (value: WalkItem, key: string) => void): void; | ||
updateMeta(priority: number, metaObj: Record<string, string | TagRecord>): this; | ||
updateMeta(priority: number, metaObj: Record<string, string | TagRecord | null>): this; | ||
get(key: string): WalkItem | undefined; | ||
reset(): void; | ||
} |
@@ -17,8 +17,3 @@ import eachObj from '@tinkoff/utils/object/each'; | ||
if (!stateMeta || priority >= stateMeta.priority) { | ||
if (value === null) { | ||
this.state.delete(name); | ||
} | ||
else { | ||
this.state.set(name, { value, priority }); | ||
} | ||
this.state.set(name, { value, priority }); | ||
} | ||
@@ -25,0 +20,0 @@ }, metaObj); |
@@ -25,8 +25,3 @@ 'use strict'; | ||
if (!stateMeta || priority >= stateMeta.priority) { | ||
if (value === null) { | ||
this.state.delete(name); | ||
} | ||
else { | ||
this.state.set(name, { value, priority }); | ||
} | ||
this.state.set(name, { value, priority }); | ||
} | ||
@@ -33,0 +28,0 @@ }, metaObj); |
{ | ||
"name": "@tinkoff/meta-tags-generate", | ||
"version": "0.5.9", | ||
"version": "0.5.10", | ||
"initialVersion": "0.4.22", | ||
@@ -5,0 +5,0 @@ "description": "", |
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
12535
309