toJSON(scripts) {
        var list = [];

        scripts.forEach(script => {
            var json = BaseSerializer.prototype.toJSON.call(this);

            Object.assign(json, {
                id: script.id,
                pid: script.pid,
                name: script.name,
                type: script.type,
                source: script.source,
                sort: script.sort,
                uuid: script.uuid
            });

            list.push(json);
        });

        return list;
    }
ScriptSerializer
@author tengge / https://github.com/tengge1