@luminix/support 0.0.1-beta.0 → 0.0.1-beta.19
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/dist/support.js +8448 -0
- package/package.json +6 -5
- package/types/App/Application.d.ts +23 -0
- package/types/App/Interfaces.d.ts +35 -0
- package/types/App/ServiceProvider.d.ts +8 -0
- package/types/Arr.d.ts +25 -0
- package/types/Collection.d.ts +184 -0
- package/types/Contracts/EventSource.d.ts +18 -0
- package/types/DateTime.d.ts +2 -0
- package/types/Exceptions/NoEmbedException.d.ts +4 -0
- package/types/Exceptions/ReducerOverrideException.d.ts +4 -0
- package/types/Func.d.ts +3 -0
- package/types/Http/Client.d.ts +27 -0
- package/types/Http/Request.d.ts +11 -0
- package/types/Http/Response.d.ts +42 -0
- package/types/Http/Utils/isValidationError.d.ts +8 -0
- package/types/Js.d.ts +6 -0
- package/types/Mixins/Macroable.d.ts +29 -0
- package/types/Mixins/MakeFacade.d.ts +7 -0
- package/types/Mixins/Reducible.d.ts +29 -0
- package/types/Obj.d.ts +20 -0
- package/types/PropertyBag.d.ts +24 -0
- package/types/Query.d.ts +4 -0
- package/types/Str.d.ts +18 -0
- package/types/index.d.ts +33 -0
- package/types/reader.d.ts +2 -0
- package/vite.config.js +0 -5
- package/src/App/ServiceContainer.ts +0 -32
- package/src/App/index.ts +0 -27
- package/src/Arr.ts +0 -33
- package/src/Collection.ts +0 -1398
- package/src/Contracts/EventSource.ts +0 -46
- package/src/Exceptions/ReducerOverrideException.ts +0 -8
- package/src/Http/Client.ts +0 -139
- package/src/Http/Request.ts +0 -45
- package/src/Http/Response.ts +0 -170
- package/src/Http/index.ts +0 -90
- package/src/Js.ts +0 -5
- package/src/Mixins/Macroable.ts +0 -81
- package/src/Mixins/Reducible.ts +0 -126
- package/src/Obj.ts +0 -70
- package/src/Query.ts +0 -29
- package/src/Services/ApplicationService.ts +0 -7
- package/src/Str.ts +0 -53
- package/src/index.ts +0 -26
package/vite.config.js
CHANGED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export default class ServiceContainer<TServices extends Map<string, any> = Map<string, any>> {
|
|
7
|
-
|
|
8
|
-
private services: TServices = new Map() as TServices;
|
|
9
|
-
|
|
10
|
-
bind<K extends keyof TServices>(abstract: K, concrete: () => TServices[K]): void {
|
|
11
|
-
if (typeof abstract !== 'string') {
|
|
12
|
-
throw new TypeError('Service name must be a string.');
|
|
13
|
-
}
|
|
14
|
-
this.services.set(abstract, concrete);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
singleton<K extends keyof TServices>(abstract: K, concrete: TServices[K]): void {
|
|
18
|
-
if (typeof abstract !== 'string') {
|
|
19
|
-
throw new TypeError('Service name must be a string.');
|
|
20
|
-
}
|
|
21
|
-
this.services.set(abstract, concrete);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
get(serviceName: string): any {
|
|
25
|
-
const service = this.services.get(serviceName);
|
|
26
|
-
if (!service) {
|
|
27
|
-
throw new Error(`Service '${serviceName}' is not bound in the container.`);
|
|
28
|
-
}
|
|
29
|
-
return service;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
package/src/App/index.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// export type AppServices = {
|
|
3
|
-
|
|
4
|
-
// };
|
|
5
|
-
|
|
6
|
-
// class App {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// private constructor() {
|
|
10
|
-
// }
|
|
11
|
-
|
|
12
|
-
// private static _instance?: App;
|
|
13
|
-
|
|
14
|
-
// static getInstance() {
|
|
15
|
-
// if (!this._instance) {
|
|
16
|
-
// this._instance = new App();
|
|
17
|
-
// }
|
|
18
|
-
|
|
19
|
-
// return this._instance;
|
|
20
|
-
// }
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// }
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
package/src/Arr.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as _ from 'lodash-es';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* Calculates the Cartesian product of the given arrays.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export function cartesian<T>(...arrays: T[][]): T[][] {
|
|
9
|
-
return arrays.reduce((a, b) => a.flatMap((d) => b.map((e) => [d, e].flat())) as T[]) as T[][];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* Gets an array of random elements from the given `array`.
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
export function sampleSize(array: any[], n: number): any[] {
|
|
19
|
-
return _.sampleSize(array, n);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
* Returns a shuffled copy of `array`.
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
|
-
export function shuffle<T>(array: T[]): T[] {
|
|
29
|
-
return _.shuffle(array);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|