"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const posts = __importStar(require("./posts.json"));
// import * as photos from './photos.json';
class DB {
    static getPosts(filter = {}, pageNumber = 1, pageSize = 25) {
        const filterkey = Object.keys(filter)[0];
        let list = Object.values(posts);
        if (filter && filterkey) {
            list = list.filter((item) => { return item[filterkey] === filter[filterkey]; });
        }
        list = list.slice((pageNumber * pageSize) - pageSize, pageSize);
        return list;
    }
}
exports.DB = DB;
//# sourceMappingURL=index.js.map