test-pmd-rule 1.2.1 → 1.2.2

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.
@@ -1,144 +1,13 @@
1
1
  #!/usr/bin/env node
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
-
28
- // node_modules/.pnpm/lodash.flatten@4.4.0/node_modules/lodash.flatten/index.js
29
- var require_lodash = __commonJS({
30
- "node_modules/.pnpm/lodash.flatten@4.4.0/node_modules/lodash.flatten/index.js"(exports, module) {
31
- var MAX_SAFE_INTEGER = 9007199254740991;
32
- var argsTag = "[object Arguments]";
33
- var funcTag = "[object Function]";
34
- var genTag = "[object GeneratorFunction]";
35
- var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
36
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
37
- var root = freeGlobal || freeSelf || Function("return this")();
38
- function arrayPush(array, values) {
39
- var index = -1, length = values.length, offset = array.length;
40
- while (++index < length) {
41
- array[offset + index] = values[index];
42
- }
43
- return array;
44
- }
45
- var objectProto = Object.prototype;
46
- var hasOwnProperty = objectProto.hasOwnProperty;
47
- var objectToString = objectProto.toString;
48
- var Symbol2 = root.Symbol;
49
- var propertyIsEnumerable = objectProto.propertyIsEnumerable;
50
- var spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : void 0;
51
- function baseFlatten(array, depth, predicate, isStrict, result) {
52
- var index = -1, length = array.length;
53
- predicate || (predicate = isFlattenable);
54
- result || (result = []);
55
- while (++index < length) {
56
- var value = array[index];
57
- if (depth > 0 && predicate(value)) {
58
- if (depth > 1) {
59
- baseFlatten(value, depth - 1, predicate, isStrict, result);
60
- } else {
61
- arrayPush(result, value);
62
- }
63
- } else if (!isStrict) {
64
- result[result.length] = value;
65
- }
66
- }
67
- return result;
68
- }
69
- function isFlattenable(value) {
70
- return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
71
- }
72
- function flatten(array) {
73
- var length = array ? array.length : 0;
74
- return length ? baseFlatten(array, 1) : [];
75
- }
76
- function isArguments(value) {
77
- return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
78
- }
79
- var isArray = Array.isArray;
80
- function isArrayLike(value) {
81
- return value != null && isLength(value.length) && !isFunction(value);
82
- }
83
- function isArrayLikeObject(value) {
84
- return isObjectLike(value) && isArrayLike(value);
85
- }
86
- function isFunction(value) {
87
- var tag = isObject(value) ? objectToString.call(value) : "";
88
- return tag == funcTag || tag == genTag;
89
- }
90
- function isLength(value) {
91
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
92
- }
93
- function isObject(value) {
94
- var type = typeof value;
95
- return !!value && (type == "object" || type == "function");
96
- }
97
- function isObjectLike(value) {
98
- return !!value && typeof value == "object";
99
- }
100
- module.exports = flatten;
101
- }
102
- });
103
-
104
- // node_modules/.pnpm/stringify-tree@1.1.1/node_modules/stringify-tree/index.js
105
- var require_stringify_tree = __commonJS({
106
- "node_modules/.pnpm/stringify-tree@1.1.1/node_modules/stringify-tree/index.js"(exports) {
107
- "use strict";
108
- Object.defineProperty(exports, "__esModule", { value: true });
109
- var flatten = require_lodash();
110
- function stringifyTree2(tn, nameFn, childrenFn) {
111
- function prefixChild(strs, last) {
112
- return strs.map(function(s, i) {
113
- var prefix = i === 0 ? last ? "\u2514\u2500" : "\u251C\u2500" : last ? " " : "\u2502 ";
114
- return prefix + s;
115
- });
116
- }
117
- function nodeToStrings(tn2) {
118
- var origChildren = childrenFn(tn2) || [];
119
- var children = origChildren.slice();
120
- if (children.length === 0) {
121
- return ["\u2500 " + nameFn(tn2)];
122
- }
123
- return ["\u252C " + nameFn(tn2)].concat(flatten(children.map(function(c, i) {
124
- var strs = nodeToStrings(c);
125
- return prefixChild(strs, i === children.length - 1);
126
- })));
127
- }
128
- return nodeToStrings(tn).join("\n");
129
- }
130
- exports.stringifyTree = stringifyTree2;
131
- }
132
- });
133
2
 
134
3
  // src/cli/main.ts
135
- var import_stringify_tree = __toESM(require_stringify_tree(), 1);
136
4
  import { existsSync as existsSync2, readdirSync, statSync } from "fs";
137
5
  import { extname, resolve as resolve3 } from "path";
138
6
  import { argv } from "process";
139
7
  import { cpus } from "os";
140
8
  import { pathToFileURL } from "url";
141
9
  import { DOMParser as DOMParser4 } from "@xmldom/xmldom";
10
+ import { stringifyTree } from "stringify-tree";
142
11
 
143
12
  // src/tester/RuleTester.ts
144
13
  import { readFileSync as readFileSync4, existsSync } from "fs";
@@ -502,7 +371,7 @@ function checkConditionPart(part, content) {
502
371
  return contentLower.includes(nodeType.toLowerCase());
503
372
  }
504
373
  if (partLower.includes("newlistliteralexpression")) {
505
- return /new\s+List\s*[<\(]/.test(contentLower);
374
+ return /new\s+list\s*[<\(]/i.test(content);
506
375
  }
507
376
  const keywords = part.split(/[=<>!()\[\]\/\.@\$]+/).map((s) => s.trim()).filter(
508
377
  (s) => s.length > MIN_EXPRESSION_LENGTH2 && !s.startsWith("@") && s !== "and" && s !== "or" && s !== "not"
@@ -4438,7 +4307,7 @@ function parseXmlAstAndStripWrappers(options) {
4438
4307
  wrapperInfo,
4439
4308
  xpath
4440
4309
  });
4441
- const treeOutput = (0, import_stringify_tree.stringifyTree)(
4310
+ const treeOutput = stringifyTree(
4442
4311
  treeNode,
4443
4312
  // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types -- Callback parameter for stringify-tree
4444
4313
  (node) => applyColorToNodeName(node.name, node.color),