cecon-interfaces 1.5.69 → 1.5.71
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/envelope/interfaces/factory-envelope-array-pag.functions.d.ts +2 -0
- package/dist/envelope/interfaces/factory-envelope-array-pag.functions.js +17 -0
- package/dist/envelope/interfaces/factory-envelope-array.functions.d.ts +2 -0
- package/dist/envelope/interfaces/factory-envelope-array.functions.js +19 -0
- package/dist/envelope/interfaces/factory-envelope.functions.d.ts +2 -0
- package/dist/envelope/interfaces/factory-envelope.functions.js +14 -0
- package/dist/envelope/interfaces/index.d.ts +3 -1
- package/dist/envelope/interfaces/index.js +7 -5
- package/dist/esm2022/envelope/interfaces/factory-envelope-array-pag.functions.mjs +14 -0
- package/dist/esm2022/envelope/interfaces/factory-envelope-array.functions.mjs +15 -0
- package/dist/esm2022/envelope/interfaces/factory-envelope.functions.mjs +11 -0
- package/dist/esm2022/envelope/interfaces/index.mjs +4 -2
- package/dist/fesm2022/cecon-interfaces.mjs +24 -18
- package/dist/fesm2022/cecon-interfaces.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/envelope/interfaces/envelope.functions.d.ts +0 -5
- package/dist/envelope/interfaces/envelope.functions.js +0 -40
- package/dist/esm2022/envelope/interfaces/envelope.functions.mjs +0 -34
package/dist/package.json
CHANGED
package/package.json
CHANGED
@@ -1,5 +0,0 @@
|
|
1
|
-
import { IEnvelope } from './i-envelope';
|
2
|
-
import { IEnvelopeArray } from './i-envelope-array';
|
3
|
-
export declare function factoryEnvelope<T>(data: T | null): IEnvelope<T | null>;
|
4
|
-
export declare function factoryEnvelopeArray<T>(items?: T[]): IEnvelopeArray<T>;
|
5
|
-
export declare function factoryEnvelopeArrayPagination<T>(items: T[], offSet: number, limit: number, total?: number): IEnvelopeArray<T>;
|
@@ -1,40 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
// #region Interfaces (1)
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.factoryEnvelopeArrayPagination = exports.factoryEnvelopeArray = exports.factoryEnvelope = void 0;
|
5
|
-
// Interface for envelope array structure
|
6
|
-
// #endregion Interfaces (1)
|
7
|
-
// #region Functions (3)
|
8
|
-
// Creates a basic envelope with a single item property
|
9
|
-
function factoryEnvelope(data) {
|
10
|
-
return {
|
11
|
-
item: data, // Make item non-nullable for clarity (adjust based on your use case)
|
12
|
-
};
|
13
|
-
}
|
14
|
-
exports.factoryEnvelope = factoryEnvelope;
|
15
|
-
// Creates an envelope containing an array of items, handling empty arrays
|
16
|
-
function factoryEnvelopeArray(items) {
|
17
|
-
if (items === void 0) { items = []; }
|
18
|
-
var data = {
|
19
|
-
offSet: 0,
|
20
|
-
limit: 0,
|
21
|
-
itemsTotal: items.length,
|
22
|
-
total: items.length,
|
23
|
-
items: items,
|
24
|
-
};
|
25
|
-
return data; // Consider returning a frozen copy for immutability
|
26
|
-
}
|
27
|
-
exports.factoryEnvelopeArray = factoryEnvelopeArray;
|
28
|
-
// Creates an envelope containing an array of items with pagination support
|
29
|
-
function factoryEnvelopeArrayPagination(items, offSet, limit, total) {
|
30
|
-
var data = {
|
31
|
-
offSet: offSet,
|
32
|
-
limit: limit,
|
33
|
-
itemsTotal: items.length,
|
34
|
-
total: total || items.length,
|
35
|
-
items: items,
|
36
|
-
};
|
37
|
-
return data; // Consider returning a frozen copy for immutability
|
38
|
-
}
|
39
|
-
exports.factoryEnvelopeArrayPagination = factoryEnvelopeArrayPagination;
|
40
|
-
// #endregion Functions (3)
|
@@ -1,34 +0,0 @@
|
|
1
|
-
// #region Interfaces (1)
|
2
|
-
// Interface for envelope array structure
|
3
|
-
// #endregion Interfaces (1)
|
4
|
-
// #region Functions (3)
|
5
|
-
// Creates a basic envelope with a single item property
|
6
|
-
export function factoryEnvelope(data) {
|
7
|
-
return {
|
8
|
-
item: data, // Make item non-nullable for clarity (adjust based on your use case)
|
9
|
-
};
|
10
|
-
}
|
11
|
-
// Creates an envelope containing an array of items, handling empty arrays
|
12
|
-
export function factoryEnvelopeArray(items = []) {
|
13
|
-
const data = {
|
14
|
-
offSet: 0,
|
15
|
-
limit: 0,
|
16
|
-
itemsTotal: items.length,
|
17
|
-
total: items.length,
|
18
|
-
items,
|
19
|
-
};
|
20
|
-
return data; // Consider returning a frozen copy for immutability
|
21
|
-
}
|
22
|
-
// Creates an envelope containing an array of items with pagination support
|
23
|
-
export function factoryEnvelopeArrayPagination(items, offSet, limit, total) {
|
24
|
-
const data = {
|
25
|
-
offSet,
|
26
|
-
limit,
|
27
|
-
itemsTotal: items.length,
|
28
|
-
total: total || items.length,
|
29
|
-
items,
|
30
|
-
};
|
31
|
-
return data; // Consider returning a frozen copy for immutability
|
32
|
-
}
|
33
|
-
// #endregion Functions (3)
|
34
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW52ZWxvcGUuZnVuY3Rpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2VudmVsb3BlL2ludGVyZmFjZXMvZW52ZWxvcGUuZnVuY3Rpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHlCQUF5QjtBQUt6Qix5Q0FBeUM7QUFFekMsNEJBQTRCO0FBRTVCLHdCQUF3QjtBQUV4Qix1REFBdUQ7QUFDdkQsTUFBTSxVQUFVLGVBQWUsQ0FBSSxJQUFjO0lBQy9DLE9BQU87UUFDTCxJQUFJLEVBQUUsSUFBSSxFQUFFLHFFQUFxRTtLQUNsRixDQUFDO0FBQ0osQ0FBQztBQUVELDBFQUEwRTtBQUMxRSxNQUFNLFVBQVUsb0JBQW9CLENBQUksUUFBYSxFQUFFO0lBQ3JELE1BQU0sSUFBSSxHQUFzQjtRQUM5QixNQUFNLEVBQUUsQ0FBQztRQUNULEtBQUssRUFBRSxDQUFDO1FBQ1IsVUFBVSxFQUFFLEtBQUssQ0FBQyxNQUFNO1FBQ3hCLEtBQUssRUFBRSxLQUFL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