Skip to content

Commit 47f2ffa

Browse files
committed
Removed string literal and update npm ignore
1 parent fb4539e commit 47f2ffa

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ src
22
tsconfig.json
33
tslint.json
44
.prettierrc
5-
jestconfig.json
5+
jestconfig.json
6+
CODEOWNERS

src/entry-editable.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { EntryModel } from ".";
22

33
export function addTags(entry: EntryModel, contentTypeUid: string, tagsAsObject: boolean, locale: string = 'en-us') : void {
44
if (entry)
5-
entry["$"] = getTag(entry, `${contentTypeUid}.${entry.uid}.${locale}`, tagsAsObject, locale)
5+
entry.$ = getTag(entry, `${contentTypeUid}.${entry.uid}.${locale}`, tagsAsObject, locale)
66
}
77

88
function getTag(content: object, prefix: string, tagsAsObject: boolean, locale: string): object {
@@ -13,18 +13,18 @@ function getTag(content: object, prefix: string, tagsAsObject: boolean, locale:
1313
if (Array.isArray(value)) {
1414
value.forEach((obj, index) => {
1515
if ((typeof obj !== 'undefined' || obj !== null) && obj._content_type_uid !== undefined && obj.uid !== undefined) {
16-
value[index]['$'] = getTag(obj, `${obj._content_type_uid}.${obj.uid}.${obj.locale || locale}`, tagsAsObject, locale)
16+
value[index].$ = getTag(obj, `${obj._content_type_uid}.${obj.uid}.${obj.locale || locale}`, tagsAsObject, locale)
1717
}else {
1818
if (typeof obj === "object") {
19-
obj['$'] = getTag(obj, `${prefix}.${key}.${index}`, tagsAsObject, locale)
19+
obj.$ = getTag(obj, `${prefix}.${key}.${index}`, tagsAsObject, locale)
2020
} else {
2121
tags[key] = getTagsValue(`${prefix}.${key}`, tagsAsObject)
2222
}
2323
}
2424
})
2525
}else {
2626
if (value) {
27-
value["$"] = getTag(value, `${prefix}.${key}`, tagsAsObject, locale)
27+
value.$ = getTag(value, `${prefix}.${key}`, tagsAsObject, locale)
2828
}
2929
}
3030
break;

0 commit comments

Comments
 (0)