@deessejs/functions 0.0.40 → 0.0.41

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.
@@ -1,18 +1,19 @@
1
1
  "use strict";
2
- // defineContext.ts
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.defineContext = defineContext;
5
4
  function defineContext() {
6
5
  return {
7
6
  withExtensions: (config) => {
8
- // Créer un contexte avec un type explicite
9
- const contextWithType = {};
10
- // Appliquer les extensions manuellement pour préserver les types
7
+ // Créer un contexte runtime vide mais avec le type complet
8
+ const runtimeContext = {};
9
+ // Appliquer les extensions en préservant les types
11
10
  const result = {
12
- context: contextWithType,
11
+ context: runtimeContext,
13
12
  };
14
13
  for (const extension of config.extensions) {
15
- const methods = extension.functions(contextWithType);
14
+ // Forcer TypeScript à voir functions comme une fonction qui retourne une fonction
15
+ const methodsFactory = extension.functions(undefined);
16
+ const methods = methodsFactory(runtimeContext);
16
17
  Object.assign(result, methods);
17
18
  }
18
19
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deessejs/functions",
3
- "version": "0.0.40",
3
+ "version": "0.0.41",
4
4
  "description": "A powerful utility library for building type-safe APIs and functions with context management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",