@almadar/std 1.0.14 → 2.0.0

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.
@@ -4,12 +4,29 @@ var ASYNC_OPERATORS = {
4
4
  module: "async",
5
5
  category: "std-async",
6
6
  minArity: 1,
7
- maxArity: 1,
8
- description: "Wait for specified milliseconds",
7
+ maxArity: 2,
8
+ description: "Wait for specified milliseconds, optionally execute an effect after",
9
9
  hasSideEffects: true,
10
- returnType: "void",
11
- params: [{ name: "ms", type: "number", description: "Milliseconds to wait" }],
12
- example: '["async/delay", 2000] // Wait 2 seconds'
10
+ returnType: "any",
11
+ params: [
12
+ { name: "ms", type: "number", description: "Milliseconds to wait" },
13
+ { name: "effect", type: "expression", description: "Optional effect to execute after delay" }
14
+ ],
15
+ example: '["async/delay", 2000, ["emit", "RETRY"]] // Wait 2s then emit'
16
+ },
17
+ "async/interval": {
18
+ module: "async",
19
+ category: "std-async",
20
+ minArity: 2,
21
+ maxArity: 2,
22
+ description: "Execute an effect periodically at a fixed interval",
23
+ hasSideEffects: true,
24
+ returnType: "string",
25
+ params: [
26
+ { name: "ms", type: "number", description: "Interval in milliseconds" },
27
+ { name: "effect", type: "expression", description: "Effect to execute each interval" }
28
+ ],
29
+ example: '["async/interval", 5000, ["emit", "POLL_TICK"]] // Emit every 5s'
13
30
  },
