UNPKG

@filesrocket/cloudinary

Version:

Filesrocket service that manage the files of the Cloudinary

30 lines 932 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BaseService = void 0; class BaseService { pagination(data, func) { return { items: data.resources.map(func), nextPage: data.next_cursor, page: undefined, size: data.resources.length, total: data.total_count, prevPage: null }; } builder(payload) { return { ...payload, id: payload.public_id, name: payload.filename || payload.public_id, size: payload.bytes, dir: payload.folder || '', ext: `.${payload.format}`, url: payload.secure_url, createdAt: new Date(payload.created_at), updatedAt: new Date(payload.updatedAt) }; } } exports.BaseService = BaseService; //# sourceMappingURL=base.js.map