Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions knockout.mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -743,11 +743,15 @@
if (ko.utils.arrayIndexOf(options.include, indexer) === -1) {
// The mapped properties object contains all the properties that were part of the original object.
// If a property does not exist, and it is not because it is part of an array (e.g. "myProp[3]"), then it should not be unmapped.
if (unwrappedRootObject[mappingProperty]
&& unwrappedRootObject[mappingProperty].mappedProperties && !unwrappedRootObject[mappingProperty].mappedProperties[indexer]
&& unwrappedRootObject[mappingProperty].copiedProperties && !unwrappedRootObject[mappingProperty].copiedProperties[indexer]
&& !(exports.getType(unwrappedRootObject) === "array")) {
return;
var unwrappedRootMappingProperty = unwrappedRootObject[mappingProperty];
if (unwrappedRootMappingProperty) {
var mappedProperties = unwrappedRootMappingProperty.mappedProperties;
if (mappedProperties && !mappedProperties[indexer]) {
var copiedProperties = unwrappedRootMappingProperty.copiedProperties;
if (copiedProperties && !copiedProperties[indexer] && (exports.getType(unwrappedRootObject) !== "array")) {
return;
}
}
}
}
}
Expand Down