Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@smallstack/api-shared

Package Overview
Dependencies
Maintainers
1
Versions
456
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smallstack/api-shared - npm Package Compare versions

Comparing version 1.122.0-rc.1 to 1.122.0-rc.2

2

package.json
{
"name": "@smallstack/api-shared",
"version": "1.122.0-rc.1",
"version": "1.122.0-rc.2",
"peerDependencies": {

@@ -5,0 +5,0 @@ "tslib": "2.5.3"

@@ -15,1 +15,2 @@ import { PageRequest } from "./page-request";

export declare function isPage(page: any): page is Page<any>;
export declare function loadAllPages<T>(apiCallFn: (page: number) => Promise<Page<T>>): Promise<T[]>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isPage = exports.createPageFrom = exports.convertPageElements = exports.MAX_PAGE_SIZE = exports.DEFAULT_PAGE_SIZE = void 0;
exports.loadAllPages = exports.isPage = exports.createPageFrom = exports.convertPageElements = exports.MAX_PAGE_SIZE = exports.DEFAULT_PAGE_SIZE = void 0;
const tslib_1 = require("tslib");
// Pagination

@@ -52,2 +53,17 @@ exports.DEFAULT_PAGE_SIZE = 25;

exports.isPage = isPage;
function loadAllPages(apiCallFn) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
let page = 1;
let responsePage;
const models = [];
do {
responsePage = yield apiCallFn(page);
if ((responsePage === null || responsePage === void 0 ? void 0 : responsePage.elements) instanceof Array)
models.push(...responsePage.elements);
page++;
} while (responsePage.hasNext);
return models;
});
}
exports.loadAllPages = loadAllPages;
//# sourceMappingURL=page.js.map

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc