mirror of
https://github.com/optilude/xlsx-template.git
synced 2026-07-02 08:27:39 +08:00
Simplest form for single item array with object detection yet
This commit is contained in:
+2
-10
@@ -250,16 +250,8 @@ module.exports = (function() {
|
||||
if(substitution instanceof Array && substitution.length == 1){
|
||||
appendCell = true;
|
||||
|
||||
var properties = Object.getOwnPropertyNames(substitution[0]);
|
||||
var pos = 0;
|
||||
// scan for any arrays hanging off the properties of the object
|
||||
while(pos < properties.length && appendCell){
|
||||
var propertyToCheck = properties[pos];
|
||||
// if current property to update contains an array of primatives,
|
||||
if(substitution[0][propertyToCheck] instanceof Array && placeholder.key == propertyToCheck){
|
||||
appendCell = false;
|
||||
}
|
||||
pos++;
|
||||
if(substitution[0][placeholder.key] instanceof Array){
|
||||
appendCell = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user