@cryptexlabs/codex-nodejs-common 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cryptexlabs/codex-nodejs-common",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Common code for Assistant applications",
5
5
  "main": "lib/src/index.js",
6
6
  "repository": "git@gitlab.com:cryptexlabs/public/codex-nodejs-common.git",
@@ -0,0 +1,3 @@
1
+ export declare class ArrayUtil {
2
+ static paginate(array: any, pageNumber: any, pageSize: any): any;
3
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArrayUtil = void 0;
4
+ class ArrayUtil {
5
+ static paginate(array, pageNumber, pageSize) {
6
+ return array.slice((pageNumber - 1) * pageSize, pageNumber * pageSize);
7
+ }
8
+ }
9
+ exports.ArrayUtil = ArrayUtil;
10
+ //# sourceMappingURL=array.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array.util.js","sourceRoot":"","sources":["../../../src/util/array.util.ts"],"names":[],"mappings":";;;AAAA,MAAa,SAAS;IACpB,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ;QAEzC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,GAAG,QAAQ,EAAE,UAAU,GAAG,QAAQ,CAAC,CAAC;IACzE,CAAC;CACF;AALD,8BAKC"}
@@ -1,2 +1,3 @@
1
1
  export * from "./string.util";
2
+ export * from "./array.util";
2
3
  export * from "./locale.util";
@@ -11,5 +11,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./string.util"), exports);
14
+ __exportStar(require("./array.util"), exports);
14
15
  __exportStar(require("./locale.util"), exports);
15
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA8B;AAC9B,gDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA8B;AAC9B,+CAA6B;AAC7B,gDAA8B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cryptexlabs/codex-nodejs-common",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Common code for Assistant applications",
5
5
  "main": "lib/src/index.js",
6
6
  "repository": "git@gitlab.com:cryptexlabs/public/codex-nodejs-common.git",
@@ -0,0 +1,6 @@
1
+ export class ArrayUtil {
2
+ static paginate(array, pageNumber, pageSize) {
3
+ // human-readable page numbers usually start with 1, so we reduce 1 in the first argument
4
+ return array.slice((pageNumber - 1) * pageSize, pageNumber * pageSize);
5
+ }
6
+ }
package/src/util/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from "./string.util";
2
+ export * from "./array.util";
2
3
  export * from "./locale.util";