sqlmath 2022.4.28 → 2022.5.20
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/.npmignore +1 -0
- package/CHANGELOG.md +6 -1
- package/LICENSE +2 -2
- package/README.md +13 -1
- package/_binary_sqlmath_napi8_darwin_x64.node +0 -0
- package/_binary_sqlmath_napi8_linux_x64.node +0 -0
- package/_binary_sqlmath_napi8_win32_x64.node +0 -0
- package/_binary_sqlmath_shell_darwin_x64 +0 -0
- package/_binary_sqlmath_shell_linux_x64 +0 -0
- package/_binary_sqlmath_shell_win32_x64.exe +0 -0
- package/jslint.mjs +347 -80
- package/package.json +3 -3
- package/sqlmath.mjs +34 -920
package/jslint.mjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// #!/usr/bin/env node
|
|
2
2
|
// JSLint
|
|
3
|
-
// Original Author: Douglas Crockford (https://www.jslint.com).
|
|
4
3
|
|
|
4
|
+
// The Unlicense
|
|
5
|
+
//
|
|
5
6
|
// This is free and unencumbered software released into the public domain.
|
|
6
|
-
|
|
7
|
+
//
|
|
7
8
|
// Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
8
9
|
// distribute this software, either in source code form or as a compiled
|
|
9
10
|
// binary, for any purpose, commercial or non-commercial, and by any
|
|
10
11
|
// means.
|
|
11
|
-
|
|
12
|
+
//
|
|
12
13
|
// In jurisdictions that recognize copyright laws, the author or authors
|
|
13
14
|
// of this software dedicate any and all copyright interest in the
|
|
14
15
|
// software to the public domain. We make this dedication for the benefit
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
// successors. We intend this dedication to be an overt act of
|
|
17
18
|
// relinquishment in perpetuity of all present and future rights to this
|
|
18
19
|
// software under copyright law.
|
|
19
|
-
|
|
20
|
+
//
|
|
20
21
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
21
22
|
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
22
23
|
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
25
26
|
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
26
27
|
// OTHER DEALINGS IN THE SOFTWARE.
|
|
27
|
-
|
|
28
|
+
//
|
|
28
29
|
// For more information, please refer to <https://unlicense.org/>
|
|
29
30
|
|
|
30
31
|
|
|
@@ -92,8 +93,11 @@
|
|
|
92
93
|
// WARNING: JSLint will hurt your feelings.
|
|
93
94
|
|
|
94
95
|
/*jslint beta, node*/
|
|
95
|
-
|
|
96
96
|
/*property
|
|
97
|
+
excludeList,
|
|
98
|
+
globExclude,
|
|
99
|
+
import_meta_url, includeList,
|
|
100
|
+
pathnameList,
|
|
97
101
|
JSLINT_BETA, NODE_V8_COVERAGE, a, all, argv, arity, artifact,
|
|
98
102
|
assertErrorThrownAsync, assertJsonEqual, assertOrThrow, assign, async, b,
|
|
99
103
|
beta, bitwise, block, body, browser, c, calls, catch, catch_list,
|
|
@@ -164,7 +168,7 @@ let jslint_charset_ascii = (
|
|
|
164
168
|
+ "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
|
|
165
169
|
+ "`abcdefghijklmnopqrstuvwxyz{|}~\u007f"
|
|
166
170
|
);
|
|
167
|
-
let jslint_edition = "v2022.
|
|
171
|
+
let jslint_edition = "v2022.6.1-beta";
|
|
168
172
|
let jslint_export; // The jslint object to be exported.
|
|
169
173
|
let jslint_fudge = 1; // Fudge starting line and starting
|
|
170
174
|
// ... column to 1.
|
|
@@ -251,6 +255,9 @@ let jslint_rgx_token = new RegExp(
|
|
|
251
255
|
+ ")"
|
|
252
256
|
+ "(.*)$"
|
|
253
257
|
);
|
|
258
|
+
let jslint_rgx_url_search_window_jslint = (
|
|
259
|
+
/[&?]window_jslint=1(?:$|&)/m
|
|
260
|
+
);
|
|
254
261
|
let jslint_rgx_weird_property = (
|
|
255
262
|
/^_|\$|Sync$|_$/m
|
|
256
263
|
);
|
|
@@ -349,6 +356,224 @@ async function fsWriteFileWithParents(pathname, data) {
|
|
|
349
356
|
console.error("wrote file " + pathname);
|
|
350
357
|
}
|
|
351
358
|
|
|
359
|
+
function globExclude({
|
|
360
|
+
excludeList = [],
|
|
361
|
+
includeList = [],
|
|
362
|
+
pathnameList = []
|
|
363
|
+
}) {
|
|
364
|
+
|
|
365
|
+
// This function will
|
|
366
|
+
// 1. Exclude pathnames in <pathnameList> that don't match glob-patterns in
|
|
367
|
+
// <includeList>.
|
|
368
|
+
// 2. Exclude pathnames in <pathnameList> that match glob-patterns in
|
|
369
|
+
// <excludeList>.
|
|
370
|
+
|
|
371
|
+
function globAssertNotWeird(list, name) {
|
|
372
|
+
|
|
373
|
+
// This function will check if <list> of strings contain weird characters.
|
|
374
|
+
|
|
375
|
+
[
|
|
376
|
+
[
|
|
377
|
+
"\n", (
|
|
378
|
+
/^.*?([\u0000-\u0007\r]).*/gm
|
|
379
|
+
)
|
|
380
|
+
],
|
|
381
|
+
[
|
|
382
|
+
"\r", (
|
|
383
|
+
/^.*?([\n]).*/gm
|
|
384
|
+
)
|
|
385
|
+
]
|
|
386
|
+
].forEach(function ([
|
|
387
|
+
separator, rgx
|
|
388
|
+
]) {
|
|
389
|
+
list.join(separator).replace(rgx, function (match0, char) {
|
|
390
|
+
throw new Error(
|
|
391
|
+
"Weird character "
|
|
392
|
+
+ JSON.stringify(char)
|
|
393
|
+
+ " found in " + name + " "
|
|
394
|
+
+ JSON.stringify(match0)
|
|
395
|
+
);
|
|
396
|
+
});
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
function globToRegexp(pattern) {
|
|
401
|
+
|
|
402
|
+
// This function will translate glob <pattern> to javascript-regexp,
|
|
403
|
+
// which javascript can then use to "glob" pathnames.
|
|
404
|
+
|
|
405
|
+
let ii = 0;
|
|
406
|
+
let isClass = false;
|
|
407
|
+
let strClass = "";
|
|
408
|
+
let strRegex = "";
|
|
409
|
+
pattern = pattern.replace((
|
|
410
|
+
/\/\/+/g
|
|
411
|
+
), "/");
|
|
412
|
+
pattern = pattern.replace((
|
|
413
|
+
/\*\*\*+/g
|
|
414
|
+
), "**");
|
|
415
|
+
pattern.replace((
|
|
416
|
+
/\\\\|\\\[|\\\]|\[|\]|./g
|
|
417
|
+
), function (match0) {
|
|
418
|
+
switch (match0) {
|
|
419
|
+
case "[":
|
|
420
|
+
if (isClass) {
|
|
421
|
+
strClass += "[";
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
strClass += "\u0000";
|
|
425
|
+
strRegex += "\u0000";
|
|
426
|
+
isClass = true;
|
|
427
|
+
return;
|
|
428
|
+
case "]":
|
|
429
|
+
if (isClass) {
|
|
430
|
+
isClass = false;
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
strRegex += "]";
|
|
434
|
+
return;
|
|
435
|
+
default:
|
|
436
|
+
if (isClass) {
|
|
437
|
+
strClass += match0;
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
strRegex += match0;
|
|
441
|
+
}
|
|
442
|
+
return "";
|
|
443
|
+
});
|
|
444
|
+
strClass += "\u0000";
|
|
445
|
+
|
|
446
|
+
// An expression "[!...]" matches a single character, namely any character that
|
|
447
|
+
// is not matched by the expression obtained by removing the first '!' from it.
|
|
448
|
+
// (Thus, "[!a-]" matches any single character except 'a', and '-'.)
|
|
449
|
+
|
|
450
|
+
strClass = strClass.replace((
|
|
451
|
+
/\u0000!/g
|
|
452
|
+
), "\u0000^");
|
|
453
|
+
|
|
454
|
+
// One may include '-' in its literal meaning by making it the first or last
|
|
455
|
+
// character between the brackets.
|
|
456
|
+
|
|
457
|
+
strClass = strClass.replace((
|
|
458
|
+
/\u0000-/g
|
|
459
|
+
), "\u0000\\-");
|
|
460
|
+
strClass = strClass.replace((
|
|
461
|
+
/-\u0000/g
|
|
462
|
+
), "\\-\u0000");
|
|
463
|
+
|
|
464
|
+
// Escape brackets '[', ']' in character class.
|
|
465
|
+
|
|
466
|
+
strClass = strClass.replace((
|
|
467
|
+
/[\[\]]/g
|
|
468
|
+
), "\\$&");
|
|
469
|
+
|
|
470
|
+
// https://stackoverflow.com/questions/3561493
|
|
471
|
+
// /is-there-a-regexp-escape-function-in-javascript
|
|
472
|
+
// $()*+-./?[\]^{|}
|
|
473
|
+
|
|
474
|
+
strRegex = strRegex.replace((
|
|
475
|
+
// ignore [-/]
|
|
476
|
+
/[$()*+.?\[\\\]\^{|}]/g
|
|
477
|
+
), "\\$&");
|
|
478
|
+
|
|
479
|
+
// Expand wildcard '**/*'.
|
|
480
|
+
|
|
481
|
+
strRegex = strRegex.replace((
|
|
482
|
+
/\\\*\\\*\/(?:\\\*)+/g
|
|
483
|
+
), ".*?");
|
|
484
|
+
|
|
485
|
+
// Expand wildcard '**'.
|
|
486
|
+
|
|
487
|
+
strRegex = strRegex.replace((
|
|
488
|
+
/(^|\/)\\\*\\\*(\/|$)/gm
|
|
489
|
+
), "$1.*?$2");
|
|
490
|
+
|
|
491
|
+
// Expand wildcard '*'.
|
|
492
|
+
|
|
493
|
+
strRegex = strRegex.replace((
|
|
494
|
+
/(?:\\\*)+/g
|
|
495
|
+
), "[^\\/]*?");
|
|
496
|
+
|
|
497
|
+
// Expand wildcard '?'.
|
|
498
|
+
|
|
499
|
+
strRegex = strRegex.replace((
|
|
500
|
+
/\\\?/g
|
|
501
|
+
), "[^\\/]");
|
|
502
|
+
|
|
503
|
+
// Expand directory-with-trailing-slash '.../'.
|
|
504
|
+
|
|
505
|
+
strRegex = strRegex.replace((
|
|
506
|
+
/\/$/gm
|
|
507
|
+
), "\\/.*?");
|
|
508
|
+
|
|
509
|
+
// Merge strClass into strRegex.
|
|
510
|
+
|
|
511
|
+
ii = 0;
|
|
512
|
+
strClass = strClass.split("\u0000");
|
|
513
|
+
strRegex = strRegex.replace((
|
|
514
|
+
/\u0000/g
|
|
515
|
+
), function () {
|
|
516
|
+
ii += 1;
|
|
517
|
+
if (strClass[ii] === "") {
|
|
518
|
+
return "";
|
|
519
|
+
}
|
|
520
|
+
return "[" + strClass[ii] + "]";
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
// Change strRegex from string to regexp.
|
|
524
|
+
|
|
525
|
+
strRegex = new RegExp("^" + strRegex + "$", "gm");
|
|
526
|
+
return strRegex;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// Validate excludeList, includeList, pathnameList.
|
|
530
|
+
|
|
531
|
+
globAssertNotWeird(excludeList, "pattern");
|
|
532
|
+
globAssertNotWeird(includeList, "pattern");
|
|
533
|
+
globAssertNotWeird(pathnameList, "pathname");
|
|
534
|
+
|
|
535
|
+
// Optimization
|
|
536
|
+
// Concat pathnames into a single, newline-separated string,
|
|
537
|
+
// whose pathnames can all be filtered with a single, regexp-pass.
|
|
538
|
+
|
|
539
|
+
pathnameList = pathnameList.join("\n");
|
|
540
|
+
|
|
541
|
+
// 1. Exclude pathnames in <pathnameList> that don't match glob-patterns in
|
|
542
|
+
// <includeList>.
|
|
543
|
+
|
|
544
|
+
if (includeList.length > 0) {
|
|
545
|
+
includeList = includeList.map(globToRegexp);
|
|
546
|
+
includeList.forEach(function (pattern) {
|
|
547
|
+
pathnameList = pathnameList.replace(pattern, "\u0000$&");
|
|
548
|
+
});
|
|
549
|
+
pathnameList = pathnameList.replace((
|
|
550
|
+
/^[^\u0000].*/gm
|
|
551
|
+
), "");
|
|
552
|
+
pathnameList = pathnameList.replace((
|
|
553
|
+
/^\u0000+/gm
|
|
554
|
+
), "");
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// 2. Exclude pathnames in <pathnameList> that match glob-patterns in
|
|
558
|
+
// <excludeList>.
|
|
559
|
+
|
|
560
|
+
excludeList = excludeList.map(globToRegexp);
|
|
561
|
+
excludeList.forEach(function (pattern) {
|
|
562
|
+
pathnameList = pathnameList.replace(pattern, "");
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
// Split newline-separated pathnames back to list.
|
|
566
|
+
|
|
567
|
+
pathnameList = pathnameList.split("\n").filter(function (elem) {
|
|
568
|
+
return elem;
|
|
569
|
+
});
|
|
570
|
+
return {
|
|
571
|
+
excludeList,
|
|
572
|
+
includeList,
|
|
573
|
+
pathnameList
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
|
|
352
577
|
function htmlEscape(str) {
|
|
353
578
|
|
|
354
579
|
// This function will make <str> html-safe by escaping & < >.
|
|
@@ -1537,6 +1762,7 @@ async function jslint_cli({
|
|
|
1537
1762
|
console_error,
|
|
1538
1763
|
console_log,
|
|
1539
1764
|
file,
|
|
1765
|
+
import_meta_url,
|
|
1540
1766
|
mode_cli,
|
|
1541
1767
|
mode_noop,
|
|
1542
1768
|
option,
|
|
@@ -1705,11 +1931,26 @@ async function jslint_cli({
|
|
|
1705
1931
|
return count;
|
|
1706
1932
|
}
|
|
1707
1933
|
|
|
1934
|
+
// PR-396 - window.jslint
|
|
1935
|
+
// Check import.meta.url for directive to export jslint to window-object.
|
|
1936
|
+
// Useful for ES5-era browser-scripts that rely on window.jslint,
|
|
1937
|
+
// like CodeMirror.
|
|
1938
|
+
//
|
|
1939
|
+
// Example usage:
|
|
1940
|
+
// <script type="module" src="./jslint.mjs?window_jslint=1"></script>
|
|
1941
|
+
|
|
1942
|
+
import_meta_url = import_meta_url || jslint_import_meta_url;
|
|
1943
|
+
if (
|
|
1944
|
+
jslint_rgx_url_search_window_jslint.test(import_meta_url)
|
|
1945
|
+
&& (typeof globalThis === "object" && globalThis)
|
|
1946
|
+
) {
|
|
1947
|
+
globalThis.jslint = jslint;
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1708
1950
|
// Feature-detect nodejs.
|
|
1709
1951
|
|
|
1710
1952
|
if (!(
|
|
1711
|
-
typeof process === "object"
|
|
1712
|
-
&& process
|
|
1953
|
+
(typeof process === "object" && process)
|
|
1713
1954
|
&& process.versions
|
|
1714
1955
|
&& typeof process.versions.node === "string"
|
|
1715
1956
|
&& !mode_noop
|
|
@@ -1735,7 +1976,7 @@ async function jslint_cli({
|
|
|
1735
1976
|
).test(process_argv[1])
|
|
1736
1977
|
|| mode_cli
|
|
1737
1978
|
)
|
|
1738
|
-
&& moduleUrl.fileURLToPath(
|
|
1979
|
+
&& moduleUrl.fileURLToPath(import_meta_url)
|
|
1739
1980
|
=== modulePath.resolve(process_argv[1])
|
|
1740
1981
|
)
|
|
1741
1982
|
&& !mode_cli
|
|
@@ -1881,7 +2122,9 @@ async function jslint_cli({
|
|
|
1881
2122
|
option
|
|
1882
2123
|
});
|
|
1883
2124
|
if (mode_report) {
|
|
1884
|
-
|
|
2125
|
+
result = jslint.jslint_report(result);
|
|
2126
|
+
result = `<body class="JSLINT_ JSLINT_REPORT_">\n${result}</body>\n`;
|
|
2127
|
+
await fsWriteFileWithParents(mode_report, result);
|
|
1885
2128
|
}
|
|
1886
2129
|
process_exit(exit_code);
|
|
1887
2130
|
return exit_code;
|
|
@@ -8969,6 +9212,7 @@ function jslint_report({
|
|
|
8969
9212
|
|
|
8970
9213
|
// This function will create human-readable, html-report
|
|
8971
9214
|
// for warnings, properties, and functions from jslint-result-object.
|
|
9215
|
+
//
|
|
8972
9216
|
// Example usage:
|
|
8973
9217
|
// let result = jslint("console.log('hello world')");
|
|
8974
9218
|
// let html = jslint_report(result);
|
|
@@ -9001,7 +9245,6 @@ function jslint_report({
|
|
|
9001
9245
|
);
|
|
9002
9246
|
}
|
|
9003
9247
|
|
|
9004
|
-
html += "<div class=\"JSLINT_\" id=\"JSLINT_REPORT_HTML\">\n";
|
|
9005
9248
|
html += String(`
|
|
9006
9249
|
<style class="JSLINT_REPORT_STYLE">
|
|
9007
9250
|
/* jslint utility2:true */
|
|
@@ -9150,19 +9393,38 @@ pyNj+JctcQLXenBOCms46aMkenIx45WpXqxxVJQLz/vgpmAVa0fmDv6Pue9xVTBPfVxCUGfj\
|
|
|
9150
9393
|
/7xoEqvL+2E8VOyCTuT/7j269Zy4jUtN+g4="
|
|
9151
9394
|
) format("woff2");
|
|
9152
9395
|
}
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9396
|
+
.JSLINT_,
|
|
9397
|
+
.JSLINT_ address,
|
|
9398
|
+
.JSLINT_ button,
|
|
9399
|
+
.JSLINT_ cite,
|
|
9400
|
+
.JSLINT_ dd,
|
|
9401
|
+
.JSLINT_ dfn,
|
|
9402
|
+
.JSLINT_ dl,
|
|
9403
|
+
.JSLINT_ dt,
|
|
9404
|
+
.JSLINT_ fieldset,
|
|
9405
|
+
.JSLINT_ fieldset > div,
|
|
9406
|
+
.JSLINT_ input,
|
|
9407
|
+
.JSLINT_ label,
|
|
9408
|
+
.JSLINT_ legend,
|
|
9409
|
+
.JSLINT_ ol,
|
|
9410
|
+
.JSLINT_ samp,
|
|
9411
|
+
.JSLINT_ style,
|
|
9412
|
+
.JSLINT_ textarea,
|
|
9413
|
+
.JSLINT_ ul {
|
|
9156
9414
|
border: 0;
|
|
9157
9415
|
box-sizing: border-box;
|
|
9158
9416
|
margin: 0;
|
|
9159
9417
|
padding: 0;
|
|
9160
9418
|
}
|
|
9419
|
+
/* disable text inflation algorithm used on some smartphones and tablets */
|
|
9161
9420
|
.JSLINT_ {
|
|
9162
9421
|
-ms-text-size-adjust: none;
|
|
9163
9422
|
-webkit-text-size-adjust: none;
|
|
9164
9423
|
text-size-adjust: none;
|
|
9165
9424
|
}
|
|
9425
|
+
.JSLINT_REPORT_ div {
|
|
9426
|
+
box-sizing: border-box;
|
|
9427
|
+
}
|
|
9166
9428
|
/*csslint ignore:end*/
|
|
9167
9429
|
|
|
9168
9430
|
/* css - jslint_report - font */
|
|
@@ -9196,7 +9458,7 @@ pyNj+JctcQLXenBOCms46aMkenIx45WpXqxxVJQLz/vgpmAVa0fmDv6Pue9xVTBPfVxCUGfj\
|
|
|
9196
9458
|
}
|
|
9197
9459
|
|
|
9198
9460
|
/* css - jslint_report - general */
|
|
9199
|
-
|
|
9461
|
+
.JSLINT_ {
|
|
9200
9462
|
background: antiquewhite;
|
|
9201
9463
|
}
|
|
9202
9464
|
.JSLINT_ fieldset {
|
|
@@ -9533,7 +9795,6 @@ body {
|
|
|
9533
9795
|
});
|
|
9534
9796
|
html += "</div>\n";
|
|
9535
9797
|
html += "</fieldset>\n";
|
|
9536
|
-
html += "</div>\n";
|
|
9537
9798
|
return html;
|
|
9538
9799
|
}
|
|
9539
9800
|
|
|
@@ -10349,11 +10610,11 @@ async function v8CoverageReportCreate({
|
|
|
10349
10610
|
// 3. Create html-coverage-reports in <coverageDir>.
|
|
10350
10611
|
|
|
10351
10612
|
let cwd;
|
|
10613
|
+
let excludeList = [];
|
|
10352
10614
|
let exitCode = 0;
|
|
10353
10615
|
let fileDict;
|
|
10354
|
-
let
|
|
10355
|
-
let
|
|
10356
|
-
let fileIncludeNodeModules;
|
|
10616
|
+
let includeList = [];
|
|
10617
|
+
let modeIncludeNodeModules;
|
|
10357
10618
|
let processArgElem;
|
|
10358
10619
|
let promiseList = [];
|
|
10359
10620
|
let v8CoverageObj;
|
|
@@ -10378,9 +10639,19 @@ async function v8CoverageReportCreate({
|
|
|
10378
10639
|
<style>
|
|
10379
10640
|
/* jslint utility2:true */
|
|
10380
10641
|
/*csslint ignore:start*/
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10642
|
+
.coverage,
|
|
10643
|
+
.coverage a,
|
|
10644
|
+
.coverage div,
|
|
10645
|
+
.coverage pre,
|
|
10646
|
+
.coverage span,
|
|
10647
|
+
.coverage table,
|
|
10648
|
+
.coverage tbody,
|
|
10649
|
+
.coverage td,
|
|
10650
|
+
.coverage th,
|
|
10651
|
+
.coverage thead,
|
|
10652
|
+
.coverage tr {
|
|
10653
|
+
box-sizing: border-box;
|
|
10654
|
+
font-family: monospace;
|
|
10384
10655
|
}
|
|
10385
10656
|
/*csslint ignore:end*/
|
|
10386
10657
|
|
|
@@ -10526,6 +10797,7 @@ body {
|
|
|
10526
10797
|
}
|
|
10527
10798
|
txtBorder = (
|
|
10528
10799
|
"+" + "-".repeat(padPathname + 2) + "+"
|
|
10800
|
+
+ "-".repeat(padLines + 2) + "+"
|
|
10529
10801
|
+ "-".repeat(padLines + 2) + "+\n"
|
|
10530
10802
|
);
|
|
10531
10803
|
txt = "";
|
|
@@ -10533,7 +10805,8 @@ body {
|
|
|
10533
10805
|
txt += txtBorder;
|
|
10534
10806
|
txt += (
|
|
10535
10807
|
"| " + String("Files covered").padEnd(padPathname, " ") + " | "
|
|
10536
|
-
+ String("Lines").padStart(padLines, " ") + "
|
|
10808
|
+
+ String("Lines").padStart(padLines, " ") + " | "
|
|
10809
|
+
+ String("Remaining").padStart(padLines, " ") + " |\n"
|
|
10537
10810
|
);
|
|
10538
10811
|
txt += txtBorder;
|
|
10539
10812
|
fileList.forEach(function ({
|
|
@@ -10613,7 +10886,8 @@ body {
|
|
|
10613
10886
|
+ String("./" + pathname).padEnd(padPathname, " ") + " | "
|
|
10614
10887
|
+ String(
|
|
10615
10888
|
modeCoverageIgnoreFile + " " + coveragePct + " %"
|
|
10616
|
-
).padStart(padLines, " ") + "
|
|
10889
|
+
).padStart(padLines, " ") + " | "
|
|
10890
|
+
+ " ".repeat(padLines) + " |\n"
|
|
10617
10891
|
);
|
|
10618
10892
|
txt += (
|
|
10619
10893
|
"| " + "*".repeat(
|
|
@@ -10621,6 +10895,9 @@ body {
|
|
|
10621
10895
|
).padEnd(padPathname, "_") + " | "
|
|
10622
10896
|
+ String(
|
|
10623
10897
|
linesCovered + " / " + linesTotal
|
|
10898
|
+
).padStart(padLines, " ") + " | "
|
|
10899
|
+
+ String(
|
|
10900
|
+
(linesTotal - linesCovered) + " / " + linesTotal
|
|
10624
10901
|
).padStart(padLines, " ") + " |\n"
|
|
10625
10902
|
);
|
|
10626
10903
|
txt += txtBorder;
|
|
@@ -10784,21 +11061,6 @@ ${String(count || "-0").padStart(7, " ")}
|
|
|
10784
11061
|
), txt));
|
|
10785
11062
|
}
|
|
10786
11063
|
|
|
10787
|
-
function pathnameRelativeCwd(pathname) {
|
|
10788
|
-
|
|
10789
|
-
// This function will if <pathname> is inside <cwd>,
|
|
10790
|
-
// return it relative to <cwd>, else empty-string.
|
|
10791
|
-
|
|
10792
|
-
pathname = modulePath.resolve(pathname).replace((
|
|
10793
|
-
/\\/g
|
|
10794
|
-
), "/");
|
|
10795
|
-
if (!pathname.startsWith(cwd)) {
|
|
10796
|
-
return;
|
|
10797
|
-
}
|
|
10798
|
-
pathname = pathname.slice(cwd.length);
|
|
10799
|
-
return pathname;
|
|
10800
|
-
}
|
|
10801
|
-
|
|
10802
11064
|
/*
|
|
10803
11065
|
function sentinel() {}
|
|
10804
11066
|
*/
|
|
@@ -10830,28 +11092,28 @@ function sentinel() {}
|
|
|
10830
11092
|
processArgElem[1] = processArgElem.slice(1).join("=");
|
|
10831
11093
|
switch (processArgElem[0]) {
|
|
10832
11094
|
|
|
10833
|
-
// PR-371
|
|
11095
|
+
// PR-371
|
|
11096
|
+
// Add cli-option `--exclude=...`.
|
|
10834
11097
|
|
|
10835
11098
|
case "--exclude":
|
|
10836
|
-
|
|
10837
|
-
processArgElem[1].split(",")
|
|
10838
|
-
);
|
|
11099
|
+
excludeList.push(processArgElem[1]);
|
|
10839
11100
|
break;
|
|
10840
11101
|
|
|
10841
|
-
// PR-371
|
|
11102
|
+
// PR-371
|
|
11103
|
+
// Add cli-option `--include=...`
|
|
10842
11104
|
|
|
10843
|
-
case "--
|
|
10844
|
-
|
|
10845
|
-
/0|false|null|undefined/
|
|
10846
|
-
).test(processArgElem[1]);
|
|
11105
|
+
case "--include":
|
|
11106
|
+
includeList.push(processArgElem[1]);
|
|
10847
11107
|
break;
|
|
10848
11108
|
|
|
10849
|
-
// PR-
|
|
11109
|
+
// PR-400
|
|
11110
|
+
// Disable default-coverage of directory `node_modules`,
|
|
11111
|
+
// but allow override with cli-option `--include-node-modules=1`.
|
|
10850
11112
|
|
|
10851
|
-
case "--include":
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
);
|
|
11113
|
+
case "--include-node-modules":
|
|
11114
|
+
modeIncludeNodeModules = !(
|
|
11115
|
+
/0|false|null|undefined/
|
|
11116
|
+
).test(processArgElem[1]);
|
|
10855
11117
|
break;
|
|
10856
11118
|
}
|
|
10857
11119
|
}
|
|
@@ -10905,9 +11167,11 @@ function sentinel() {}
|
|
|
10905
11167
|
).test(file);
|
|
10906
11168
|
});
|
|
10907
11169
|
v8CoverageObj = await Promise.all(v8CoverageObj.map(async function (file) {
|
|
10908
|
-
let data
|
|
11170
|
+
let data;
|
|
11171
|
+
let pathnameDict = Object.create(null);
|
|
11172
|
+
data = await moduleFs.promises.readFile(coverageDir + file, "utf8");
|
|
10909
11173
|
data = JSON.parse(data);
|
|
10910
|
-
data.result
|
|
11174
|
+
data.result.forEach(function (scriptCov) {
|
|
10911
11175
|
let pathname = scriptCov.url;
|
|
10912
11176
|
|
|
10913
11177
|
// Filter out internal coverages.
|
|
@@ -10918,38 +11182,40 @@ function sentinel() {}
|
|
|
10918
11182
|
|
|
10919
11183
|
// Normalize pathname.
|
|
10920
11184
|
|
|
10921
|
-
pathname =
|
|
10922
|
-
|
|
11185
|
+
pathname = moduleUrl.fileURLToPath(pathname);
|
|
11186
|
+
pathname = modulePath.resolve(pathname).replace((
|
|
11187
|
+
/\\/g
|
|
11188
|
+
), "/");
|
|
10923
11189
|
|
|
10924
11190
|
// Filter files outside of cwd.
|
|
10925
11191
|
|
|
10926
|
-
|
|
10927
|
-
|
|
11192
|
+
if (pathname.indexOf("[") >= 0 || !pathname.startsWith(cwd)) {
|
|
11193
|
+
return;
|
|
11194
|
+
}
|
|
10928
11195
|
|
|
10929
|
-
//
|
|
11196
|
+
// Normalize pathname relative to cwd.
|
|
10930
11197
|
|
|
10931
|
-
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
).test(pathname)
|
|
10936
|
-
)
|
|
11198
|
+
pathname = pathname.slice(cwd.length);
|
|
11199
|
+
scriptCov.url = pathname;
|
|
11200
|
+
pathnameDict[pathname] = scriptCov;
|
|
11201
|
+
});
|
|
10937
11202
|
|
|
10938
|
-
// PR-
|
|
11203
|
+
// PR-400
|
|
11204
|
+
// Filter directory `node_modules`.
|
|
10939
11205
|
|
|
10940
|
-
|
|
11206
|
+
if (!modeIncludeNodeModules) {
|
|
11207
|
+
excludeList.push("node_modules/");
|
|
11208
|
+
}
|
|
10941
11209
|
|
|
10942
|
-
// PR-
|
|
11210
|
+
// PR-400
|
|
11211
|
+
// Filter files by glob-patterns in excludeList, includeList.
|
|
10943
11212
|
|
|
10944
|
-
|
|
10945
|
-
|
|
10946
|
-
|
|
10947
|
-
|
|
10948
|
-
|
|
10949
|
-
|
|
10950
|
-
}
|
|
10951
|
-
scriptCov.url = pathname;
|
|
10952
|
-
return true;
|
|
11213
|
+
data.result = globExclude({
|
|
11214
|
+
excludeList,
|
|
11215
|
+
includeList,
|
|
11216
|
+
pathnameList: Object.keys(pathnameDict)
|
|
11217
|
+
}).pathnameList.map(function (pathname) {
|
|
11218
|
+
return pathnameDict[pathname];
|
|
10953
11219
|
});
|
|
10954
11220
|
return data;
|
|
10955
11221
|
}));
|
|
@@ -10958,7 +11224,7 @@ function sentinel() {}
|
|
|
10958
11224
|
|
|
10959
11225
|
v8CoverageObj = v8CoverageListMerge(v8CoverageObj);
|
|
10960
11226
|
|
|
10961
|
-
//
|
|
11227
|
+
// Debug v8CoverageObj.
|
|
10962
11228
|
|
|
10963
11229
|
await fsWriteFileWithParents(
|
|
10964
11230
|
coverageDir + "v8_coverage_merged.json",
|
|
@@ -11098,6 +11364,7 @@ jslint_export = Object.freeze(Object.assign(jslint, {
|
|
|
11098
11364
|
assertOrThrow,
|
|
11099
11365
|
debugInline,
|
|
11100
11366
|
fsWriteFileWithParents,
|
|
11367
|
+
globExclude,
|
|
11101
11368
|
htmlEscape,
|
|
11102
11369
|
jslint,
|
|
11103
11370
|
jslint_apidoc,
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=14"
|
|
13
13
|
},
|
|
14
|
-
"fileCount":
|
|
14
|
+
"fileCount": 29,
|
|
15
15
|
"homepage": "https://github.com/sqlmath/sqlmath",
|
|
16
16
|
"keywords": [
|
|
17
17
|
"data-science",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
32
|
-
"url": "https://github.com/sqlmath/sqlmath"
|
|
32
|
+
"url": "https://github.com/sqlmath/sqlmath.git"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "sh jslint_ci.sh shCiBuildNodejs",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"test2": "sh jslint_ci.sh shCiBase",
|
|
38
38
|
"test_win32": "node -e \"require('child_process').spawn('C:\\\\Program Files\\\\Git\\\\bin\\\\bash.exe',['-c','npm run test' + ' ' + process.argv.slice(1).join(' ')],{stdio:['ignore',1,2]});\""
|
|
39
39
|
},
|
|
40
|
-
"version": "2022.
|
|
40
|
+
"version": "2022.5.20"
|
|
41
41
|
}
|