importmap_mocha-rails 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- // mocha@10.6.0 in javascript ES2018
1
+ // mocha@10.8.2 in javascript ES2018
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -11101,7 +11101,7 @@
11101
11101
  * canonicalType(global) // 'global'
11102
11102
  * canonicalType(new String('foo') // 'object'
11103
11103
  * canonicalType(async function() {}) // 'asyncfunction'
11104
- * canonicalType(await import(name)) // 'module'
11104
+ * canonicalType(Object.create(null)) // 'null-prototype'
11105
11105
  */
11106
11106
  var canonicalType = (exports.canonicalType = function canonicalType(value) {
11107
11107
  if (value === undefined) {
@@ -11110,7 +11110,10 @@
11110
11110
  return 'null';
11111
11111
  } else if (isBuffer(value)) {
11112
11112
  return 'buffer';
11113
+ } else if (Object.getPrototypeOf(value) === null) {
11114
+ return 'null-prototype';
11113
11115
  }
11116
+
11114
11117
  return Object.prototype.toString
11115
11118
  .call(value)
11116
11119
  .replace(/^\[.+\s(.+?)]$/, '$1')
@@ -11176,7 +11179,7 @@
11176
11179
  exports.stringify = function (value) {
11177
11180
  var typeHint = canonicalType(value);
11178
11181
 
11179
- if (!~['object', 'array', 'function'].indexOf(typeHint)) {
11182
+ if (!~['object', 'array', 'function', 'null-prototype'].indexOf(typeHint)) {
11180
11183
  if (typeHint === 'buffer') {
11181
11184
  var json = Buffer.prototype.toJSON.call(value);
11182
11185
  // Based on the toJSON result
@@ -11362,8 +11365,12 @@
11362
11365
  break;
11363
11366
  }
11364
11367
  /* falls through */
11368
+ case 'null-prototype':
11365
11369
  case 'object':
11366
11370
  canonicalizedObj = canonicalizedObj || {};
11371
+ if (typeHint === 'null-prototype' && Symbol.toStringTag in value) {
11372
+ canonicalizedObj['[Symbol.toStringTag]'] = value[Symbol.toStringTag];
11373
+ }
11367
11374
  withStack(value, function () {
11368
11375
  Object.keys(value)
11369
11376
  .sort()
@@ -11631,7 +11638,9 @@
11631
11638
 
11632
11639
  seen.add(obj);
11633
11640
  for (const k in obj) {
11634
- if (Object.prototype.hasOwnProperty.call(obj, k)) {
11641
+ const descriptor = Object.getOwnPropertyDescriptor(obj, k);
11642
+
11643
+ if (descriptor && descriptor.writable) {
11635
11644
  obj[k] = _breakCircularDeps(obj[k]);
11636
11645
  }
11637
11646
  }
@@ -12960,6 +12969,8 @@
12960
12969
  var clearTimeout$1 = commonjsGlobal.clearTimeout;
12961
12970
  var toString = Object.prototype.toString;
12962
12971
 
12972
+ var MAX_TIMEOUT = Math.pow(2, 31) - 1;
12973
+
12963
12974
  var runnable = Runnable$3;
12964
12975
 
12965
12976
  /**
@@ -13035,8 +13046,7 @@
13035
13046
  }
13036
13047
 
13037
13048
  // Clamp to range
13038
- var INT_MAX = Math.pow(2, 31) - 1;
13039
- var range = [0, INT_MAX];
13049
+ var range = [0, MAX_TIMEOUT];
13040
13050
  ms = utils$2.clamp(ms, range);
13041
13051
 
13042
13052
  // see #1652 for reasoning
@@ -13173,11 +13183,8 @@
13173
13183
  */
13174
13184
  Runnable$3.prototype.resetTimeout = function () {
13175
13185
  var self = this;
13176
- var ms = this.timeout();
13186
+ var ms = this.timeout() || MAX_TIMEOUT;
13177
13187
 
13178
- if (ms === 0) {
13179
- return;
13180
- }
13181
13188
  this.clearTimeout();
13182
13189
  this.timer = setTimeout$2(function () {
13183
13190
  if (self.timeout() === 0) {
@@ -16724,11 +16731,12 @@
16724
16731
  module.exports = HTML;
16725
16732
 
16726
16733
  /**
16727
- * Stats template.
16734
+ * Stats template: Result, progress, passes, failures, and duration.
16728
16735
  */
16729
16736
 
16730
16737
  var statsTemplate =
16731
16738
  '<ul id="mocha-stats">' +
16739
+ '<li class="result"></li>' +
16732
16740
  '<li class="progress-contain"><progress class="progress-element" max="100" value="0"></progress><svg class="progress-ring"><circle class="ring-flatlight" stroke-dasharray="100%,0%"/><circle class="ring-highlight" stroke-dasharray="0%,100%"/></svg><div class="progress-text">0%</div></li>' +
16733
16741
  '<li class="passes"><a href="javascript:void(0);">passes:</a> <em>0</em></li>' +
16734
16742
  '<li class="failures"><a href="javascript:void(0);">failures:</a> <em>0</em></li>' +
@@ -16754,18 +16762,35 @@
16754
16762
  var stats = this.stats;
16755
16763
  var stat = fragment(statsTemplate);
16756
16764
  var items = stat.getElementsByTagName('li');
16757
- var passes = items[1].getElementsByTagName('em')[0];
16758
- var passesLink = items[1].getElementsByTagName('a')[0];
16759
- var failures = items[2].getElementsByTagName('em')[0];
16760
- var failuresLink = items[2].getElementsByTagName('a')[0];
16761
- var duration = items[3].getElementsByTagName('em')[0];
16765
+ const resultIndex = 0;
16766
+ const progressIndex = 1;
16767
+ const passesIndex = 2;
16768
+ const failuresIndex = 3;
16769
+ const durationIndex = 4;
16770
+ /** Stat item containing the root suite pass or fail indicator (hasFailures ? '✖' : '✓') */
16771
+ var resultIndicator = items[resultIndex];
16772
+ /** Passes text and count */
16773
+ const passesStat = items[passesIndex];
16774
+ /** Stat item containing the pass count (not the word, just the number) */
16775
+ const passesCount = passesStat.getElementsByTagName('em')[0];
16776
+ /** Stat item linking to filter to show only passing tests */
16777
+ const passesLink = passesStat.getElementsByTagName('a')[0];
16778
+ /** Failures text and count */
16779
+ const failuresStat = items[failuresIndex];
16780
+ /** Stat item containing the failure count (not the word, just the number) */
16781
+ const failuresCount = failuresStat.getElementsByTagName('em')[0];
16782
+ /** Stat item linking to filter to show only failing tests */
16783
+ const failuresLink = failuresStat.getElementsByTagName('a')[0];
16784
+ /** Stat item linking to the duration time (not the word or unit, just the number) */
16785
+ var duration = items[durationIndex].getElementsByTagName('em')[0];
16762
16786
  var report = fragment('<ul id="mocha-report"></ul>');
16763
16787
  var stack = [report];
16764
- var progressText = items[0].getElementsByTagName('div')[0];
16765
- var progressBar = items[0].getElementsByTagName('progress')[0];
16788
+ var progressText = items[progressIndex].getElementsByTagName('div')[0];
16789
+ var progressBar = items[progressIndex].getElementsByTagName('progress')[0];
16766
16790
  var progressRing = [
16767
- items[0].getElementsByClassName('ring-flatlight')[0],
16768
- items[0].getElementsByClassName('ring-highlight')[0]];
16791
+ items[progressIndex].getElementsByClassName('ring-flatlight')[0],
16792
+ items[progressIndex].getElementsByClassName('ring-highlight')[0]
16793
+ ];
16769
16794
  var root = document.getElementById('mocha');
16770
16795
 
16771
16796
  if (!root) {
@@ -16818,6 +16843,10 @@
16818
16843
 
16819
16844
  runner.on(EVENT_SUITE_END, function (suite) {
16820
16845
  if (suite.root) {
16846
+ if (stats.failures === 0) {
16847
+ text(resultIndicator, '✓');
16848
+ stat.className += ' pass';
16849
+ }
16821
16850
  updateStats();
16822
16851
  return;
16823
16852
  }
@@ -16838,6 +16867,10 @@
16838
16867
  });
16839
16868
 
16840
16869
  runner.on(EVENT_TEST_FAIL, function (test) {
16870
+ // Update stat items
16871
+ text(resultIndicator, '✖');
16872
+ stat.className += ' fail';
16873
+
16841
16874
  var el = fragment(
16842
16875
  '<li class="test fail"><h2>%e <a href="%e" class="replay">' +
16843
16876
  playIcon +
@@ -16910,7 +16943,6 @@
16910
16943
  }
16911
16944
 
16912
16945
  function updateStats() {
16913
- // TODO: add to stats
16914
16946
  var percent = ((stats.tests / runner.total) * 100) | 0;
16915
16947
  progressBar.value = percent;
16916
16948
  if (progressText) {
@@ -16936,8 +16968,8 @@
16936
16968
 
16937
16969
  // update stats
16938
16970
  var ms = new Date() - stats.start;
16939
- text(passes, stats.passes);
16940
- text(failures, stats.failures);
16971
+ text(passesCount, stats.passes);
16972
+ text(failuresCount, stats.failures);
16941
16973
  text(duration, (ms / 1000).toFixed(2));
16942
16974
  }
16943
16975
  }
@@ -16951,16 +16983,16 @@
16951
16983
  function makeUrl(s) {
16952
16984
  var search = window.location.search;
16953
16985
 
16954
- // Remove previous grep query parameter if present
16986
+ // Remove previous {grep, fgrep, invert} query parameters if present
16955
16987
  if (search) {
16956
- search = search.replace(/[?&]grep=[^&\s]*/g, '').replace(/^&/, '?');
16988
+ search = search.replace(/[?&](?:f?grep|invert)=[^&\s]*/g, '').replace(/^&/, '?');
16957
16989
  }
16958
16990
 
16959
16991
  return (
16960
16992
  window.location.pathname +
16961
16993
  (search ? search + '&' : '?') +
16962
16994
  'grep=' +
16963
- encodeURIComponent(escapeRe(s))
16995
+ encodeURIComponent(s)
16964
16996
  );
16965
16997
  }
16966
16998
 
@@ -16970,7 +17002,7 @@
16970
17002
  * @param {Object} [suite]
16971
17003
  */
16972
17004
  HTML.prototype.suiteURL = function (suite) {
16973
- return makeUrl(suite.fullTitle());
17005
+ return makeUrl('^' + escapeRe(suite.fullTitle()) + ' ');
16974
17006
  };
16975
17007
 
16976
17008
  /**
@@ -16979,7 +17011,7 @@
16979
17011
  * @param {Object} [test]
16980
17012
  */
16981
17013
  HTML.prototype.testURL = function (test) {
16982
- return makeUrl(test.fullTitle());
17014
+ return makeUrl('^' + escapeRe(test.fullTitle()) + '$');
16983
17015
  };
16984
17016
 
16985
17017
  /**
@@ -19169,7 +19201,7 @@
19169
19201
  };
19170
19202
 
19171
19203
  var name = "mocha";
19172
- var version = "10.6.0";
19204
+ var version = "10.8.2";
19173
19205
  var homepage = "https://mochajs.org/";
19174
19206
  var notifyLogo = "https://ibin.co/4QuRuGjXvl36.png";
19175
19207
  var require$$17 = {
@@ -19338,6 +19370,7 @@
19338
19370
  * @param {boolean} [options.delay] - Delay root suite execution?
19339
19371
  * @param {boolean} [options.diff] - Show diff on failure?
19340
19372
  * @param {boolean} [options.dryRun] - Report tests without running them?
19373
+ * @param {boolean} [options.passOnFailingTestSuite] - Fail test run if tests were failed?
19341
19374
  * @param {boolean} [options.failZero] - Fail test run if zero tests?
19342
19375
  * @param {string} [options.fgrep] - Test filter given string.
19343
19376
  * @param {boolean} [options.forbidOnly] - Tests marked `only` fail the suite?
@@ -19397,6 +19430,7 @@
19397
19430
  'delay',
19398
19431
  'diff',
19399
19432
  'dryRun',
19433
+ 'passOnFailingTestSuite',
19400
19434
  'failZero',
19401
19435
  'forbidOnly',
19402
19436
  'forbidPending',
@@ -20051,6 +20085,20 @@
20051
20085
  return this;
20052
20086
  };
20053
20087
 
20088
+ /**
20089
+ * Fail test run if tests were failed.
20090
+ *
20091
+ * @public
20092
+ * @see [CLI option](../#-pass-on-failing-test-suite)
20093
+ * @param {boolean} [passOnFailingTestSuite=false] - Whether to fail test run.
20094
+ * @return {Mocha} this
20095
+ * @chainable
20096
+ */
20097
+ Mocha.prototype.passOnFailingTestSuite = function(passOnFailingTestSuite) {
20098
+ this.options.passOnFailingTestSuite = passOnFailingTestSuite === true;
20099
+ return this;
20100
+ };
20101
+
20054
20102
  /**
20055
20103
  * Causes tests marked `only` to fail the suite.
20056
20104
  *
@@ -3,11 +3,11 @@
3
3
  :root {
4
4
  --mocha-color: #000;
5
5
  --mocha-bg-color: #fff;
6
- --mocha-pass-icon-color: #00d6b2;
7
- --mocha-pass-color: #fff;
8
- --mocha-pass-shadow-color: rgba(0,0,0,.2);
9
- --mocha-pass-mediump-color: #c09853;
10
- --mocha-pass-slow-color: #b94a48;
6
+ --mocha-test-pass-color: #007f6a;
7
+ --mocha-test-pass-duration-color: #fff;
8
+ --mocha-test-pass-shadow-color: rgba(0,0,0, 0.2);
9
+ --mocha-test-pass-mediump-color: #c09853;
10
+ --mocha-test-pass-slow-color: #b94a48;
11
11
  --mocha-test-pending-color: #0b97c4;
12
12
  --mocha-test-pending-icon-color: #0b97c4;
13
13
  --mocha-test-fail-color: #c00;
@@ -38,11 +38,11 @@
38
38
  :root {
39
39
  --mocha-color: #fff;
40
40
  --mocha-bg-color: #222;
41
- --mocha-pass-icon-color: #00d6b2;
42
- --mocha-pass-color: #222;
43
- --mocha-pass-shadow-color: rgba(255,255,255,.2);
44
- --mocha-pass-mediump-color: #f1be67;
45
- --mocha-pass-slow-color: #f49896;
41
+ --mocha-test-pass-color: #00d6b2;
42
+ --mocha-test-pass-duration-color: #222;
43
+ --mocha-test-pass-shadow-color: rgba(255, 255, 255, 0.2);
44
+ --mocha-test-pass-mediump-color: #f1be67;
45
+ --mocha-test-pass-slow-color: #f49896;
46
46
  --mocha-test-pending-color: #0b97c4;
47
47
  --mocha-test-pending-icon-color: #0b97c4;
48
48
  --mocha-test-fail-color: #f44;
@@ -141,11 +141,11 @@ body {
141
141
  }
142
142
 
143
143
  #mocha .test.pass.medium .duration {
144
- background: var(--mocha-pass-mediump-color);
144
+ background: var(--mocha-test-pass-mediump-color);
145
145
  }
146
146
 
147
147
  #mocha .test.pass.slow .duration {
148
- background: var(--mocha-pass-slow-color);
148
+ background: var(--mocha-test-pass-slow-color);
149
149
  }
150
150
 
151
151
  #mocha .test.pass::before {
@@ -154,17 +154,17 @@ body {
154
154
  display: block;
155
155
  float: left;
156
156
  margin-right: 5px;
157
- color: var(--mocha-pass-icon-color);
157
+ color: var(--mocha-test-pass-color);
158
158
  }
159
159
 
160
160
  #mocha .test.pass .duration {
161
161
  font-size: 9px;
162
162
  margin-left: 5px;
163
163
  padding: 2px 5px;
164
- color: var(--mocha-pass-color);
165
- -webkit-box-shadow: inset 0 1px 1px var(--mocha-pass-shadow-color);
166
- -moz-box-shadow: inset 0 1px 1px var(--mocha-pass-shadow-color);
167
- box-shadow: inset 0 1px 1px var(--mocha-pass-shadow-color);
164
+ color: var(--mocha-test-pass-duration-color);
165
+ -webkit-box-shadow: inset 0 1px 1px var(--mocha-test-pass-shadow-color);
166
+ -moz-box-shadow: inset 0 1px 1px var(--mocha-test-pass-shadow-color);
167
+ box-shadow: inset 0 1px 1px var(--mocha-test-pass-shadow-color);
168
168
  -webkit-border-radius: 5px;
169
169
  -moz-border-radius: 5px;
170
170
  -ms-border-radius: 5px;
@@ -344,12 +344,37 @@ body {
344
344
  z-index: 1;
345
345
  }
346
346
 
347
+ #mocha-stats.fail li.result {
348
+ color: var(--mocha-test-fail-color);
349
+ }
350
+
351
+ #mocha-stats.fail li.failures {
352
+ color: var(--mocha-test-fail-color);
353
+ }
354
+
355
+ #mocha-stats.fail li.failures em {
356
+ color: var(--mocha-test-fail-color);
357
+ }
358
+
359
+ #mocha-stats.pass li.result {
360
+ color: var(--mocha-test-pass-color);
361
+ }
362
+
363
+ #mocha-stats.pass li.passes {
364
+ color: var(--mocha-test-pass-color);
365
+ }
366
+
367
+ #mocha-stats.pass li.passes em {
368
+ color: var(--mocha-test-pass-color);
369
+ }
370
+
347
371
  #mocha-stats .progress-contain {
348
372
  float: right;
349
373
  padding: 0;
350
374
  }
351
375
 
352
- #mocha-stats :is(.progress-element, .progress-text) {
376
+ #mocha-stats .progress-element,
377
+ #mocha-stats .progress-text {
353
378
  width: var(--ring-container-size);
354
379
  display: block;
355
380
  top: 12px;
@@ -374,7 +399,8 @@ body {
374
399
  height: var(--ring-container-size);
375
400
  }
376
401
 
377
- #mocha-stats :is(.ring-flatlight, .ring-highlight) {
402
+ #mocha-stats .ring-flatlight,
403
+ #mocha-stats .ring-highlight {
378
404
  --stroke-thickness: 1.65px;
379
405
  --center: calc(var(--ring-container-size) / 2);
380
406
  cx: var(--center);
metadata CHANGED
@@ -1,44 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: importmap_mocha-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-15 00:00:00.000000000 Z
11
+ date: 2024-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: importmap-rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '7.0'
19
+ version: 2.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '7.0'
27
- - !ruby/object:Gem::Dependency
28
- name: importmap-rails
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- description: Add JavaScript testing tools in importmap environment.
26
+ version: 2.0.0
27
+ description: Add JavaScript testing tools in importmap-rails environment.
42
28
  email:
43
29
  - tohosaku@users.osdn.me
44
30
  executables: []
@@ -59,22 +45,17 @@ files:
59
45
  - lib/tasks/importmap_mocha/rails_tasks.rake
60
46
  - vendor/javascripts/@mswjs--interceptors--presets--browser.js
61
47
  - vendor/javascripts/@mswjs--interceptors.js
62
- - vendor/javascripts/@open-draft--deferred-promise.js
63
- - vendor/javascripts/@open-draft--logger.js
64
- - vendor/javascripts/@open-draft--until.js
65
48
  - vendor/javascripts/chai.js
66
- - vendor/javascripts/is-node-process.js
67
49
  - vendor/javascripts/mocha.js
68
- - vendor/javascripts/outvariant.js
69
- - vendor/javascripts/strict-event-emitter.js
70
50
  - vendor/stylesheets/mocha.css
71
- homepage: https://github.com/tohosaku/importmap_mocha-rails
51
+ homepage: https://github.com/redmine-ui/importmap_mocha-rails
72
52
  licenses:
73
53
  - MIT
74
54
  metadata:
75
- homepage_uri: https://github.com/tohosaku/importmap_mocha-rails
76
- source_code_uri: https://github.com/tohosaku/importmap_mocha-rails
77
- changelog_uri: https://github.com/tohosaku/importmap_mocha-rails
55
+ rubygems_mfa_required: 'true'
56
+ homepage_uri: https://github.com/redmine-ui/importmap_mocha-rails
57
+ source_code_uri: https://github.com/redmine-ui/importmap_mocha-rails
58
+ changelog_uri: https://github.com/redmine-ui/importmap_mocha-rails
78
59
  post_install_message:
79
60
  rdoc_options: []
80
61
  require_paths:
@@ -1,2 +0,0 @@
1
- function createDeferredExecutor(){const executor=(e,t)=>{executor.state="pending";executor.resolve=t=>{if("pending"!==executor.state)return;executor.result=t;const onFulfilled=e=>{executor.state="fulfilled";return e};return e(t instanceof Promise?t:Promise.resolve(t).then(onFulfilled))};executor.reject=e=>{if("pending"===executor.state){queueMicrotask((()=>{executor.state="rejected"}));return t(executor.rejectionReason=e)}}};return executor}var e=class extends Promise{#e;resolve;reject;constructor(e=null){const t=createDeferredExecutor();super(((r,s)=>{t(r,s);e?.(t.resolve,t.reject)}));this.#e=t;this.resolve=this.#e.resolve;this.reject=this.#e.reject}get state(){return this.#e.state}get rejectionReason(){return this.#e.rejectionReason}then(e,t){return this.#t(super.then(e,t))}catch(e){return this.#t(super.catch(e))}finally(e){return this.#t(super.finally(e))}#t(e){return Object.defineProperties(e,{resolve:{configurable:true,value:this.resolve},reject:{configurable:true,value:this.reject}})}};export{e as DeferredPromise,createDeferredExecutor};
2
-
@@ -1,2 +0,0 @@
1
- import{isNodeProcess as e}from"is-node-process";import{format as r}from"outvariant";var t=Object.defineProperty;var __export=(e,r)=>{for(var i in r)t(e,i,{get:r[i],enumerable:true})};var i={};__export(i,{blue:()=>blue,gray:()=>gray,green:()=>green,red:()=>red,yellow:()=>yellow});function yellow(e){return`${e}`}function blue(e){return`${e}`}function gray(e){return`${e}`}function red(e){return`${e}`}function green(e){return`${e}`}var s=e();var n=class{constructor(e){this.name=e;this.prefix=`[${this.name}]`;const r=getVariable("DEBUG");const t=getVariable("LOG_LEVEL");const i="1"===r||"true"===r||"undefined"!==typeof r&&this.name.startsWith(r);if(i){this.debug=isDefinedAndNotEquals(t,"debug")?noop:this.debug;this.info=isDefinedAndNotEquals(t,"info")?noop:this.info;this.success=isDefinedAndNotEquals(t,"success")?noop:this.success;this.warning=isDefinedAndNotEquals(t,"warning")?noop:this.warning;this.error=isDefinedAndNotEquals(t,"error")?noop:this.error}else{this.info=noop;this.success=noop;this.warning=noop;this.error=noop;this.only=noop}}prefix;extend(e){return new n(`${this.name}:${e}`)}debug(e,...r){this.logEntry({level:"debug",message:gray(e),positionals:r,prefix:this.prefix,colors:{prefix:"gray"}})}info(e,...r){this.logEntry({level:"info",message:e,positionals:r,prefix:this.prefix,colors:{prefix:"blue"}});const t=new o;return(e,...r)=>{t.measure();this.logEntry({level:"info",message:`${e} ${gray(`${t.deltaTime}ms`)}`,positionals:r,prefix:this.prefix,colors:{prefix:"blue"}})}}success(e,...r){this.logEntry({level:"info",message:e,positionals:r,prefix:`✔ ${this.prefix}`,colors:{timestamp:"green",prefix:"green"}})}warning(e,...r){this.logEntry({level:"warning",message:e,positionals:r,prefix:`⚠ ${this.prefix}`,colors:{timestamp:"yellow",prefix:"yellow"}})}error(e,...r){this.logEntry({level:"error",message:e,positionals:r,prefix:`✖ ${this.prefix}`,colors:{timestamp:"red",prefix:"red"}})}only(e){e()}createEntry(e,r){return{timestamp:new Date,level:e,message:r}}logEntry(e){const{level:r,message:t,prefix:s,colors:n,positionals:o=[]}=e;const a=this.createEntry(r,t);const l=n?.timestamp||"gray";const c=n?.prefix||"gray";const f={timestamp:i[l],prefix:i[c]};const u=this.getWriter(r);u([f.timestamp(this.formatTimestamp(a.timestamp))].concat(null!=s?f.prefix(s):[]).concat(serializeInput(t)).join(" "),...o.map(serializeInput))}formatTimestamp(e){return`${e.toLocaleTimeString("en-GB")}:${e.getMilliseconds()}`}getWriter(e){switch(e){case"debug":case"success":case"info":return log;case"warning":return warn;case"error":return error}}};var o=class{startTime;endTime;deltaTime;constructor(){this.startTime=performance.now()}measure(){this.endTime=performance.now();const e=this.endTime-this.startTime;this.deltaTime=e.toFixed(2)}};var noop=()=>{};function log(e,...t){s?process.stdout.write(r(e,...t)+"\n"):console.log(e,...t)}function warn(e,...t){s?process.stderr.write(r(e,...t)+"\n"):console.warn(e,...t)}function error(e,...t){s?process.stderr.write(r(e,...t)+"\n"):console.error(e,...t)}function getVariable(e){return s?process.env[e]:globalThis[e]?.toString()}function isDefinedAndNotEquals(e,r){return void 0!==e&&e!==r}function serializeInput(e){return"undefined"===typeof e?"undefined":null===e?"null":"string"===typeof e?e:"object"===typeof e?JSON.stringify(e):e.toString()}export{n as Logger};
2
-
@@ -1,2 +0,0 @@
1
- var until=async r=>{try{const t=await r().catch((r=>{throw r}));return{error:null,data:t}}catch(r){return{error:r,data:null}}};export{until};
2
-
@@ -1,2 +0,0 @@
1
- function isNodeProcess(){if("undefined"!==typeof navigator&&"ReactNative"===navigator.product)return true;if("undefined"!==typeof process){const e=process.type;return"renderer"!==e&&"worker"!==e&&!!(process.versions&&process.versions.node)}return false}export{isNodeProcess};
2
-
@@ -1,2 +0,0 @@
1
- var t=/(%?)(%([sdjo]))/g;function serializePositional(t,r){switch(r){case"s":return t;case"d":case"i":return Number(t);case"j":return JSON.stringify(t);case"o":{if("string"===typeof t)return t;const r=JSON.stringify(t);return"{}"===r||"[]"===r||/^\[object .+?\]$/.test(r)?t:r}}}function format(r,...e){if(0===e.length)return r;let n=0;let s=r.replace(t,((t,r,s,a)=>{const i=e[n];const o=serializePositional(i,a);if(!r){n++;return o}return t}));n<e.length&&(s+=` ${e.slice(n).join(" ")}`);s=s.replace(/%{2,2}/g,"%");return s}var r=2;function cleanErrorStack(t){if(!t.stack)return;const e=t.stack.split("\n");e.splice(1,r);t.stack=e.join("\n")}var e=class extends Error{constructor(t,...r){super(t);this.message=t;this.name="Invariant Violation";this.message=format(t,...r);cleanErrorStack(this)}};var invariant=(t,r,...n)=>{if(!t)throw new e(r,...n)};invariant.as=(t,r,e,...n)=>{if(!r){const r=null!=t.prototype.name;const s=r?new t(format(e,n)):t(format(e,n));throw s}};export{e as InvariantError,format,invariant};
2
-
@@ -1,2 +0,0 @@
1
- var e=class extends Error{constructor(e,t,s){super(`Possible EventEmitter memory leak detected. ${s} ${t.toString()} listeners added. Use emitter.setMaxListeners() to increase limit`);this.emitter=e;this.type=t;this.count=s;this.name="MaxListenersExceededWarning"}};var t=class{static listenerCount(e,t){return e.listenerCount(t)}constructor(){this.events=new Map;this.maxListeners=t.defaultMaxListeners;this.hasWarnedAboutPotentialMemoryLeak=false}_emitInternalEvent(e,t,s){this.emit(e,t,s)}_getListeners(e){return Array.prototype.concat.apply([],this.events.get(e))||[]}_removeListener(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1);return[]}_wrapOnceListener(e,t){const onceListener=(...s)=>{this.removeListener(e,onceListener);return t.apply(this,s)};Object.defineProperty(onceListener,"name",{value:t.name});return onceListener}setMaxListeners(e){this.maxListeners=e;return this}getMaxListeners(){return this.maxListeners}eventNames(){return Array.from(this.events.keys())}emit(e,...t){const s=this._getListeners(e);s.forEach((e=>{e.apply(this,t)}));return s.length>0}addListener(t,s){this._emitInternalEvent("newListener",t,s);const r=this._getListeners(t).concat(s);this.events.set(t,r);if(this.maxListeners>0&&this.listenerCount(t)>this.maxListeners&&!this.hasWarnedAboutPotentialMemoryLeak){this.hasWarnedAboutPotentialMemoryLeak=true;const s=new e(this,t,this.listenerCount(t));console.warn(s)}return this}on(e,t){return this.addListener(e,t)}once(e,t){return this.addListener(e,this._wrapOnceListener(e,t))}prependListener(e,t){const s=this._getListeners(e);if(s.length>0){const r=[t].concat(s);this.events.set(e,r)}else this.events.set(e,s.concat(t));return this}prependOnceListener(e,t){return this.prependListener(e,this._wrapOnceListener(e,t))}removeListener(e,t){const s=this._getListeners(e);if(s.length>0){this._removeListener(s,t);this.events.set(e,s);this._emitInternalEvent("removeListener",e,t)}return this}off(e,t){return this.removeListener(e,t)}removeAllListeners(e){e?this.events.delete(e):this.events.clear();return this}listeners(e){return Array.from(this._getListeners(e))}listenerCount(e){return this._getListeners(e).length}rawListeners(e){return this.listeners(e)}};var s=t;s.defaultMaxListeners=10;export{s as Emitter,e as MemoryLeakError};
2
-