ctx-core 5.25.4 → 5.25.5

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.
Files changed (2) hide show
  1. package/all/event_log/index.js +17 -14
  2. package/package.json +252 -253
@@ -1,20 +1,23 @@
1
- import { be_memo_pair_ } from '../be_memo_pair/index.js'
2
1
  import { be_sig_triple_ } from '../be_sig_triple/index.js'
2
+ import { memo_ } from '../rmemo/index.js'
3
3
  const [
4
- ,
5
- _event_log_,
6
- _event_log__set,
7
- ] = be_sig_triple_(()=>[])
8
- export const [
9
4
  event_log$_,
10
5
  event_log_,
11
- ] = be_memo_pair_(ctx=>{
12
- if (_event_log_(ctx)?.length > event_log_limit_(ctx)) {
13
- _event_log_(ctx).splice(event_log_limit_(ctx))
14
- }
15
- return _event_log_(ctx).slice()
16
- }, { id: 'event_log' })
17
- export { event_log$_ as event_log__ }
6
+ event_log__set,
7
+ ] = be_sig_triple_(
8
+ ()=>[],
9
+ { id: 'event_log' }
10
+ ).add((ctx, event_log$)=>
11
+ memo_(()=>{
12
+ if (event_log$().length > event_log_limit_(ctx)) {
13
+ event_log$().splice(event_log$().length - event_log_limit_(ctx) + 1)
14
+ }
15
+ }))
16
+ export {
17
+ event_log$_,
18
+ event_log_,
19
+ event_log$_ as event_log__
20
+ }
18
21
  export const [
19
22
  event_log_limit$_,
20
23
  event_log_limit_,
@@ -22,5 +25,5 @@ export const [
22
25
  ] = be_sig_triple_(()=>10000)
23
26
  export { event_log_limit__set as event_log__set_limit, }
24
27
  export function event_log__add(ctx, record) {
25
- _event_log__set(ctx, [record, ..._event_log_(ctx)])
28
+ event_log__set(ctx, [record, ...(event_log$_(ctx).val ?? [])])
26
29
  }
package/package.json CHANGED
@@ -1,254 +1,253 @@
1
1
  {
2
- "name": "ctx-core",
3
- "version": "5.25.4",
4
- "description": "ctx-core core library",
5
- "keywords": [
6
- "ctx-core",
7
- "array",
8
- "combinators",
9
- "function",
10
- "object",
11
- "set"
12
- ],
13
- "homepage": "https://github.com/ctx-core/ctx-core#readme",
14
- "bugs": {
15
- "url": "https://github.com/ctx-core/ctx-core/issues"
16
- },
17
- "repository": {
18
- "type": "git",
19
- "url": "https://github.com/ctx-core/ctx-core.git"
20
- },
21
- "license": "Apache-2.0",
22
- "author": "Brian Takita",
23
- "type": "module",
24
- "files": [
25
- "*.d.ts",
26
- "*.js",
27
- "*.json",
28
- "all",
29
- "array",
30
- "atob",
31
- "base16",
32
- "be",
33
- "btoa",
34
- "buffer",
35
- "chain",
36
- "class",
37
- "cli-args",
38
- "color",
39
- "combinators",
40
- "crypto",
41
- "currency",
42
- "data",
43
- "date",
44
- "debounce",
45
- "deep_equal",
46
- "env",
47
- "error",
48
- "event_log",
49
- "falsy",
50
- "fetch",
51
- "fibonacci",
52
- "fs",
53
- "function",
54
- "functional",
55
- "html",
56
- "http",
57
- "math",
58
- "matrix",
59
- "nullish",
60
- "number",
61
- "object",
62
- "promise",
63
- "queue",
64
- "random",
65
- "regex",
66
- "rmemo",
67
- "run",
68
- "set",
69
- "sleep",
70
- "stream",
71
- "string",
72
- "tempfile",
73
- "test",
74
- "time",
75
- "tuple",
76
- "types",
77
- "uri",
78
- "uuid",
79
- "package.json"
80
- ],
81
- "exports": {
82
- ".": "./index.js",
83
- "./all": "./all/index.js",
84
- "./array": "./array/index.js",
85
- "./atob": "./atob/index.js",
86
- "./base16": "./base16/index.js",
87
- "./be": "./be/index.js",
88
- "./btoa": "./btoa/index.js",
89
- "./buffer": "./buffer/index.js",
90
- "./chain": "./chain/index.js",
91
- "./class": "./class/index.js",
92
- "./cli-args": "./cli-args/index.js",
93
- "./color": "./color/index.js",
94
- "./combinators": "./combinators/index.js",
95
- "./crypto": "./crypto/index.js",
96
- "./currency": "./currency/index.js",
97
- "./data": "./data/index.js",
98
- "./date": "./date/index.js",
99
- "./debounce": "./debounce/index.js",
100
- "./deep_equal": "./deep_equal/index.js",
101
- "./env": "./env/index.js",
102
- "./error": "./error/index.js",
103
- "./event_log": "./event_log/index.js",
104
- "./falsy": "./falsy/index.js",
105
- "./fetch": "./fetch/index.js",
106
- "./fibonacci": "./fibonacci/index.js",
107
- "./fs": "./fs/index.js",
108
- "./function": "./function/index.js",
109
- "./functional": "./functional/index.js",
110
- "./html": "./html/index.js",
111
- "./http": "./http/index.js",
112
- "./math": "./math/index.js",
113
- "./matrix": "./matrix/index.js",
114
- "./nullish": "./nullish/index.js",
115
- "./number": "./number/index.js",
116
- "./object": "./object/index.js",
117
- "./promise": "./promise/index.js",
118
- "./queue": "./queue/index.js",
119
- "./random": "./random/index.js",
120
- "./regex": "./regex/index.js",
121
- "./rmemo": "./rmemo/index.js",
122
- "./run": "./run/index.js",
123
- "./set": "./set/index.js",
124
- "./sleep": "./sleep/index.js",
125
- "./stream": "./stream/index.js",
126
- "./string": "./string/index.js",
127
- "./tempfile": "./tempfile/index.js",
128
- "./test": "./test/index.js",
129
- "./time": "./time/index.js",
130
- "./tuple": "./tuple/index.js",
131
- "./types": "./types/index.js",
132
- "./uri": "./uri/index.js",
133
- "./uuid": "./uuid/index.js",
134
- "./package.json": "./package.json"
135
- },
136
- "scripts": {
137
- "build": ":",
138
- "clean": ":",
139
- "exec": "$@",
140
- "prepublishOnly": "pnpm clean && pnpm build && pnpm test",
141
- "test": "pnpm run /^test:/",
142
- "test:size": "size-limit",
143
- "test:type": "check-dts",
144
- "test:unit": "NODE_OPTIONS=--loader=esmock tsx node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
145
- "disable:test:coverage": "c8 pnpm test:unit"
146
- },
147
- "devDependencies": {
148
- "@arethetypeswrong/cli": "^0.13.5",
149
- "@ctx-core/preprocess": "^0.1.1",
150
- "@size-limit/preset-small-lib": "^11.0.2",
151
- "@types/node": "^20.11.5",
152
- "@types/sinon": "^17.0.3",
153
- "c8": "^9.1.0",
154
- "check-dts": "^0.7.2",
155
- "esbuild": "^0.19.11",
156
- "esmock": "^2.6.2",
157
- "sinon": "^17.0.1",
158
- "size-limit": "^11.0.2",
159
- "tsx": "^4.7.0",
160
- "typescript": "next",
161
- "uvu": "^0.5.6"
162
- },
163
- "publishConfig": {
164
- "access": "public",
165
- "cache": "~/.npm"
166
- },
167
- "sideEffects": false,
168
- "size-limit": [
169
- {
170
- "name": "ctx_",
171
- "import": {
172
- "./be": "{ ctx_ }"
173
- },
174
- "limit": "33 B"
175
- },
176
- {
177
- "name": "ns_ctx_",
178
- "import": {
179
- "./be": "{ ns_ctx_ }"
180
- },
181
- "limit": "85 B"
182
- },
183
- {
184
- "name": "be_",
185
- "import": {
186
- "./be": "{ be_ }"
187
- },
188
- "limit": "99 B"
189
- },
190
- {
191
- "name": "be_ ctx_",
192
- "import": {
193
- "./be": "{ be_, ctx_ }"
194
- },
195
- "limit": "131 B"
196
- },
197
- {
198
- "name": "be_ ns_ctx_",
199
- "import": {
200
- "./be": "{ be_, ctx_, ns_ctx_ }"
201
- },
202
- "limit": "191 B"
203
- },
204
- {
205
- "name": "be_ ctx_ ns_ctx_",
206
- "import": {
207
- "./be": "{ be_, ctx_, ns_ctx_ }"
208
- },
209
- "limit": "191 B"
210
- },
211
- {
212
- "name": "memo_",
213
- "import": {
214
- "./rmemo": "{ memo_ }"
215
- },
216
- "limit": "352 B"
217
- },
218
- {
219
- "name": "memo_ sig_",
220
- "import": {
221
- "./rmemo": "{ sig_, memo_ }"
222
- },
223
- "limit": "370 B"
224
- },
225
- {
226
- "name": "memo_ sig_ be_ ctx_",
227
- "import": {
228
- "./rmemo": "{ sig_, memo_, be_, ctx_ }"
229
- },
230
- "limit": "471 B"
231
- },
232
- {
233
- "name": "memo_ sig_ be_ ctx_ be_memo_pair_ be_sig_triple_",
234
- "import": {
235
- "./rmemo": "{ sig_, memo_, be_, ctx_, be_memo_pair_, be_sig_triple_ }"
236
- },
237
- "limit": "570 B"
238
- },
239
- {
240
- "name": "uuid",
241
- "import": {
242
- "./uuid": "{ uuid_ }"
243
- },
244
- "limit": "39 B"
245
- },
246
- {
247
- "name": "short uuid",
248
- "import": {
249
- "./uuid": "{ short_uuid_ }"
250
- },
251
- "limit": "116 B"
252
- }
253
- ]
254
- }
2
+ "name": "ctx-core",
3
+ "version": "5.25.5",
4
+ "description": "ctx-core core library",
5
+ "keywords": [
6
+ "ctx-core",
7
+ "array",
8
+ "combinators",
9
+ "function",
10
+ "object",
11
+ "set"
12
+ ],
13
+ "homepage": "https://github.com/ctx-core/ctx-core#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/ctx-core/ctx-core/issues"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/ctx-core/ctx-core.git"
20
+ },
21
+ "license": "Apache-2.0",
22
+ "author": "Brian Takita",
23
+ "type": "module",
24
+ "files": [
25
+ "*.d.ts",
26
+ "*.js",
27
+ "*.json",
28
+ "all",
29
+ "array",
30
+ "atob",
31
+ "base16",
32
+ "be",
33
+ "btoa",
34
+ "buffer",
35
+ "chain",
36
+ "class",
37
+ "cli-args",
38
+ "color",
39
+ "combinators",
40
+ "crypto",
41
+ "currency",
42
+ "data",
43
+ "date",
44
+ "debounce",
45
+ "deep_equal",
46
+ "env",
47
+ "error",
48
+ "event_log",
49
+ "falsy",
50
+ "fetch",
51
+ "fibonacci",
52
+ "fs",
53
+ "function",
54
+ "functional",
55
+ "html",
56
+ "http",
57
+ "math",
58
+ "matrix",
59
+ "nullish",
60
+ "number",
61
+ "object",
62
+ "promise",
63
+ "queue",
64
+ "random",
65
+ "regex",
66
+ "rmemo",
67
+ "run",
68
+ "set",
69
+ "sleep",
70
+ "stream",
71
+ "string",
72
+ "tempfile",
73
+ "test",
74
+ "time",
75
+ "tuple",
76
+ "types",
77
+ "uri",
78
+ "uuid",
79
+ "package.json"
80
+ ],
81
+ "exports": {
82
+ ".": "./index.js",
83
+ "./all": "./all/index.js",
84
+ "./array": "./array/index.js",
85
+ "./atob": "./atob/index.js",
86
+ "./base16": "./base16/index.js",
87
+ "./be": "./be/index.js",
88
+ "./btoa": "./btoa/index.js",
89
+ "./buffer": "./buffer/index.js",
90
+ "./chain": "./chain/index.js",
91
+ "./class": "./class/index.js",
92
+ "./cli-args": "./cli-args/index.js",
93
+ "./color": "./color/index.js",
94
+ "./combinators": "./combinators/index.js",
95
+ "./crypto": "./crypto/index.js",
96
+ "./currency": "./currency/index.js",
97
+ "./data": "./data/index.js",
98
+ "./date": "./date/index.js",
99
+ "./debounce": "./debounce/index.js",
100
+ "./deep_equal": "./deep_equal/index.js",
101
+ "./env": "./env/index.js",
102
+ "./error": "./error/index.js",
103
+ "./event_log": "./event_log/index.js",
104
+ "./falsy": "./falsy/index.js",
105
+ "./fetch": "./fetch/index.js",
106
+ "./fibonacci": "./fibonacci/index.js",
107
+ "./fs": "./fs/index.js",
108
+ "./function": "./function/index.js",
109
+ "./functional": "./functional/index.js",
110
+ "./html": "./html/index.js",
111
+ "./http": "./http/index.js",
112
+ "./math": "./math/index.js",
113
+ "./matrix": "./matrix/index.js",
114
+ "./nullish": "./nullish/index.js",
115
+ "./number": "./number/index.js",
116
+ "./object": "./object/index.js",
117
+ "./promise": "./promise/index.js",
118
+ "./queue": "./queue/index.js",
119
+ "./random": "./random/index.js",
120
+ "./regex": "./regex/index.js",
121
+ "./rmemo": "./rmemo/index.js",
122
+ "./run": "./run/index.js",
123
+ "./set": "./set/index.js",
124
+ "./sleep": "./sleep/index.js",
125
+ "./stream": "./stream/index.js",
126
+ "./string": "./string/index.js",
127
+ "./tempfile": "./tempfile/index.js",
128
+ "./test": "./test/index.js",
129
+ "./time": "./time/index.js",
130
+ "./tuple": "./tuple/index.js",
131
+ "./types": "./types/index.js",
132
+ "./uri": "./uri/index.js",
133
+ "./uuid": "./uuid/index.js",
134
+ "./package.json": "./package.json"
135
+ },
136
+ "devDependencies": {
137
+ "@arethetypeswrong/cli": "^0.13.5",
138
+ "@ctx-core/preprocess": "^0.1.1",
139
+ "@size-limit/preset-small-lib": "^11.0.2",
140
+ "@types/node": "^20.11.5",
141
+ "@types/sinon": "^17.0.3",
142
+ "c8": "^9.1.0",
143
+ "check-dts": "^0.7.2",
144
+ "esbuild": "^0.19.11",
145
+ "esmock": "^2.6.2",
146
+ "sinon": "^17.0.1",
147
+ "size-limit": "^11.0.2",
148
+ "tsx": "^4.7.0",
149
+ "typescript": "next",
150
+ "uvu": "^0.5.6"
151
+ },
152
+ "publishConfig": {
153
+ "access": "public",
154
+ "cache": "~/.npm"
155
+ },
156
+ "sideEffects": false,
157
+ "size-limit": [
158
+ {
159
+ "name": "ctx_",
160
+ "import": {
161
+ "./be": "{ ctx_ }"
162
+ },
163
+ "limit": "33 B"
164
+ },
165
+ {
166
+ "name": "ns_ctx_",
167
+ "import": {
168
+ "./be": "{ ns_ctx_ }"
169
+ },
170
+ "limit": "85 B"
171
+ },
172
+ {
173
+ "name": "be_",
174
+ "import": {
175
+ "./be": "{ be_ }"
176
+ },
177
+ "limit": "99 B"
178
+ },
179
+ {
180
+ "name": "be_ ctx_",
181
+ "import": {
182
+ "./be": "{ be_, ctx_ }"
183
+ },
184
+ "limit": "131 B"
185
+ },
186
+ {
187
+ "name": "be_ ns_ctx_",
188
+ "import": {
189
+ "./be": "{ be_, ctx_, ns_ctx_ }"
190
+ },
191
+ "limit": "191 B"
192
+ },
193
+ {
194
+ "name": "be_ ctx_ ns_ctx_",
195
+ "import": {
196
+ "./be": "{ be_, ctx_, ns_ctx_ }"
197
+ },
198
+ "limit": "191 B"
199
+ },
200
+ {
201
+ "name": "memo_",
202
+ "import": {
203
+ "./rmemo": "{ memo_ }"
204
+ },
205
+ "limit": "352 B"
206
+ },
207
+ {
208
+ "name": "memo_ sig_",
209
+ "import": {
210
+ "./rmemo": "{ sig_, memo_ }"
211
+ },
212
+ "limit": "370 B"
213
+ },
214
+ {
215
+ "name": "memo_ sig_ be_ ctx_",
216
+ "import": {
217
+ "./rmemo": "{ sig_, memo_, be_, ctx_ }"
218
+ },
219
+ "limit": "471 B"
220
+ },
221
+ {
222
+ "name": "memo_ sig_ be_ ctx_ be_memo_pair_ be_sig_triple_",
223
+ "import": {
224
+ "./rmemo": "{ sig_, memo_, be_, ctx_, be_memo_pair_, be_sig_triple_ }"
225
+ },
226
+ "limit": "570 B"
227
+ },
228
+ {
229
+ "name": "uuid",
230
+ "import": {
231
+ "./uuid": "{ uuid_ }"
232
+ },
233
+ "limit": "39 B"
234
+ },
235
+ {
236
+ "name": "short uuid",
237
+ "import": {
238
+ "./uuid": "{ short_uuid_ }"
239
+ },
240
+ "limit": "116 B"
241
+ }
242
+ ],
243
+ "scripts": {
244
+ "build": ":",
245
+ "clean": ":",
246
+ "exec": "$@",
247
+ "test": "pnpm run /^test:/",
248
+ "test:size": "size-limit",
249
+ "test:type": "check-dts",
250
+ "test:unit": "NODE_OPTIONS=--loader=esmock tsx node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
251
+ "disable:test:coverage": "c8 pnpm test:unit"
252
+ }
253
+ }