14
31
  "async/timeout": {
15
32
  module: "async",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../modules/async.ts"],"names":[],"mappings":";AAeO,IAAM,eAAA,GAAmD;AAAA,EAC9D,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,iCAAA;AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,MAAA;AAAA,IACZ,MAAA,EAAQ,CAAC,EAAE,IAAA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,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,IAAA;AAAA,IACV,WAAA,EAAa,uDAAA;AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,OAAA;AAAA,IACZ,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,cAAc,IAAA,EAAM,cAAA,EAAgB,WAAA,EAAa,oBAAA,EAAsB,CAAA;AAAA,IACxF,OAAA,EAAS;AAAA,GACX;AAAA,EACA,gBAAA,EAAkB;AAAA,IAChB,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,IAAA;AAAA,IACV,WAAA,EAAa,iDAAA;AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,OAAA;AAAA,IACZ,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,cAAc,IAAA,EAAM,cAAA,EAAgB,WAAA,EAAa,6BAAA,EAA+B,CAAA;AAAA,IACjG,OAAA,EAAS;AAAA;AAEb;AAKO,SAAS,iBAAA,GAA8B;AAC5C,EAAA,OAAO,MAAA,CAAO,KAAK,eAAe,CAAA;AACpC","file":"async.js","sourcesContent":["/**\n * Async Module - Asynchronous Operations\n *\n * Provides functions for handling async operations, delays, and timing.\n * These operators have side effects as they affect execution timing.\n *\n * @packageDocumentation\n */\n\nimport type { StdOperatorMeta } from '../types.js';\n\n/**\n * Async module operators.\n * These operators control execution timing and have side effects.\n */\nexport const ASYNC_OPERATORS: Record<string, StdOperatorMeta> = {\n 'async/delay': {\n module: 'async',\n category: 'std-async',\n minArity: 1,\n maxArity: 1,\n description: 'Wait for specified milliseconds',\n hasSideEffects: true,\n returnType: 'void',\n params: [{ name: 'ms', type: 'number', description: 'Milliseconds to wait' }],\n example: '[\"async/delay\", 2000] // Wait 2 seconds',\n },\n 'async/timeout': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Add timeout to an effect',\n hasSideEffects: true,\n returnType: 'any',\n params: [\n { name: 'effect', type: 'expression', description: 'Effect to execute' },\n { name: 'ms', type: 'number', description: 'Timeout in milliseconds' },\n ],\n example: '[\"async/timeout\", [\"call\", \"api\", \"fetchData\"], 5000]',\n },\n 'async/debounce': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Debounce an event (wait for pause in events)',\n hasSideEffects: true,\n returnType: 'void',\n params: [\n { name: 'event', type: 'string', description: 'Event name to emit' },\n { name: 'ms', type: 'number', description: 'Debounce delay in milliseconds' },\n ],\n example: '[\"async/debounce\", \"SEARCH\", 300]',\n },\n 'async/throttle': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Throttle an event (emit at most once per interval)',\n hasSideEffects: true,\n returnType: 'void',\n params: [\n { name: 'event', type: 'string', description: 'Event name to emit' },\n { name: 'ms', type: 'number', description: 'Throttle interval in milliseconds' },\n ],\n example: '[\"async/throttle\", \"SCROLL\", 100]',\n },\n 'async/retry': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Retry an effect with configurable backoff',\n hasSideEffects: true,\n returnType: 'any',\n params: [\n { name: 'effect', type: 'expression', description: 'Effect to retry' },\n { name: 'opts', type: 'object', description: '{ attempts, backoff, baseDelay }' },\n ],\n example: `[\"async/retry\",\n [\"call\", \"api\", \"fetchData\", { \"id\": \"@entity.id\" }],\n { \"attempts\": 3, \"backoff\": \"exponential\", \"baseDelay\": 1000 }]`,\n },\n 'async/race': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: null,\n description: 'Execute effects in parallel, return first to complete',\n hasSideEffects: true,\n returnType: 'any',\n params: [{ name: '...effects', type: 'expression[]', description: 'Effects to race' }],\n example: '[\"async/race\", [\"call\", \"api1\"], [\"call\", \"api2\"]]',\n },\n 'async/all': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: null,\n description: 'Execute effects in parallel, wait for all to complete',\n hasSideEffects: true,\n returnType: 'array',\n params: [{ name: '...effects', type: 'expression[]', description: 'Effects to execute' }],\n example: '[\"async/all\", [\"call\", \"api1\"], [\"call\", \"api2\"]]',\n },\n 'async/sequence': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: null,\n description: 'Execute effects in sequence (one after another)',\n hasSideEffects: true,\n returnType: 'array',\n params: [{ name: '...effects', type: 'expression[]', description: 'Effects to execute in order' }],\n example: '[\"async/sequence\", [\"call\", \"validate\"], [\"call\", \"save\"]]',\n },\n};\n\n/**\n * Get all async operator names.\n */\nexport function getAsyncOperators(): string[] {\n return Object.keys(ASYNC_OPERATORS);\n}\n"]}
1
+ {"version":3,"sources":["../../modules/async.ts"],"names":[],"mappings":";AAeO,IAAM,eAAA,GAAmD;AAAA,EAC9D,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,qEAAA;AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,KAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,IAAA,EAAM,IAAA,EAAM,QAAA,EAAU,aAAa,sBAAA,EAAuB;AAAA,MAClE,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,YAAA,EAAc,aAAa,wCAAA;AAAyC,KAC9F;AAAA,IACA,OAAA,EAAS;AAAA,GACX;AAAA,EACA,gBAAA,EAAkB;AAAA,IAChB,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,oDAAA;AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,QAAA;AAAA,IACZ,MA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,CAAA;AAAA,IACrF,OAAA,EAAS;AAAA,GACX;AAAA,EACA,WAAA,EAAa;AAAA,IACX,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,IAAA;AAAA,IACV,WAAA,EAAa,uDAAA;AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,OAAA;AAAA,IACZ,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,cAAc,IAAA,EAAM,cAAA,EAAgB,WAAA,EAAa,oBAAA,EAAsB,CAAA;AAAA,IACxF,OAAA,EAAS;AAAA,GACX;AAAA,EACA,gBAAA,EAAkB;AAAA,IAChB,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,IAAA;AAAA,IACV,WAAA,EAAa,iDAAA;AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,OAAA;AAAA,IACZ,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,cAAc,IAAA,EAAM,cAAA,EAAgB,WAAA,EAAa,6BAAA,EAA+B,CAAA;AAAA,IACjG,OAAA,EAAS;AAAA;AAEb;AAKO,SAAS,iBAAA,GAA8B;AAC5C,EAAA,OAAO,MAAA,CAAO,KAAK,eAAe,CAAA;AACpC","file":"async.js","sourcesContent":["/**\n * Async Module - Asynchronous Operations\n *\n * Provides functions for handling async operations, delays, and timing.\n * These operators have side effects as they affect execution timing.\n *\n * @packageDocumentation\n */\n\nimport type { StdOperatorMeta } from '../types.js';\n\n/**\n * Async module operators.\n * These operators control execution timing and have side effects.\n */\nexport const ASYNC_OPERATORS: Record<string, StdOperatorMeta> = {\n 'async/delay': {\n module: 'async',\n category: 'std-async',\n minArity: 1,\n maxArity: 2,\n description: 'Wait for specified milliseconds, optionally execute an effect after',\n hasSideEffects: true,\n returnType: 'any',\n params: [\n { name: 'ms', type: 'number', description: 'Milliseconds to wait' },\n { name: 'effect', type: 'expression', description: 'Optional effect to execute after delay' },\n ],\n example: '[\"async/delay\", 2000, [\"emit\", \"RETRY\"]] // Wait 2s then emit',\n },\n 'async/interval': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Execute an effect periodically at a fixed interval',\n hasSideEffects: true,\n returnType: 'string',\n params: [\n { name: 'ms', type: 'number', description: 'Interval in milliseconds' },\n { name: 'effect', type: 'expression', description: 'Effect to execute each interval' },\n ],\n example: '[\"async/interval\", 5000, [\"emit\", \"POLL_TICK\"]] // Emit every 5s',\n },\n 'async/timeout': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Add timeout to an effect',\n hasSideEffects: true,\n returnType: 'any',\n params: [\n { name: 'effect', type: 'expression', description: 'Effect to execute' },\n { name: 'ms', type: 'number', description: 'Timeout in milliseconds' },\n ],\n example: '[\"async/timeout\", [\"call\", \"api\", \"fetchData\"], 5000]',\n },\n 'async/debounce': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Debounce an event (wait for pause in events)',\n hasSideEffects: true,\n returnType: 'void',\n params: [\n { name: 'event', type: 'string', description: 'Event name to emit' },\n { name: 'ms', type: 'number', description: 'Debounce delay in milliseconds' },\n ],\n example: '[\"async/debounce\", \"SEARCH\", 300]',\n },\n 'async/throttle': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Throttle an event (emit at most once per interval)',\n hasSideEffects: true,\n returnType: 'void',\n params: [\n { name: 'event', type: 'string', description: 'Event name to emit' },\n { name: 'ms', type: 'number', description: 'Throttle interval in milliseconds' },\n ],\n example: '[\"async/throttle\", \"SCROLL\", 100]',\n },\n 'async/retry': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: 2,\n description: 'Retry an effect with configurable backoff',\n hasSideEffects: true,\n returnType: 'any',\n params: [\n { name: 'effect', type: 'expression', description: 'Effect to retry' },\n { name: 'opts', type: 'object', description: '{ attempts, backoff, baseDelay }' },\n ],\n example: `[\"async/retry\",\n [\"call\", \"api\", \"fetchData\", { \"id\": \"@entity.id\" }],\n { \"attempts\": 3, \"backoff\": \"exponential\", \"baseDelay\": 1000 }]`,\n },\n 'async/race': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: null,\n description: 'Execute effects in parallel, return first to complete',\n hasSideEffects: true,\n returnType: 'any',\n params: [{ name: '...effects', type: 'expression[]', description: 'Effects to race' }],\n example: '[\"async/race\", [\"call\", \"api1\"], [\"call\", \"api2\"]]',\n },\n 'async/all': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: null,\n description: 'Execute effects in parallel, wait for all to complete',\n hasSideEffects: true,\n returnType: 'array',\n params: [{ name: '...effects', type: 'expression[]', description: 'Effects to execute' }],\n example: '[\"async/all\", [\"call\", \"api1\"], [\"call\", \"api2\"]]',\n },\n 'async/sequence': {\n module: 'async',\n category: 'std-async',\n minArity: 2,\n maxArity: null,\n description: 'Execute effects in sequence (one after another)',\n hasSideEffects: true,\n returnType: 'array',\n params: [{ name: '...effects', type: 'expression[]', description: 'Effects to execute in order' }],\n example: '[\"async/sequence\", [\"call\", \"validate\"], [\"call\", \"save\"]]',\n },\n};\n\n/**\n * Get all async operator names.\n */\nexport function getAsyncOperators(): string[] {\n return Object.keys(ASYNC_OPERATORS);\n}\n"]}
@@ -2119,12 +2119,29 @@ var ASYNC_OPERATORS = {
2119
2119
  module: "async",
2120
2120
  category: "std-async",
2121
2121
  minArity: 1,
2122
- maxArity: 1,
2123
- description: "Wait for specified milliseconds",
2122
+ maxArity: 2,
2123
+ description: "Wait for specified milliseconds, optionally execute an effect after",
2124
2124
  hasSideEffects: true,
2125
- returnType: "void",
2126
- params: [{ name: "ms", type: "number", description: "Milliseconds to wait" }],
2127
- example: '["async/delay", 2000] // Wait 2 seconds'
2125
+ returnType: "any",
2126
+ params: [
2127
+ { name: "ms", type: "number", description: "Milliseconds to wait" },
2128
+ { name: "effect", type: "expression", description: "Optional effect to execute after delay" }
2129
+ ],
2130
+ example: '["async/delay", 2000, ["emit", "RETRY"]] // Wait 2s then emit'
2131
+ },
2132
+ "async/interval": {
2133
+ module: "async",
2134
+ category: "std-async",
2135
+ minArity: 2,
2136
+ maxArity: 2,
2137
+ description: "Execute an effect periodically at a fixed interval",
2138
+ hasSideEffects: true,
2139
+ returnType: "string",
2140
+ params: [
2141
+ { name: "ms", type: "number", description: "Interval in milliseconds" },
2142
+ { name: "effect", type: "expression", description: "Effect to execute each interval" }
2143
+ ],
2144
+ example: '["async/interval", 5000, ["emit", "POLL_TICK"]] // Emit every 5s'
2128
2145
  },
2129
2146
  "async/timeout": {
2130
2147
  module: "async",