All files / src ContentSerializer.js

0% Statements 0/10
0% Branches 0/2
0% Functions 0/3
0% Lines 0/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26                                                   
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const SN_1 = require("./SN");
class SerializedContent {
}
exports.SerializedContent = SerializedContent;
class ContentSerializer {
    static Serialize(content) {
        if (!content.Path) {
            throw new Error('Content Path required!');
        }
        const repoUrl = content.GetRepository().ODataBaseUrl;
        return {
            Data: content.GetFields(true),
            Origin: SN_1.ODataHelper.joinPaths(`${repoUrl}`, content.Path)
        };
    }
    static Stringify(content) {
        return JSON.stringify(this.Serialize(content));
    }
    static Parse(contentString) {
        return JSON.parse(contentString);
    }
}
exports.ContentSerializer = ContentSerializer;
//# sourceMappingURL=ContentSerializer.js.map