mol_mutable 0.0.994 → 0.0.995

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mol_mutable",
3
- "version": "0.0.994",
3
+ "version": "0.0.995",
4
4
  "exports": {
5
5
  "node": {
6
6
  "import": "./node.mjs",
package/web.d.ts CHANGED
@@ -6,6 +6,7 @@ declare class $ extends _$_ {
6
6
  declare namespace $ {
7
7
  export type $ = typeof $$;
8
8
  export class $$ extends $ {
9
+ static $: $;
9
10
  }
10
11
  namespace $$ {
11
12
  type $$ = $;
package/web.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../mam.d.ts","../../type/immutable/deep/deep/deep.d.ts","../mutable.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACdA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":[null,null,null]}
1
+ {"version":3,"sources":["../../../mam.d.ts","../../type/immutable/deep/deep/deep.d.ts","../mutable.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACfA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":[null,null,null]}
package/web.deps.json CHANGED
@@ -1 +1 @@
1
- {"files":["mam.ts","LICENSE","README.md","mam.jam.js","tsfmt.json","package.json","tsconfig.json","lang.lang.tree","meta.lang.tree","sandbox.config.json","mol/CNAME","mol/LICENSE","mol/readme.md","mol/mol.meta.tree","mol/CONTRIBUTING.md","mol/CODE_OF_CONDUCT.md","mol/type/README.md","mol/type/immutable/deep/deep/deep.ts","mol/mutable/README.md","mol/mutable/mutable.ts"],"mods":{},"deps_in":{"mol":{"mol/mutable":-999,"mol/type":-999},"":{"mol":-999},"mol/type/immutable/deep/deep":{"mol/mutable":-2},"mol/type/immutable/deep":{"mol/type/immutable/deep/deep":-999},"mol/type/immutable":{"mol/type/immutable/deep":-999},"mol/type":{"mol/type/immutable":-999}},"deps_out":{"mol/mutable":{"mol":-999,"mol/type/immutable/deep/deep":-2},"mol":{"":-999},"mol/type/immutable/deep/deep":{"mol/type/immutable/deep":-999},"mol/type/immutable/deep":{"mol/type/immutable":-999},"mol/type/immutable":{"mol/type":-999},"mol/type":{"mol":-999}},"sloc":{"ts":51,"LICENSE":113,"md":511,"js":9,"json":83,"tree":41,"CNAME":1},"deps":{"mol/mutable":{"..":-999,"/mol/mutable/wrapper":-1,"/mol/type/immutable/deep":-2,"/mol/mutable":-1},"mol":{"..":-999},"":{},"mol/type/immutable/deep/deep":{"..":-999,"/mol/type/immutable/deep":-1},"mol/type/immutable/deep":{"..":-999},"mol/type/immutable":{"..":-999},"mol/type":{"..":-999}}}
1
+ {"files":["mam.ts","LICENSE","README.md","mam.jam.js","tsfmt.json","package.json","tsconfig.json","lang.lang.tree","meta.lang.tree","sandbox.config.json","mol/CNAME","mol/LICENSE","mol/readme.md","mol/mol.meta.tree","mol/CONTRIBUTING.md","mol/CODE_OF_CONDUCT.md","mol/type/README.md","mol/type/immutable/deep/deep/deep.ts","mol/mutable/README.md","mol/mutable/mutable.ts"],"mods":{},"deps_in":{"mol":{"mol/mutable":-999,"mol/type":-999},"":{"mol":-999},"mol/type/immutable/deep/deep":{"mol/mutable":-2},"mol/type/immutable/deep":{"mol/type/immutable/deep/deep":-999},"mol/type/immutable":{"mol/type/immutable/deep":-999},"mol/type":{"mol/type/immutable":-999}},"deps_out":{"mol/mutable":{"mol":-999,"mol/type/immutable/deep/deep":-2},"mol":{"":-999},"mol/type/immutable/deep/deep":{"mol/type/immutable/deep":-999},"mol/type/immutable/deep":{"mol/type/immutable":-999},"mol/type/immutable":{"mol/type":-999},"mol/type":{"mol":-999}},"sloc":{"ts":53,"LICENSE":113,"md":511,"js":9,"json":83,"tree":41,"CNAME":1},"deps":{"mol/mutable":{"..":-999,"/mol/mutable/wrapper":-1,"/mol/type/immutable/deep":-2,"/mol/mutable":-1},"mol":{"..":-999},"":{},"mol/type/immutable/deep/deep":{"..":-999,"/mol/type/immutable/deep":-1},"mol/type/immutable/deep":{"..":-999},"mol/type/immutable":{"..":-999},"mol/type":{"..":-999}}}
package/web.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["-","../../../mam.ts","../../../mol/mutable/mutable.ts"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;;ACHA,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC;AAK3B,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;AAMX,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,CAAA;;;ADblB;AACA;AACA;;;;;;;;;;;;;;;;;;AEFA,IAAU,CAAC,CAwCV;AAxCD,WAAU,CAAC;IAWV,SAAgB,YAAY,CAC3B,KAAY,EACZ,SAAkC,IAAI,CAAC,EAAE,CAAC,KAAK,GAAG,IAAI;QAGtD,IAAI,MAAM,GAAG,SAA8B,CAAA;QAE3C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAE,KAAK,CAAE;YACnC,CAAC,CAAC,GAAE,EAAE,CAAC,CAAE,GAAI,KAAY,CAAW;YACpC,CAAC,CAAC,GAAE,EAAE,CAAC,CAAC,EAAE,GAAI,KAAK,EAAE,CAAC,CAAA;QAEvB,OAAO,IAAI,KAAK,CAAE,YAAY,EAAE;YAE/B,GAAG,EAAE,CAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,CACxB,KAAK,CAAE,KAAoB,CAAE,EAC7B,IAAI,CAAC,EAAE,CAAC,CAAE,MAAM,IAAI,CAAE,MAAM,GAAG,MAAM,CAAE,KAAK,EAAE,CAAE,CAAE,CAAE,CAAE,KAAoB,CAAE,GAAG,IAAI,CACnF;YAED,GAAG,EAAE,GAAE,EAAE,CAAC,KAAK;YAEf,KAAK,EAAE,CAAE,GAAG,EAAE,IAAI,EAAE,CAAE,KAAK,CAAE,EAAE,EAAE;gBAChC,IAAI,KAAK;oBAAG,MAAM,CAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAE,KAAK,CAAE,CAAE,CAAA;gBACrD,OAAO,MAAM,IAAI,KAAK,CAAA;YACvB,CAAC;SAED,CAAS,CAAA;IAEX,CAAC;IA3Be,cAAY,eA2B3B,CAAA;AAEF,CAAC,EAxCS,CAAC,KAAD,CAAC,QAwCV;;","sourcesContent":[null,"Error.stackTraceLimit = 50;\n\ndeclare let _$_: { new(): {} } & typeof globalThis\ndeclare class $ extends _$_ {}\n\nnamespace $ {\n\texport type $ = typeof $$\n\texport declare class $$ extends $ {}\n\tnamespace $$ {\n\t\texport type $$ = $\n\t}\n}\n\nmodule.exports = $\n","namespace $ {\n\t\n\texport type $mol_mutable_wrapper< Value > = {\n\t\t(\n\t\t\tpatch?: ( next: $mol_type_immutable_deep< Value > )=> $mol_type_immutable_deep< Value >\n\t\t): $mol_type_immutable_deep< Value >\n\t} & {\n\t\t[ Field in keyof Value ]: $mol_mutable_wrapper< Value[ Field ] >\n\t}\n\t\n\t/** Mutable way for immutable patch */\n\texport function $mol_mutable< Value >(\n\t\tinput: Value,\n\t\tupdate: ( next: Value )=> Value = next => input = next,\n\t): $mol_mutable_wrapper< Value > {\n\t\t\n\t\tlet output = undefined as undefined | Value\n\t\t\n\t\tconst clone = Array.isArray( input )\n\t\t\t? ()=> [ ... input as any ] as Value\n\t\t\t: ()=> ({ ... input })\n\t\t\n\t\treturn new Proxy( $mol_mutable, {\n\t\t\t\n\t\t\tget: ( Mut, field )=> Mut(\n\t\t\t\tinput[ field as keyof Value ],\n\t\t\t\tnext => ( output ?? ( output = update( clone() ) ) )[ field as keyof Value ] = next,\n\t\t\t),\n\t\t\t\n\t\t\tset: ()=> false,\n\t\t\t\n\t\t\tapply: ( Mut, self, [ patch ] )=> {\n\t\t\t\tif( patch ) update( output = input = patch( input ) )\n\t\t\t\treturn output ?? input\n\t\t\t},\n\t\t\t\n\t\t} ) as any\n\t\t\n\t}\n\t\n}\n"]}
1
+ {"version":3,"sources":["-","../../../mam.ts","../../../mol/mutable/mutable.ts"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;;ACHA,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC;AAK3B,IAAU,CAAC,CAQV;AARD,WAAU,CAAC;AAQX,CAAC,EARS,CAAC,KAAD,CAAC,QAQV;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,CAAA;;;ADflB;AACA;AACA;;;;;;;;;;;;;;;;;;AEFA,IAAU,CAAC,CAwCV;AAxCD,WAAU,CAAC;IAWV,SAAgB,YAAY,CAC3B,KAAY,EACZ,SAAkC,IAAI,CAAC,EAAE,CAAC,KAAK,GAAG,IAAI;QAGtD,IAAI,MAAM,GAAG,SAA8B,CAAA;QAE3C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAE,KAAK,CAAE;YACnC,CAAC,CAAC,GAAE,EAAE,CAAC,CAAE,GAAI,KAAY,CAAW;YACpC,CAAC,CAAC,GAAE,EAAE,CAAC,CAAC,EAAE,GAAI,KAAK,EAAE,CAAC,CAAA;QAEvB,OAAO,IAAI,KAAK,CAAE,YAAY,EAAE;YAE/B,GAAG,EAAE,CAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,CACxB,KAAK,CAAE,KAAoB,CAAE,EAC7B,IAAI,CAAC,EAAE,CAAC,CAAE,MAAM,IAAI,CAAE,MAAM,GAAG,MAAM,CAAE,KAAK,EAAE,CAAE,CAAE,CAAE,CAAE,KAAoB,CAAE,GAAG,IAAI,CACnF;YAED,GAAG,EAAE,GAAE,EAAE,CAAC,KAAK;YAEf,KAAK,EAAE,CAAE,GAAG,EAAE,IAAI,EAAE,CAAE,KAAK,CAAE,EAAE,EAAE;gBAChC,IAAI,KAAK;oBAAG,MAAM,CAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAE,KAAK,CAAE,CAAE,CAAA;gBACrD,OAAO,MAAM,IAAI,KAAK,CAAA;YACvB,CAAC;SAED,CAAS,CAAA;IAEX,CAAC;IA3Be,cAAY,eA2B3B,CAAA;AAEF,CAAC,EAxCS,CAAC,KAAD,CAAC,QAwCV;;","sourcesContent":[null,"Error.stackTraceLimit = 50;\n\ndeclare let _$_: { new(): {} } & typeof globalThis\ndeclare class $ extends _$_ {}\n\nnamespace $ {\n\texport type $ = typeof $$\n\texport declare class $$ extends $ {\n\t\tstatic $: $\n\t}\n\tnamespace $$ {\n\t\texport type $$ = $\n\t}\n}\n\nmodule.exports = $\n","namespace $ {\n\t\n\texport type $mol_mutable_wrapper< Value > = {\n\t\t(\n\t\t\tpatch?: ( next: $mol_type_immutable_deep< Value > )=> $mol_type_immutable_deep< Value >\n\t\t): $mol_type_immutable_deep< Value >\n\t} & {\n\t\t[ Field in keyof Value ]: $mol_mutable_wrapper< Value[ Field ] >\n\t}\n\t\n\t/** Mutable way for immutable patch */\n\texport function $mol_mutable< Value >(\n\t\tinput: Value,\n\t\tupdate: ( next: Value )=> Value = next => input = next,\n\t): $mol_mutable_wrapper< Value > {\n\t\t\n\t\tlet output = undefined as undefined | Value\n\t\t\n\t\tconst clone = Array.isArray( input )\n\t\t\t? ()=> [ ... input as any ] as Value\n\t\t\t: ()=> ({ ... input })\n\t\t\n\t\treturn new Proxy( $mol_mutable, {\n\t\t\t\n\t\t\tget: ( Mut, field )=> Mut(\n\t\t\t\tinput[ field as keyof Value ],\n\t\t\t\tnext => ( output ?? ( output = update( clone() ) ) )[ field as keyof Value ] = next,\n\t\t\t),\n\t\t\t\n\t\t\tset: ()=> false,\n\t\t\t\n\t\t\tapply: ( Mut, self, [ patch ] )=> {\n\t\t\t\tif( patch ) update( output = input = patch( input ) )\n\t\t\t\treturn output ?? input\n\t\t\t},\n\t\t\t\n\t\t} ) as any\n\t\t\n\t}\n\t\n}\n"]}
package/web.test.js CHANGED
@@ -1032,6 +1032,210 @@ var $;
1032
1032
  });
1033
1033
  })($ || ($ = {}));
1034
1034
 
1035
+ ;
1036
+ "use strict";
1037
+ var $;
1038
+ (function ($) {
1039
+ $['devtoolsFormatters'] ||= [];
1040
+ function $mol_dev_format_register(config) {
1041
+ $['devtoolsFormatters'].push(config);
1042
+ }
1043
+ $.$mol_dev_format_register = $mol_dev_format_register;
1044
+ $.$mol_dev_format_head = Symbol('$mol_dev_format_head');
1045
+ $.$mol_dev_format_body = Symbol('$mol_dev_format_body');
1046
+ function $mol_dev_format_button(label, click) {
1047
+ return $mol_dev_format_auto({
1048
+ [$.$mol_dev_format_head]() {
1049
+ return $mol_dev_format_span({ color: 'cornflowerblue' }, label);
1050
+ },
1051
+ [$.$mol_dev_format_body]() {
1052
+ Promise.resolve().then(click);
1053
+ return $mol_dev_format_span({});
1054
+ }
1055
+ });
1056
+ }
1057
+ $mol_dev_format_register({
1058
+ header: (val, config = false) => {
1059
+ if (config)
1060
+ return null;
1061
+ if (!val)
1062
+ return null;
1063
+ if ($.$mol_dev_format_head in val) {
1064
+ try {
1065
+ return val[$.$mol_dev_format_head]();
1066
+ }
1067
+ catch (error) {
1068
+ return $.$mol_dev_format_accent($mol_dev_format_native(val), '💨', $mol_dev_format_native(error), '');
1069
+ }
1070
+ }
1071
+ if (typeof val === 'function') {
1072
+ return $mol_dev_format_native(val);
1073
+ }
1074
+ if (val instanceof Error) {
1075
+ return $mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
1076
+ }
1077
+ if (val instanceof Promise) {
1078
+ return $.$mol_dev_format_shade($mol_dev_format_native(val), ' ', val[Symbol.toStringTag] ?? '');
1079
+ }
1080
+ if (Symbol.toStringTag in val) {
1081
+ return $mol_dev_format_native(val);
1082
+ }
1083
+ return null;
1084
+ },
1085
+ hasBody: (val, config = false) => {
1086
+ if (config)
1087
+ return false;
1088
+ if (!val)
1089
+ return false;
1090
+ if (val[$.$mol_dev_format_body])
1091
+ return true;
1092
+ return false;
1093
+ },
1094
+ body: (val, config = false) => {
1095
+ if (config)
1096
+ return null;
1097
+ if (!val)
1098
+ return null;
1099
+ if ($.$mol_dev_format_body in val) {
1100
+ try {
1101
+ return val[$.$mol_dev_format_body]();
1102
+ }
1103
+ catch (error) {
1104
+ return $.$mol_dev_format_accent($mol_dev_format_native(val), '💨', $mol_dev_format_native(error), '');
1105
+ }
1106
+ }
1107
+ return null;
1108
+ },
1109
+ });
1110
+ function $mol_dev_format_native(obj) {
1111
+ if (typeof obj === 'undefined')
1112
+ return $.$mol_dev_format_shade('undefined');
1113
+ return [
1114
+ 'object',
1115
+ {
1116
+ object: obj,
1117
+ config: true,
1118
+ },
1119
+ ];
1120
+ }
1121
+ $.$mol_dev_format_native = $mol_dev_format_native;
1122
+ function $mol_dev_format_auto(obj) {
1123
+ if (obj == null)
1124
+ return $.$mol_dev_format_shade(String(obj));
1125
+ return [
1126
+ 'object',
1127
+ {
1128
+ object: obj,
1129
+ config: false,
1130
+ },
1131
+ ];
1132
+ }
1133
+ $.$mol_dev_format_auto = $mol_dev_format_auto;
1134
+ function $mol_dev_format_element(element, style, ...content) {
1135
+ const styles = [];
1136
+ for (let key in style)
1137
+ styles.push(`${key} : ${style[key]}`);
1138
+ return [
1139
+ element,
1140
+ {
1141
+ style: styles.join(' ; '),
1142
+ },
1143
+ ...content,
1144
+ ];
1145
+ }
1146
+ $.$mol_dev_format_element = $mol_dev_format_element;
1147
+ function $mol_dev_format_span(style, ...content) {
1148
+ return $mol_dev_format_element('span', {
1149
+ ...style,
1150
+ }, ...content);
1151
+ }
1152
+ $.$mol_dev_format_span = $mol_dev_format_span;
1153
+ $.$mol_dev_format_div = $mol_dev_format_element.bind(null, 'div');
1154
+ $.$mol_dev_format_ol = $mol_dev_format_element.bind(null, 'ol');
1155
+ $.$mol_dev_format_li = $mol_dev_format_element.bind(null, 'li');
1156
+ $.$mol_dev_format_table = $mol_dev_format_element.bind(null, 'table');
1157
+ $.$mol_dev_format_tr = $mol_dev_format_element.bind(null, 'tr');
1158
+ $.$mol_dev_format_td = $mol_dev_format_element.bind(null, 'td');
1159
+ $.$mol_dev_format_accent = $mol_dev_format_span.bind(null, {
1160
+ 'color': 'magenta',
1161
+ });
1162
+ $.$mol_dev_format_strong = $mol_dev_format_span.bind(null, {
1163
+ 'font-weight': 'bold',
1164
+ });
1165
+ $.$mol_dev_format_string = $mol_dev_format_span.bind(null, {
1166
+ 'color': 'green',
1167
+ });
1168
+ $.$mol_dev_format_shade = $mol_dev_format_span.bind(null, {
1169
+ 'color': 'gray',
1170
+ });
1171
+ $.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
1172
+ 'margin-left': '13px'
1173
+ });
1174
+ class Stack extends Array {
1175
+ toString() {
1176
+ return this.join('\n');
1177
+ }
1178
+ }
1179
+ class Call extends Object {
1180
+ type;
1181
+ function;
1182
+ method;
1183
+ eval;
1184
+ source;
1185
+ offset;
1186
+ pos;
1187
+ object;
1188
+ flags;
1189
+ [Symbol.toStringTag];
1190
+ constructor(call) {
1191
+ super();
1192
+ this.type = call.getTypeName() ?? '';
1193
+ this.function = call.getFunctionName() ?? '';
1194
+ this.method = call.getMethodName() ?? '';
1195
+ if (this.method === this.function)
1196
+ this.method = '';
1197
+ this.pos = [call.getEnclosingLineNumber() ?? 0, call.getEnclosingColumnNumber() ?? 0];
1198
+ this.eval = call.getEvalOrigin() ?? '';
1199
+ this.source = call.getScriptNameOrSourceURL() ?? '';
1200
+ this.object = call.getThis();
1201
+ this.offset = call.getPosition();
1202
+ const flags = [];
1203
+ if (call.isAsync())
1204
+ flags.push('async');
1205
+ if (call.isConstructor())
1206
+ flags.push('constructor');
1207
+ if (call.isEval())
1208
+ flags.push('eval');
1209
+ if (call.isNative())
1210
+ flags.push('native');
1211
+ if (call.isPromiseAll())
1212
+ flags.push('PromiseAll');
1213
+ if (call.isToplevel())
1214
+ flags.push('top');
1215
+ this.flags = flags;
1216
+ const type = this.type ? this.type + '.' : '';
1217
+ const func = this.function || '<anon>';
1218
+ const method = this.method ? ' [' + this.method + '] ' : '';
1219
+ this[Symbol.toStringTag] = `${type}${func}${method}`;
1220
+ }
1221
+ [Symbol.toPrimitive]() {
1222
+ return this.toString();
1223
+ }
1224
+ toString() {
1225
+ const object = this.object || '';
1226
+ const label = this[Symbol.toStringTag];
1227
+ const source = `${this.source}:${this.pos.join(':')} #${this.offset}`;
1228
+ return `\tat ${object}${label} (${source})`;
1229
+ }
1230
+ [$.$mol_dev_format_head]() {
1231
+ return $.$mol_dev_format_div({}, $mol_dev_format_native(this), $.$mol_dev_format_shade(' '), ...this.object ? [
1232
+ $mol_dev_format_native(this.object),
1233
+ ] : [], ...this.method ? [$.$mol_dev_format_shade(' ', ' [', this.method, ']')] : [], $.$mol_dev_format_shade(' ', this.flags.join(', ')));
1234
+ }
1235
+ }
1236
+ Error.prepareStackTrace ??= (error, stack) => new Stack(...stack.map(call => new Call(call)));
1237
+ })($ || ($ = {}));
1238
+
1035
1239
  ;
1036
1240
  "use strict";
1037
1241
  var $;
@@ -1141,7 +1345,7 @@ var $;
1141
1345
  var $;
1142
1346
  (function ($) {
1143
1347
  function $mol_log3_area_lazy(event) {
1144
- const self = this;
1348
+ const self = this.$;
1145
1349
  const stack = self.$mol_log3_stack;
1146
1350
  const deep = stack.length;
1147
1351
  let logged = false;