MCPcopy Create free account
hub / github.com/TruthHun/BookStack / addOrUpdateElement

Function addOrUpdateElement

static/word2md/mammoth.browser.js:2013–2023  ·  view source on GitHub ↗
(elements, name, identifyingAttribute, attributes)

Source from the content-addressed store, hash-verified

2011}
2012
2013function addOrUpdateElement(elements, name, identifyingAttribute, attributes) {
2014 var existingElement = _.find(elements, function(element) {
2015 return element.name === name &&
2016 element.attributes[identifyingAttribute] === attributes[identifyingAttribute];
2017 });
2018 if (existingElement) {
2019 existingElement.attributes = attributes;
2020 } else {
2021 elements.push(xml.element(name, attributes));
2022 }
2023}
2024
2025function readStyleMap(docxFile) {
2026 if (docxFile.exists(styleMapPath)) {

Callers 2

updateRelationshipsFunction · 0.70
updateContentTypesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected