Initial commit - Event Planner application

This commit is contained in:
mberlin
2026-03-18 14:55:56 -03:00
commit 86d779eb4d
7548 changed files with 1006324 additions and 0 deletions

View File

@@ -0,0 +1 @@
export declare function generateOptionsInjectionToken(): string;

View File

@@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateOptionsInjectionToken = generateOptionsInjectionToken;
const random_string_generator_util_1 = require("../../utils/random-string-generator.util");
function generateOptionsInjectionToken() {
const hash = (0, random_string_generator_util_1.randomStringGenerator)();
return `CONFIGURABLE_MODULE_OPTIONS[${hash}]`;
}

View File

@@ -0,0 +1,8 @@
import { FactoryProvider, Provider } from '../../interfaces';
/**
*
* @param providers List of a module's providers
* @param tokens Injection tokens needed for a useFactory function (usually the module's options' token)
* @returns All the providers needed for the tokens' injection (searched recursively)
*/
export declare function getInjectionProviders(providers: Provider[], tokens: FactoryProvider['inject']): Provider[];

View File

@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getInjectionProviders = getInjectionProviders;
const shared_utils_1 = require("../../utils/shared.utils");
/**
* @param value
* @returns `true` if value is `OptionalFactoryDependency`
*/
function isOptionalFactoryDependency(value) {
return (!(0, shared_utils_1.isUndefined)(value.token) &&
!(0, shared_utils_1.isUndefined)(value.optional) &&
!value.prototype);
}
const mapInjectToTokens = (t) => isOptionalFactoryDependency(t) ? t.token : t;
/**
*
* @param providers List of a module's providers
* @param tokens Injection tokens needed for a useFactory function (usually the module's options' token)
* @returns All the providers needed for the tokens' injection (searched recursively)
*/
function getInjectionProviders(providers, tokens) {
const result = [];
let search = tokens.map(mapInjectToTokens);
while (search.length > 0) {
const match = (providers ?? []).filter(p => !result.includes(p) && // this prevents circular loops and duplication
(search.includes(p) || search.includes(p?.provide)));
result.push(...match);
// get injection tokens of the matched providers, if any
search = match
.filter(p => p?.inject)
.flatMap(p => p.inject)
.map(mapInjectToTokens);
}
return result;
}

View File

@@ -0,0 +1,2 @@
export * from './generate-options-injection-token.util';
export * from './get-injection-providers.util';

View File

@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./generate-options-injection-token.util"), exports);
tslib_1.__exportStar(require("./get-injection-providers.util"), exports);