@microsoft/sp-webpart-base
Version:
SharePoint Framework support for building web parts
29 lines • 1.45 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.reInstateServerProcessedData = void 0;
var sp_component_base_1 = require("@microsoft/sp-component-base");
var Flights_1 = require("../common/Flights");
/**
* @internal
* This method consumes the properties object from the serialized data and re-applies
* the field values from the serverProcessedContent. This process will result in the
* properties bag as it was when the serialization happened.
*/
function reInstateServerProcessedData(_a) {
var deserializedProperties = _a.deserializedProperties, serverProcessedContent = _a.serverProcessedContent, propertiesMetadata = _a.propertiesMetadata, renderedFromPersistedData = _a.renderedFromPersistedData, manifest = _a.manifest;
var metadata = propertiesMetadata;
if (!deserializedProperties) {
return {};
}
var fixedProperties = deserializedProperties;
var shouldSkip = !(0, Flights_1.isServerPropertiesSanitizedEnabled)()
? !serverProcessedContent && !renderedFromPersistedData
: !renderedFromPersistedData;
if (shouldSkip) {
return fixedProperties;
}
sp_component_base_1._PropertyMetadataProcessor.reInstateServerProcessedData(metadata, fixedProperties, serverProcessedContent, manifest);
return fixedProperties;
}
exports.reInstateServerProcessedData = reInstateServerProcessedData;
//# sourceMappingURL=deserializationHelpers.js.map