@nexim/action-state 1.0.3 → 1.0.4

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/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.4](https://github.com/the-nexim/nanolib/compare/@nexim/action-state@1.0.3...@nexim/action-state@1.0.4) (2025-11-22)
7
+
8
+ **Note:** Version bump only for package @nexim/action-state
9
+
6
10
  ## [1.0.3](https://github.com/the-nexim/nanolib/compare/@nexim/action-state@1.0.2...@nexim/action-state@1.0.3) (2025-08-30)
7
11
 
8
12
  **Note:** Version bump only for package @nexim/action-state
package/dist/main.cjs CHANGED
@@ -1,34 +1,4 @@
1
- /* @nexim/action-state v1.0.3 */
2
- "use strict";
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/main.ts
22
- var main_exports = {};
23
- __export(main_exports, {
24
- actionState: () => actionState
25
- });
26
- module.exports = __toCommonJS(main_exports);
27
- var import_package_tracer = require("@alwatr/package-tracer");
28
- __dev_mode__: import_package_tracer.packageTracer.add("@nexim/action-state", "1.0.3");
29
- var actionState = (state, actionRecord, thisArg = null) => {
30
- const action = actionRecord[state];
31
- if (action == null) return;
32
- return action.call(thisArg);
33
- };
1
+ /** 📦 @nexim/action-state v1.0.4 */
2
+ __dev_mode__: console.debug("📦 @nexim/action-state v1.0.4");
3
+ "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:true}),mod);var main_exports={};__export(main_exports,{actionState:()=>actionState});module.exports=__toCommonJS(main_exports);var import_package_tracer=require("@alwatr/package-tracer");__dev_mode__:import_package_tracer.packageTracer.add("@nexim/action-state","1.0.4");var actionState=(state,actionRecord,thisArg=null)=>{const action=actionRecord[state];if(action==null)return;return action.call(thisArg)};
34
4
  //# sourceMappingURL=main.cjs.map
package/dist/main.cjs.map CHANGED
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
4
  "sourcesContent": ["import { packageTracer } from '@alwatr/package-tracer';\n\n__dev_mode__: packageTracer.add(__package_name__, __package_version__);\n\n/**\n * Executes a state-specific action.\n *\n * @typeParam R - The return type of the action.\n * @typeParam T - The type of the state.\n *\n * @param state - The current state.\n * @param actionRecord - A record mapping states to actions.\n * @param thisArg - The `this` context for the action. Defaults to `null`.\n *\n * @returns The result of the action, or `undefined` if no action is defined for the given state.\n *\n * @example\n * ```typescript\n * const state = 'loading';\n * const actions = {\n * loading: () => showSpinner(),\n * error: () => showError(),\n * success: () => showContent()\n * };\n *\n * actionState(state, actions); // Will execute showSpinner()\n * ```\n */\nexport const actionState = <R, T extends string>(\n state: T,\n actionRecord: Partial<Record<T, () => R>>,\n thisArg: unknown = null,\n): R | undefined => {\n const action = actionRecord[state];\n if (action == null) return;\n\n return action.call(thisArg);\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA8B;AAE9B,aAAc,qCAAc,IAAI,uBAAkB,OAAmB;AA0B9D,IAAM,cAAc,CACzB,OACA,cACA,UAAmB,SACD;AAClB,QAAM,SAAS,aAAa,KAAK;AACjC,MAAI,UAAU,KAAM;AAEpB,SAAO,OAAO,KAAK,OAAO;AAC5B;",
5
+ "mappings": ";;qqBAAA,6IAA8B,kCAE9B,aAAc,oCAAc,IAAI,sBAAkB,OAAmB,EA0B9D,IAAM,YAAc,CACzB,MACA,aACA,QAAmB,OACD,CAClB,MAAM,OAAS,aAAa,KAAK,EACjC,GAAI,QAAU,KAAM,OAEpB,OAAO,OAAO,KAAK,OAAO,CAC5B",
6
6
  "names": []
7
7
  }
package/dist/main.mjs CHANGED
@@ -1,14 +1,4 @@
1
- /* @nexim/action-state v1.0.3 */
2
-
3
- // src/main.ts
4
- import { packageTracer } from "@alwatr/package-tracer";
5
- __dev_mode__: packageTracer.add("@nexim/action-state", "1.0.3");
6
- var actionState = (state, actionRecord, thisArg = null) => {
7
- const action = actionRecord[state];
8
- if (action == null) return;
9
- return action.call(thisArg);
10
- };
11
- export {
12
- actionState
13
- };
1
+ /** 📦 @nexim/action-state v1.0.4 */
2
+ __dev_mode__: console.debug("📦 @nexim/action-state v1.0.4");
3
+ import{packageTracer}from"@alwatr/package-tracer";__dev_mode__:packageTracer.add("@nexim/action-state","1.0.4");var actionState=(state,actionRecord,thisArg=null)=>{const action=actionRecord[state];if(action==null)return;return action.call(thisArg)};export{actionState};
14
4
  //# sourceMappingURL=main.mjs.map
package/dist/main.mjs.map CHANGED
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
4
  "sourcesContent": ["import { packageTracer } from '@alwatr/package-tracer';\n\n__dev_mode__: packageTracer.add(__package_name__, __package_version__);\n\n/**\n * Executes a state-specific action.\n *\n * @typeParam R - The return type of the action.\n * @typeParam T - The type of the state.\n *\n * @param state - The current state.\n * @param actionRecord - A record mapping states to actions.\n * @param thisArg - The `this` context for the action. Defaults to `null`.\n *\n * @returns The result of the action, or `undefined` if no action is defined for the given state.\n *\n * @example\n * ```typescript\n * const state = 'loading';\n * const actions = {\n * loading: () => showSpinner(),\n * error: () => showError(),\n * success: () => showContent()\n * };\n *\n * actionState(state, actions); // Will execute showSpinner()\n * ```\n */\nexport const actionState = <R, T extends string>(\n state: T,\n actionRecord: Partial<Record<T, () => R>>,\n thisArg: unknown = null,\n): R | undefined => {\n const action = actionRecord[state];\n if (action == null) return;\n\n return action.call(thisArg);\n};\n"],
5
- "mappings": ";;;AAAA,SAAS,qBAAqB;AAE9B,aAAc,eAAc,IAAI,uBAAkB,OAAmB;AA0B9D,IAAM,cAAc,CACzB,OACA,cACA,UAAmB,SACD;AAClB,QAAM,SAAS,aAAa,KAAK;AACjC,MAAI,UAAU,KAAM;AAEpB,SAAO,OAAO,KAAK,OAAO;AAC5B;",
5
+ "mappings": ";;AAAA,OAAS,kBAAqB,yBAE9B,aAAc,cAAc,IAAI,sBAAkB,OAAmB,EA0B9D,IAAM,YAAc,CACzB,MACA,aACA,QAAmB,OACD,CAClB,MAAM,OAAS,aAAa,KAAK,EACjC,GAAI,QAAU,KAAM,OAEpB,OAAO,OAAO,KAAK,OAAO,CAC5B",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexim/action-state",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "A utility function to execute state-specific actions with TypeScript type safety.",
5
5
  "keywords": [
6
6
  "state",
@@ -43,16 +43,16 @@
43
43
  "watch": "wireit"
44
44
  },
45
45
  "dependencies": {
46
- "@alwatr/package-tracer": "^5.5.6"
46
+ "@alwatr/package-tracer": "^5.5.23"
47
47
  },
48
48
  "devDependencies": {
49
- "@alwatr/nano-build": "^6.0.1",
49
+ "@alwatr/nano-build": "^6.3.9",
50
50
  "@nexim/typescript-config": "^2.0.1",
51
51
  "ava": "^6.4.1",
52
- "typedoc": "^0.28.11",
53
- "typedoc-plugin-markdown": "^4.8.1",
52
+ "typedoc": "^0.28.14",
53
+ "typedoc-plugin-markdown": "^4.9.0",
54
54
  "typedoc-plugin-no-inherit": "^1.6.1",
55
- "typescript": "^5.9.2",
55
+ "typescript": "^5.9.3",
56
56
  "wireit": "^0.14.12"
57
57
  },
58
58
  "publishConfig": {
@@ -105,5 +105,5 @@
105
105
  "command": "typedoc"
106
106
  }
107
107
  },
108
- "gitHead": "e9784c58e523a33fc5dc6959559ba60cbdd55ab1"
108
+ "gitHead": "aa1bbda5f949163da8a2e11e658afe02aad75458"
109
109
  }