(elements, name, identifyingAttribute, attributes)
| 2011 | } |
| 2012 | |
| 2013 | function 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 | |
| 2025 | function readStyleMap(docxFile) { |
| 2026 | if (docxFile.exists(styleMapPath)) { |
no outgoing calls
no test coverage detected