@microsoft/sp-webpart-base
Version:
SharePoint Framework support for building web parts
25 lines • 1.26 kB
JavaScript
import { _PropertyMetadataProcessor } from '@microsoft/sp-component-base';
import { isServerPropertiesSanitizedEnabled } from '../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.
*/
export 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 = !isServerPropertiesSanitizedEnabled()
? !serverProcessedContent && !renderedFromPersistedData
: !renderedFromPersistedData;
if (shouldSkip) {
return fixedProperties;
}
_PropertyMetadataProcessor.reInstateServerProcessedData(metadata, fixedProperties, serverProcessedContent, manifest);
return fixedProperties;
}
//# sourceMappingURL=deserializationHelpers.js.map