@eagleoutice/flowr 2.2.3 → 2.2.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 (66) hide show
  1. package/README.md +412 -39
  2. package/benchmark/slicer.js +0 -1
  3. package/benchmark/summarizer/first-phase/process.js +18 -8
  4. package/benchmark/summarizer/summarizer.d.ts +1 -1
  5. package/benchmark/summarizer/summarizer.js +1 -1
  6. package/cli/benchmark-app.js +1 -1
  7. package/cli/common/script.js +0 -1
  8. package/cli/repl/commands/repl-cfg.js +38 -8
  9. package/cli/repl/commands/repl-commands.js +1 -1
  10. package/cli/repl/commands/repl-dataflow.js +38 -8
  11. package/cli/repl/commands/repl-normalize.js +38 -8
  12. package/cli/repl/commands/repl-query.js +2 -2
  13. package/cli/repl/core.d.ts +1 -1
  14. package/cli/repl/core.js +40 -21
  15. package/cli/repl/print-version.js +2 -1
  16. package/cli/repl/server/connection.js +17 -7
  17. package/cli/repl/server/messages/all-messages.js +17 -7
  18. package/cli/repl/server/messages/message-repl.js +17 -7
  19. package/cli/repl/server/messages/message-slice.js +17 -7
  20. package/cli/script-core/statistics-helper-core.js +0 -1
  21. package/config.d.ts +2 -2
  22. package/config.js +7 -1
  23. package/core/print/normalize-printer.js +0 -1
  24. package/dataflow/environments/resolve-by-name.d.ts +2 -0
  25. package/dataflow/environments/resolve-by-name.js +2 -0
  26. package/dataflow/graph/resolve-graph.js +1 -1
  27. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +1 -1
  28. package/documentation/data/server/doc-data-server-messages.js +1 -2
  29. package/documentation/doc-util/doc-auto-gen.d.ts +1 -0
  30. package/documentation/doc-util/doc-auto-gen.js +5 -1
  31. package/documentation/doc-util/doc-benchmarks.d.ts +23 -0
  32. package/documentation/doc-util/doc-benchmarks.js +76 -0
  33. package/documentation/doc-util/doc-code.d.ts +1 -0
  34. package/documentation/doc-util/doc-code.js +4 -0
  35. package/documentation/doc-util/doc-files.d.ts +1 -0
  36. package/documentation/doc-util/doc-files.js +2 -1
  37. package/documentation/doc-util/doc-server-message.js +1 -1
  38. package/documentation/doc-util/doc-structure.d.ts +1 -1
  39. package/documentation/doc-util/doc-structure.js +2 -2
  40. package/documentation/doc-util/doc-types.d.ts +1 -0
  41. package/documentation/doc-util/doc-types.js +16 -8
  42. package/documentation/print-core-wiki.js +8 -1
  43. package/documentation/print-interface-wiki.js +21 -15
  44. package/documentation/print-linting-and-testing-wiki.js +3 -1
  45. package/documentation/print-readme.d.ts +1 -0
  46. package/documentation/print-readme.js +160 -0
  47. package/package.json +28 -40
  48. package/queries/catalog/dependencies-query/dependencies-query-executor.js +77 -45
  49. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +3 -0
  50. package/queries/catalog/dependencies-query/dependencies-query-format.js +3 -2
  51. package/r-bridge/lang-4.x/ast/model/model.d.ts +2 -3
  52. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +1 -0
  53. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +3 -0
  54. package/r-bridge/shell.js +18 -8
  55. package/statistics/features/supported/comments/comments.js +17 -7
  56. package/statistics/features/supported/used-functions/post-process.js +0 -1
  57. package/statistics/features/supported/used-packages/used-packages.js +17 -7
  58. package/statistics/features/supported/values/values.js +17 -7
  59. package/statistics/summarizer/summarizer.js +1 -2
  60. package/util/files.js +17 -7
  61. package/util/json.js +0 -2
  62. package/util/numbers.d.ts +1 -0
  63. package/util/numbers.js +5 -0
  64. package/util/parallel.js +17 -7
  65. package/util/quads.js +3 -3
  66. package/util/version.js +1 -1
