Properly handle arrays as candidates for json key.
This commit is contained in:
@@ -556,7 +556,10 @@ MBTiles.prototype.putInfo = function(data, callback) {
|
||||
// If a data property is a javascript hash/object, slip it into
|
||||
// the 'json' field which contains stringified JSON to be merged
|
||||
// in at read time. Allows nested/deep metadata to be recorded.
|
||||
if (typeof data[key] === 'object' && !Array.isArray(data[key])) {
|
||||
var nested = typeof data[key] === 'object' &&
|
||||
key !== 'bounds' &&
|
||||
key !== 'center';
|
||||
if (nested) {
|
||||
jsondata = jsondata || {};
|
||||
jsondata[key] = data[key];
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user