@@ -12,7 +12,6 @@ const visitor_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/visit
12
12
  const assert_1 = require("../../../util/assert");
13
13
  const objects_1 = require("../../../util/objects");
14
14
  const SupportedVertexTypes = [type_1.RType.String, type_1.RType.Logical, type_1.RType.Number];
15
- const Unknown = 'unknown';
16
15
  function executeDependenciesQuery(data, queries) {
17
16
  if (queries.length !== 1) {
18
17
  log_1.log.warn('Dependencies query expects only up to one query, but got ', queries.length, 'only using the first query');
@@ -26,10 +25,24 @@ function executeDependenciesQuery(data, queries) {
26
25
  const writeFunctions = getFunctionsToCheck(query.writeFunctions, ignoreDefault, dependencies_query_format_1.WriteFunctions);
27
26
  const numberOfFunctions = libraryFunctions.length + sourceFunctions.length + readFunctions.length + writeFunctions.length;
28
27
  const results = numberOfFunctions === 0 ? { kinds: {}, '.meta': { timing: 0 } } : (0, query_1.executeQueriesOfSameType)(data, ...makeCallContextQuery(libraryFunctions, 'library'), ...makeCallContextQuery(sourceFunctions, 'source'), ...makeCallContextQuery(readFunctions, 'read'), ...makeCallContextQuery(writeFunctions, 'write'));
29
- const libraries = getResults(data, results, 'library', libraryFunctions, (id, vertex, argument) => ({
28
+ const getLexeme = (argument, id) => {
29
+ if ((argument && argument !== dependencies_query_format_1.Unknown) || !id) {
30
+ return undefined;
31
+ }
32
+ let get = data.ast.idMap.get(id);
33
+ if (!get) {
34
+ return undefined;
35
+ }
36
+ if (get.type === type_1.RType.Argument) {
37
+ get = get.value;
38
+ }
39
+ return get?.info.fullLexeme ?? get?.lexeme;
40
+ };
41
+ const libraries = getResults(data, results, 'library', libraryFunctions, (id, vertex, argId, argument) => ({
30
42
  nodeId: id,
31
43
  functionName: vertex.name,
32
- libraryName: argument ?? Unknown
44
+ lexemeOfArgument: getLexeme(argument, argId),
45
+ libraryName: argument ?? dependencies_query_format_1.Unknown
33
46
  }), [type_1.RType.Symbol]);
34
47
  if (!ignoreDefault) {
35
48
  /* for libraries, we have to additionally track all uses of `::` and `:::`, for this we currently simply traverse all uses */
@@ -44,24 +57,27 @@ function executeDependenciesQuery(data, queries) {
44
57
  }
45
58
  });
46
59
  }
47
- const sourcedFiles = getResults(data, results, 'source', sourceFunctions, (id, vertex, argument, linkedIds) => ({
60
+ const sourcedFiles = getResults(data, results, 'source', sourceFunctions, (id, vertex, argId, argument, linkedIds) => ({
48
61
  nodeId: id,
49
62
  functionName: vertex.name,
50
- file: argument ?? Unknown,
51
- linkedIds: (linkedIds?.length ?? 0) > 0 ? linkedIds : undefined
63
+ file: argument ?? dependencies_query_format_1.Unknown,
64
+ lexemeOfArgument: getLexeme(argument, argId),
65
+ linkedIds: linkedIds?.length ? linkedIds : undefined
52
66
  }));
53
- const readData = getResults(data, results, 'read', readFunctions, (id, vertex, argument, linkedIds) => ({
67
+ const readData = getResults(data, results, 'read', readFunctions, (id, vertex, argId, argument, linkedIds) => ({
54
68
  nodeId: id,
55
69
  functionName: vertex.name,
56
- source: argument ?? Unknown,
57
- linkedIds: (linkedIds?.length ?? 0) > 0 ? linkedIds : undefined
70
+ source: argument ?? dependencies_query_format_1.Unknown,
71
+ lexemeOfArgument: getLexeme(argument, argId),
72
+ linkedIds: linkedIds?.length ? linkedIds : undefined
58
73
  }));
59
- const writtenData = getResults(data, results, 'write', writeFunctions, (id, vertex, argument, linkedIds) => ({
74
+ const writtenData = getResults(data, results, 'write', writeFunctions, (id, vertex, argId, argument, linkedIds) => ({
60
75
  nodeId: id,
61
76
  functionName: vertex.name,
62
77
  // write functions that don't have argIndex are assumed to write to stdout
63
- destination: argument ?? ((linkedIds?.length ?? 0) > 0 ? Unknown : 'stdout'),
64
- linkedIds: (linkedIds?.length ?? 0) > 0 ? linkedIds : undefined
78
+ destination: argument ?? (linkedIds?.length ? dependencies_query_format_1.Unknown : 'stdout'),
79
+ lexemeOfArgument: getLexeme(argument, argId),
80
+ linkedIds: linkedIds?.length ? linkedIds : undefined
65
81
  }));
66
82
  return {
67
83
  '.meta': {
@@ -82,7 +98,8 @@ function makeCallContextQuery(functions, kind) {
82
98
  }));
83
99
  }
84
100
  function getResults(data, results, kind, functions, makeInfo, additionalAllowedTypes) {
85
- return Object.entries(results?.kinds[kind]?.subkinds ?? {}).flatMap(([name, results]) => results.flatMap(({ id, linkedIds }) => {
101
+ const kindEntries = Object.entries(results?.kinds[kind]?.subkinds ?? {});
102
+ return kindEntries.flatMap(([name, results]) => results.flatMap(({ id, linkedIds }) => {
86
103
  const vertex = data.dataflow.graph.getVertex(id);
87
104
  const info = functions.find(f => f.name === name);
88
105
  let index = info.argIdx;
@@ -94,43 +111,58 @@ function getResults(data, results, kind, functions, makeInfo, additionalAllowedT
94
111
  }
95
112
  const args = index !== undefined ? getArgumentValue(data, vertex, index, additionalAllowedTypes) : undefined;
96
113
  if (!args) {
97
- return (0, objects_1.compactRecord)(makeInfo(id, vertex, undefined, linkedIds));
114
+ const record = (0, objects_1.compactRecord)(makeInfo(id, vertex, undefined, undefined, linkedIds));
115
+ return record ? [record] : [];
98
116
  }
99
- return args.flatMap(a => (0, objects_1.compactRecord)(makeInfo(id, vertex, a, linkedIds)));
100
- })).filter(assert_1.isNotUndefined) ?? [];
101
- }
102
- function getArgumentValue({ dataflow: { graph } }, vertex, argumentIndex, additionalAllowedTypes) {
103
- if (vertex) {
104
- if (argumentIndex === 'unnamed') {
105
- // return all unnamed arguments
106
- const references = vertex.args.filter(arg => arg !== r_function_call_1.EmptyArgument && !arg.name).map(graph_1.getReferenceOfArgument);
107
- return references.map(ref => {
108
- if (!ref) {
109
- return undefined;
110
- }
111
- let valueNode = graph.idMap?.get(ref);
112
- if (valueNode?.type === type_1.RType.Argument) {
113
- valueNode = valueNode.value;
114
- }
115
- if (valueNode) {
116
- const allowedTypes = [...SupportedVertexTypes, ...additionalAllowedTypes ?? []];
117
- return allowedTypes.includes(valueNode.type) ? (0, retriever_1.removeRQuotes)(valueNode.lexeme) : Unknown;
117
+ const results = [];
118
+ for (const [arg, values] of args.entries()) {
119
+ for (const value of values) {
120
+ const result = (0, objects_1.compactRecord)(makeInfo(id, vertex, arg, value, linkedIds));
121
+ if (result) {
122
+ results.push(result);
118
123
  }
119
- });
124
+ }
120
125
  }
121
- if (vertex.args.length > argumentIndex) {
122
- const arg = (0, graph_1.getReferenceOfArgument)(vertex.args[argumentIndex]);
123
- if (arg) {
124
- let valueNode = graph.idMap?.get(arg);
125
- if (valueNode?.type === type_1.RType.Argument) {
126
- valueNode = valueNode.value;
127
- }
128
- if (valueNode) {
129
- const allowedTypes = [...SupportedVertexTypes, ...additionalAllowedTypes ?? []];
130
- return [allowedTypes.includes(valueNode.type) ? (0, retriever_1.removeRQuotes)(valueNode.lexeme) : Unknown];
131
- }
126
+ return results;
127
+ })) ?? [];
128
+ }
129
+ /**
130
+ * Get the values of all arguments matching the criteria.
131
+ */
132
+ function getArgumentValue({ dataflow: { graph } }, vertex, argumentIndex, additionalAllowedTypes) {
133
+ if (!vertex) {
134
+ return undefined;
135
+ }
136
+ if (argumentIndex === 'unnamed') {
137
+ // return all unnamed arguments
138
+ const references = vertex.args.filter(arg => arg !== r_function_call_1.EmptyArgument && !arg.name).map(graph_1.getReferenceOfArgument).filter(assert_1.isNotUndefined);
139
+ const map = new Map();
140
+ for (const ref of references) {
141
+ let valueNode = graph.idMap?.get(ref);
142
+ if (valueNode?.type === type_1.RType.Argument) {
143
+ valueNode = valueNode.value;
144
+ }
145
+ if (valueNode) {
146
+ const allowedTypes = [...SupportedVertexTypes, ...additionalAllowedTypes ?? []];
147
+ const value = allowedTypes.includes(valueNode.type) ? (0, retriever_1.removeRQuotes)(valueNode.lexeme) : dependencies_query_format_1.Unknown;
148
+ map.set(ref, new Set([value]));
132
149
  }
133
150
  }
151
+ return map;
152
+ }
153
+ if (vertex.args.length > argumentIndex) {
154
+ const arg = (0, graph_1.getReferenceOfArgument)(vertex.args[argumentIndex]);
155
+ if (!arg) {
156
+ return undefined;
157
+ }
158
+ let valueNode = graph.idMap?.get(arg);
159
+ if (valueNode?.type === type_1.RType.Argument) {
160
+ valueNode = valueNode.value;
161
+ }
162
+ if (valueNode) {
163
+ const allowedTypes = [...SupportedVertexTypes, ...additionalAllowedTypes ?? []];
164
+ return new Map([[arg, new Set([allowedTypes.includes(valueNode.type) ? (0, retriever_1.removeRQuotes)(valueNode.lexeme) : dependencies_query_format_1.Unknown])]]);
165
+ }
134
166
  }
135
167
  return undefined;
136
168
  }
@@ -2,6 +2,7 @@ import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
2
2
  import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
3
3
  import Joi from 'joi';
4
4
  import { executeDependenciesQuery } from './dependencies-query-executor';
5
+ export declare const Unknown = "unknown";
5
6
  export declare const LibraryFunctions: FunctionInfo[];
6
7
  export declare const SourceFunctions: FunctionInfo[];
7
8
  export declare const ReadFunctions: FunctionInfo[];
@@ -30,6 +31,8 @@ export interface DependencyInfo extends Record<string, unknown> {
30
31
  nodeId: NodeId;
31
32
  functionName: string;
32
33
  linkedIds?: readonly NodeId[];
34
+ /** the lexeme is presented whenever the specific info is of {@link Unknown} */
35
+ lexemeOfArgument?: string;
33
36
  }
34
37
  export type LibraryInfo = (DependencyInfo & {
35
38
  libraryName: 'unknown' | string;
@@ -3,11 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DependenciesQueryDefinition = exports.WriteFunctions = exports.ReadFunctions = exports.SourceFunctions = exports.LibraryFunctions = void 0;
6
+ exports.DependenciesQueryDefinition = exports.WriteFunctions = exports.ReadFunctions = exports.SourceFunctions = exports.LibraryFunctions = exports.Unknown = void 0;
7
7
  const ansi_1 = require("../../../util/ansi");
8
8
  const time_1 = require("../../../util/time");
9
9
  const joi_1 = __importDefault(require("joi"));
10
10
  const dependencies_query_executor_1 = require("./dependencies-query-executor");
11
+ exports.Unknown = 'unknown';
11
12
  // these lists are originally based on https://github.com/duncantl/CodeDepends/blob/7fd96dfee16b252e5f642c77a7ababf48e9326f8/R/codeTypes.R
12
13
  exports.LibraryFunctions = [
13
14
  { name: 'library', argIdx: 0, argName: 'package' },
@@ -87,7 +88,7 @@ exports.ReadFunctions = [
87
88
  { name: 'Import', argIdx: 0, argName: 'file' },
88
89
  ];
89
90
  exports.WriteFunctions = [
90
- { name: 'save', argIdx: 0, argName: '...' },
91
+ { name: 'save', argIdx: 2, argName: 'file' },
91
92
  { name: 'save.image', argIdx: 0, argName: 'file' },
92
93
  { name: 'write', argIdx: 1, argName: 'file' },
93
94
  { name: 'dput', argIdx: 1, argName: 'file' },
@@ -23,9 +23,8 @@ import type { RUnaryOp } from './nodes/r-unary-op';
23
23
  import type { RBinaryOp } from './nodes/r-binary-op';
24
24
  import type { RPipe } from './nodes/r-pipe';
25
25
  import type { RDelimiter } from './nodes/info/r-delimiter';
26
- /** Simply an empty interface used to say that there are additional decorations (see {@link Base}). */
27
- export interface NoInfo {
28
- }
26
+ /** Simply an empty type constraint used to say that there are additional decorations (see {@link Base}). */
27
+ export type NoInfo = object;
29
28
  /**
30
29
  * Will be used to reconstruct the source of the given element in the R-ast.
31
30
  * This will not be part of most comparisons as it is mainly of interest to the reconstruction of R code.
@@ -13,6 +13,7 @@ export declare class TreeSitterExecutor implements SyncParser<Parser.Tree> {
13
13
  static initTreeSitter(): Promise<void>;
14
14
  constructor();
15
15
  rVersion(): Promise<string | 'unknown' | 'none'>;
16
+ treeSitterVersion(): number;
16
17
  parse(request: RParseRequest): Parser.Tree;
17
18
  close(): void;
18
19
  }
@@ -39,6 +39,9 @@ class TreeSitterExecutor {
39
39
  rVersion() {
40
40
  return Promise.resolve('none');
41
41
  }
42
+ treeSitterVersion() {
43
+ return this.parser.getLanguage().version;
44
+ }
42
45
  parse(request) {
43
46
  let sourceCode;
44
47
  if (request.request === 'file') {
package/r-bridge/shell.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -349,7 +359,7 @@ class RShellSession {
349
359
  try {
350
360
  fs_1.default.rmSync(f, { recursive: true, force: true });
351
361
  }
352
- catch (e) {
362
+ catch {
353
363
  log_1.log.error(`failed to unlink file ${f}`);
354
364
  }
355
365
  }
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.comments = exports.initialCommentInfo = void 0;
27
37
  const xpath = __importStar(require("xpath-ts2"));
@@ -96,7 +96,6 @@ function retrieveFunctionCallMetaInformation(info, outputPath) {
96
96
  console.log(` [${(0, time_1.date2string)(new Date())}] Used functions metadata reading completed, summarizing and writing to file`);
97
97
  writeFunctionCallsMetaInformationToCsv(outputPath, data);
98
98
  for (const [index, arg] of data.args.entries()) {
99
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
100
99
  if (!arg) {
101
100
  // we treat the first/0-argument entry separate for legacy reasons
102
101
  continue;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.usedPackages = exports.initialUsedPackageInfos = void 0;
27
37
  const xpath = __importStar(require("xpath-ts2"));
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.values = void 0;
27
37
  const xpath = __importStar(require("xpath-ts2"));
@@ -88,7 +88,7 @@ class StatisticsSummarizer extends summarizer_1.Summarizer {
88
88
  try {
89
89
  fs_1.default.rmSync(path, { recursive: true, force: true });
90
90
  }
91
- catch (e) {
91
+ catch {
92
92
  log_1.log.error('failure in cleanup');
93
93
  }
94
94
  }
@@ -122,7 +122,6 @@ class StatisticsSummarizer extends summarizer_1.Summarizer {
122
122
  this.log(`Found ${count} files to summarize`);
123
123
  return Promise.resolve();
124
124
  }
125
- // eslint-disable-next-line @typescript-eslint/require-await -- just to obey the structure
126
125
  async summarizePhase() {
127
126
  // detect all subfolders in the current folder (default, test...) for each: concat.
128
127
  this.removeIfExists(this.config.outputPath);
package/util/files.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
package/util/json.js CHANGED
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  // to get the types within JSON.stringify
3
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
3
  Object.defineProperty(exports, "__esModule", { value: true });
5
4
  exports.jsonReplacer = jsonReplacer;
6
5
  exports.jsonBigIntRetriever = jsonBigIntRetriever;
@@ -11,7 +10,6 @@ function jsonReplacer(key, value) {
11
10
  return undefined;
12
11
  }
13
12
  else if (value instanceof Map || value instanceof Set) {
14
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
15
13
  return [...value];
16
14
  }
17
15
  else if (typeof value === 'bigint') {
package/util/numbers.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare function bigint2number(a: bigint | string): number;
2
+ export declare function roundToDecimals(value: number, decimals: number): number;
package/util/numbers.js CHANGED
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.bigint2number = bigint2number;
4
+ exports.roundToDecimals = roundToDecimals;
4
5
  function bigint2number(a) {
5
6
  // we have to remove the trailing `n`
6
7
  return Number(String(a).slice(0, -1));
7
8
  }
9
+ function roundToDecimals(value, decimals) {
10
+ const factor = 10 ** decimals;
11
+ return Math.round(value * factor) / factor;
12
+ }
8
13
  //# sourceMappingURL=numbers.js.map
package/util/parallel.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.LimitedThreadPool = void 0;
27
37
  /**
package/util/quads.js CHANGED
@@ -15,12 +15,12 @@ exports.defaultQuadIgnoreIf = defaultQuadIgnoreIf;
15
15
  exports.serialize2quads = serialize2quads;
16
16
  exports.graph2quads = graph2quads;
17
17
  const n3_1 = require("n3");
18
- var namedNode = n3_1.DataFactory.namedNode;
19
- var quad = n3_1.DataFactory.quad;
18
+ const namedNode = (v) => n3_1.DataFactory.namedNode(v);
19
+ const quad = (s, p, o, g) => n3_1.DataFactory.quad(s, p, o, g);
20
20
  const objects_1 = require("./objects");
21
21
  const assert_1 = require("./assert");
22
22
  const defaultmap_1 = require("./defaultmap");
23
- var literal = n3_1.DataFactory.literal;
23
+ const literal = (v, n) => n3_1.DataFactory.literal(v, n);
24
24
  const log_1 = require("./log");
25
25
  const domain = 'https://uni-ulm.de/r-ast/';
26
26
  /**
package/util/version.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.flowrVersion = flowrVersion;
4
4
  const semver_1 = require("semver");
5
5
  // this is automatically replaced with the current version by release-it
6
- const version = '2.2.3';
6
+ const version = '2.2.5';
7
7
  function flowrVersion() {
8
8
  return new semver_1.SemVer(version);
9
9
  }