@eagleoutice/flowr 2.2.16 → 2.4.0
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/README.md +48 -20
- package/abstract-interpretation/data-frame/absint-info.d.ts +109 -0
- package/abstract-interpretation/data-frame/absint-info.js +31 -0
- package/abstract-interpretation/data-frame/absint-visitor.d.ts +58 -0
- package/abstract-interpretation/data-frame/absint-visitor.js +171 -0
- package/abstract-interpretation/data-frame/domain.d.ts +107 -0
- package/abstract-interpretation/data-frame/domain.js +315 -0
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +17 -0
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +166 -0
- package/abstract-interpretation/data-frame/mappers/arguments.d.ts +117 -0
- package/abstract-interpretation/data-frame/mappers/arguments.js +188 -0
- package/abstract-interpretation/data-frame/mappers/assignment-mapper.d.ts +20 -0
- package/abstract-interpretation/data-frame/mappers/assignment-mapper.js +34 -0
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +261 -0
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +1219 -0
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +12 -0
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +206 -0
- package/abstract-interpretation/data-frame/resolve-args.d.ts +42 -0
- package/abstract-interpretation/data-frame/resolve-args.js +118 -0
- package/abstract-interpretation/data-frame/semantics.d.ts +213 -0
- package/abstract-interpretation/data-frame/semantics.js +363 -0
- package/abstract-interpretation/data-frame/shape-inference.d.ts +38 -0
- package/abstract-interpretation/data-frame/shape-inference.js +111 -0
- package/benchmark/slicer.d.ts +15 -1
- package/benchmark/slicer.js +137 -0
- package/benchmark/stats/print.js +123 -45
- package/benchmark/stats/size-of.d.ts +7 -0
- package/benchmark/stats/size-of.js +1 -0
- package/benchmark/stats/stats.d.ts +30 -1
- package/benchmark/stats/stats.js +4 -2
- package/benchmark/summarizer/data.d.ts +33 -2
- package/benchmark/summarizer/first-phase/input.js +5 -1
- package/benchmark/summarizer/first-phase/process.js +47 -1
- package/benchmark/summarizer/second-phase/graph.js +1 -1
- package/benchmark/summarizer/second-phase/process.js +102 -4
- package/cli/benchmark-app.d.ts +2 -0
- package/cli/benchmark-app.js +2 -0
- package/cli/benchmark-helper-app.d.ts +2 -0
- package/cli/benchmark-helper-app.js +10 -3
- package/cli/common/options.js +4 -0
- package/cli/repl/commands/repl-query.js +1 -1
- package/cli/repl/server/connection.js +14 -5
- package/config.d.ts +31 -0
- package/config.js +21 -1
- package/control-flow/basic-cfg-guided-visitor.d.ts +1 -2
- package/control-flow/basic-cfg-guided-visitor.js +0 -6
- package/control-flow/cfg-simplification.d.ts +6 -0
- package/control-flow/cfg-simplification.js +18 -9
- package/control-flow/control-flow-graph.d.ts +3 -8
- package/control-flow/control-flow-graph.js +5 -6
- package/control-flow/dfg-cfg-guided-visitor.js +1 -1
- package/control-flow/extract-cfg.d.ts +2 -2
- package/control-flow/extract-cfg.js +52 -63
- package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +1 -1
- package/core/steps/all/static-slicing/00-slice.d.ts +7 -1
- package/core/steps/all/static-slicing/00-slice.js +9 -3
- package/core/steps/pipeline/default-pipelines.d.ts +74 -74
- package/dataflow/environments/built-in.d.ts +7 -5
- package/dataflow/environments/built-in.js +16 -13
- package/dataflow/eval/resolve/alias-tracking.js +2 -2
- package/dataflow/eval/resolve/resolve.d.ts +53 -9
- package/dataflow/eval/resolve/resolve.js +132 -38
- package/dataflow/graph/dataflowgraph-builder.js +2 -2
- package/dataflow/graph/graph.js +1 -1
- package/dataflow/graph/invert-dfg.d.ts +2 -0
- package/dataflow/graph/invert-dfg.js +17 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +4 -0
- package/documentation/doc-util/doc-query.js +11 -1
- package/documentation/doc-util/doc-search.js +2 -2
- package/documentation/print-cfg-wiki.js +3 -4
- package/documentation/print-core-wiki.js +2 -2
- package/documentation/print-dataflow-graph-wiki.js +7 -0
- package/documentation/print-faq-wiki.js +4 -0
- package/documentation/print-interface-wiki.js +11 -0
- package/documentation/print-linter-wiki.js +36 -4
- package/documentation/print-linting-and-testing-wiki.js +13 -1
- package/documentation/print-onboarding-wiki.js +4 -0
- package/documentation/print-query-wiki.js +29 -3
- package/linter/linter-executor.js +1 -2
- package/linter/linter-format.d.ts +26 -4
- package/linter/linter-format.js +25 -6
- package/linter/linter-rules.d.ts +63 -12
- package/linter/linter-rules.js +5 -1
- package/linter/rules/absolute-path.d.ts +4 -7
- package/linter/rules/absolute-path.js +9 -6
- package/linter/rules/dataframe-access-validation.d.ts +55 -0
- package/linter/rules/dataframe-access-validation.js +118 -0
- package/linter/rules/dead-code.d.ts +43 -0
- package/linter/rules/dead-code.js +50 -0
- package/linter/rules/deprecated-functions.d.ts +3 -2
- package/linter/rules/deprecated-functions.js +3 -1
- package/linter/rules/file-path-validity.d.ts +4 -4
- package/linter/rules/file-path-validity.js +8 -6
- package/linter/rules/naming-convention.d.ts +5 -4
- package/linter/rules/naming-convention.js +8 -2
- package/linter/rules/seeded-randomness.d.ts +4 -3
- package/linter/rules/seeded-randomness.js +3 -1
- package/linter/rules/unused-definition.d.ts +2 -0
- package/linter/rules/unused-definition.js +3 -1
- package/package.json +2 -2
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +6 -1
- package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -0
- package/queries/catalog/dependencies-query/function-info/write-functions.js +1 -0
- package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +3 -0
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +46 -0
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +72 -0
- package/queries/catalog/df-shape-query/df-shape-query-format.js +31 -0
- package/queries/catalog/linter-query/linter-query-format.js +1 -1
- package/queries/catalog/location-map-query/location-map-query-executor.js +7 -5
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +3 -0
- package/queries/catalog/location-map-query/location-map-query-format.js +1 -0
- package/queries/catalog/search-query/search-query-executor.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +2 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +3 -0
- package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -1
- package/queries/query-print.d.ts +1 -1
- package/queries/query-print.js +0 -1
- package/queries/query.d.ts +77 -6
- package/queries/query.js +26 -11
- package/search/flowr-search-builder.d.ts +6 -6
- package/search/flowr-search-executor.d.ts +2 -2
- package/search/flowr-search-executor.js +1 -1
- package/search/flowr-search.d.ts +13 -8
- package/search/flowr-search.js +21 -0
- package/search/search-executor/search-enrichers.d.ts +87 -20
- package/search/search-executor/search-enrichers.js +44 -5
- package/search/search-executor/search-generators.d.ts +4 -4
- package/search/search-executor/search-generators.js +12 -7
- package/search/search-executor/search-mappers.js +3 -2
- package/search/search-executor/search-transformer.d.ts +3 -3
- package/search/search-executor/search-transformer.js +2 -2
- package/slicing/static/static-slicer.d.ts +4 -2
- package/slicing/static/static-slicer.js +10 -4
- package/util/collections/arrays.d.ts +2 -0
- package/util/collections/arrays.js +9 -0
- package/util/files.d.ts +8 -2
- package/util/files.js +22 -4
- package/util/mermaid/dfg.js +4 -2
- package/util/r-value.d.ts +23 -0
- package/util/r-value.js +113 -0
- package/util/range.d.ts +1 -0
- package/util/range.js +5 -1
- package/util/version.js +1 -1
- package/util/cfg/cfg.d.ts +0 -0
- package/util/cfg/cfg.js +0 -2
package/util/files.js
CHANGED
|
@@ -124,36 +124,54 @@ function writeTableAsCsv(table, file, sep = ',', newline = '\n') {
|
|
|
124
124
|
/**
|
|
125
125
|
* Reads a file line by line and calls the given function for each line.
|
|
126
126
|
* The `lineNumber` starts at `0`.
|
|
127
|
+
* The `maxLines` option limits the maximum number of read lines and is `Infinity` by default.
|
|
128
|
+
*
|
|
129
|
+
* @returns Whether all lines have been successfully read (`false` if `maxLines` was reached)
|
|
127
130
|
*
|
|
128
131
|
* See {@link readLineByLineSync} for a synchronous version.
|
|
129
132
|
*/
|
|
130
|
-
async function readLineByLine(filePath, onLine) {
|
|
133
|
+
async function readLineByLine(filePath, onLine, maxLines = Infinity) {
|
|
134
|
+
if (!(await fs_1.default.promises.stat(filePath).catch(() => { }))?.isFile()) {
|
|
135
|
+
log_1.log.warn(`File ${filePath} does not exist`);
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
131
138
|
const reader = new n_readlines_1.default(filePath);
|
|
132
139
|
let line;
|
|
133
140
|
let counter = 0;
|
|
134
141
|
// eslint-disable-next-line no-cond-assign
|
|
135
142
|
while (line = reader.next()) {
|
|
143
|
+
if (counter >= maxLines) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
136
146
|
await onLine(line, counter++);
|
|
137
147
|
}
|
|
148
|
+
return true;
|
|
138
149
|
}
|
|
139
150
|
/**
|
|
140
151
|
* Reads a file line by line and calls the given function for each line.
|
|
141
152
|
* The `lineNumber` starts at `0`.
|
|
153
|
+
* The `maxLines` option limits the maximum number of read lines and is `Infinity` by default.
|
|
154
|
+
*
|
|
155
|
+
* @returns Whether the file exists and all lines have been successfully read (`false` if `maxLines` was reached)
|
|
142
156
|
*
|
|
143
157
|
* See {@link readLineByLine} for an asynchronous version.
|
|
144
158
|
*/
|
|
145
|
-
function readLineByLineSync(filePath, onLine) {
|
|
146
|
-
if (!fs_1.default.
|
|
159
|
+
function readLineByLineSync(filePath, onLine, maxLines = Infinity) {
|
|
160
|
+
if (!fs_1.default.statSync(filePath, { throwIfNoEntry: false })?.isFile()) {
|
|
147
161
|
log_1.log.warn(`File ${filePath} does not exist`);
|
|
148
|
-
return;
|
|
162
|
+
return false;
|
|
149
163
|
}
|
|
150
164
|
const reader = new n_readlines_1.default(filePath);
|
|
151
165
|
let line;
|
|
152
166
|
let counter = 0;
|
|
153
167
|
// eslint-disable-next-line no-cond-assign
|
|
154
168
|
while (line = reader.next()) {
|
|
169
|
+
if (counter >= maxLines) {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
155
172
|
onLine(line, counter++);
|
|
156
173
|
}
|
|
174
|
+
return true;
|
|
157
175
|
}
|
|
158
176
|
/**
|
|
159
177
|
* Chops off the last part of the given directory path after a path separator, essentially returning the path's parent directory.
|
package/util/mermaid/dfg.js
CHANGED
|
@@ -6,7 +6,6 @@ exports.graphToMermaid = graphToMermaid;
|
|
|
6
6
|
exports.graphToMermaidUrl = graphToMermaidUrl;
|
|
7
7
|
exports.diffGraphsToMermaid = diffGraphsToMermaid;
|
|
8
8
|
exports.diffGraphsToMermaidUrl = diffGraphsToMermaidUrl;
|
|
9
|
-
const assert_1 = require("../assert");
|
|
10
9
|
const mermaid_1 = require("./mermaid");
|
|
11
10
|
const graph_1 = require("../../dataflow/graph/graph");
|
|
12
11
|
const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
@@ -176,7 +175,10 @@ function vertexToMermaid(info, mermaid, id, idPrefix, mark) {
|
|
|
176
175
|
mermaid.nodeLines.push(` style ${idPrefix}${id} stroke:red,stroke-width:5px; `);
|
|
177
176
|
}
|
|
178
177
|
const edges = mermaid.rootGraph.get((0, node_id_1.normalizeIdToNumberIfPossible)(id), true);
|
|
179
|
-
|
|
178
|
+
if (edges === undefined) {
|
|
179
|
+
mermaid.nodeLines.push(' %% No edges found for ' + id);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
180
182
|
const artificialCdEdges = (info.cds ?? []).map(x => [x.id, { types: new Set([x.when ? 'CD-True' : 'CD-False']) }]);
|
|
181
183
|
// eslint-disable-next-line prefer-const
|
|
182
184
|
for (let [target, edge] of [...edges[1], ...artificialCdEdges]) {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Value, ValueInterval, ValueLogical, ValueNumber, ValueString, ValueVector } from '../dataflow/eval/values/r-value';
|
|
2
|
+
import type { RLogicalValue } from '../r-bridge/lang-4.x/ast/model/nodes/r-logical';
|
|
3
|
+
import { type RNumberValue, type RStringValue } from '../r-bridge/lang-4.x/convert-values';
|
|
4
|
+
export declare function isRStringValue(value: unknown): value is RStringValue;
|
|
5
|
+
export declare function isRNumberValue(value: unknown): value is RNumberValue;
|
|
6
|
+
export declare function isRLogicalValue(value: unknown): value is RLogicalValue;
|
|
7
|
+
export declare function unwrapRValue(value: RStringValue | string): string;
|
|
8
|
+
export declare function unwrapRValue(value: RNumberValue | number): number;
|
|
9
|
+
export declare function unwrapRValue(value: RLogicalValue): boolean;
|
|
10
|
+
export declare function unwrapRValue(value: RStringValue | RNumberValue | RLogicalValue | string | number): string | number | boolean;
|
|
11
|
+
export declare function unwrapRValue(value: unknown): string | number | boolean | undefined;
|
|
12
|
+
export declare function unwrapRVector(value: RStringValue[] | string[]): string[];
|
|
13
|
+
export declare function unwrapRVector(value: RNumberValue[] | number[]): number[];
|
|
14
|
+
export declare function unwrapRVector(value: RLogicalValue[]): boolean[];
|
|
15
|
+
export declare function unwrapRVector(value: RStringValue[] | RNumberValue[] | RLogicalValue[] | string[] | number[]): string[] | number[] | boolean[];
|
|
16
|
+
export declare function unwrapRVector(value: unknown): string[] | number[] | boolean[] | (string | number | boolean)[] | undefined;
|
|
17
|
+
export declare function unwrapRValueToString(value: RStringValue | RNumberValue | RLogicalValue | string | number): string;
|
|
18
|
+
export declare function unwrapRValueToString(value: unknown): string | undefined;
|
|
19
|
+
export declare function unliftRValue(value: ValueString): RStringValue | undefined;
|
|
20
|
+
export declare function unliftRValue(value: ValueNumber | ValueInterval): RNumberValue | undefined;
|
|
21
|
+
export declare function unliftRValue(value: ValueLogical): RLogicalValue | undefined;
|
|
22
|
+
export declare function unliftRValue(value: ValueVector): (RStringValue | RNumberValue | RLogicalValue)[] | undefined;
|
|
23
|
+
export declare function unliftRValue(value: Value): RStringValue | RNumberValue | boolean | (RStringValue | RNumberValue | RLogicalValue)[] | undefined;
|
package/util/r-value.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isRStringValue = isRStringValue;
|
|
4
|
+
exports.isRNumberValue = isRNumberValue;
|
|
5
|
+
exports.isRLogicalValue = isRLogicalValue;
|
|
6
|
+
exports.unwrapRValue = unwrapRValue;
|
|
7
|
+
exports.unwrapRVector = unwrapRVector;
|
|
8
|
+
exports.unwrapRValueToString = unwrapRValueToString;
|
|
9
|
+
exports.unliftRValue = unliftRValue;
|
|
10
|
+
const r_value_1 = require("../dataflow/eval/values/r-value");
|
|
11
|
+
const convert_values_1 = require("../r-bridge/lang-4.x/convert-values");
|
|
12
|
+
const assert_1 = require("./assert");
|
|
13
|
+
function isRValue(value) {
|
|
14
|
+
return isRStringValue(value) || isRNumberValue(value) || isRLogicalValue(value) || typeof value === 'string' || typeof value === 'number';
|
|
15
|
+
}
|
|
16
|
+
function isRStringValue(value) {
|
|
17
|
+
return typeof value === 'object' && value !== null && 'str' in value && typeof value.str === 'string';
|
|
18
|
+
}
|
|
19
|
+
function isRNumberValue(value) {
|
|
20
|
+
return typeof value === 'object' && value !== null && 'num' in value && typeof value.num === 'number';
|
|
21
|
+
}
|
|
22
|
+
function isRLogicalValue(value) {
|
|
23
|
+
return typeof value === 'boolean';
|
|
24
|
+
}
|
|
25
|
+
function unwrapRValue(value) {
|
|
26
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
else if (isRStringValue(value)) {
|
|
30
|
+
return value.str;
|
|
31
|
+
}
|
|
32
|
+
else if (isRNumberValue(value)) {
|
|
33
|
+
return value.num;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function unwrapRVector(value) {
|
|
40
|
+
if (!Array.isArray(value)) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
else if (value.every(entry => typeof entry === 'string') || value.every(entry => typeof entry === 'number') || value.every(entry => typeof entry === 'boolean')) {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
else if (value.every(isRStringValue)) {
|
|
47
|
+
return value.map(entry => unwrapRValue(entry));
|
|
48
|
+
}
|
|
49
|
+
else if (value.every(isRNumberValue)) {
|
|
50
|
+
return value.map(entry => unwrapRValue(entry));
|
|
51
|
+
}
|
|
52
|
+
else if (value.every(isRValue)) {
|
|
53
|
+
return value.map(entry => unwrapRValue(entry));
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function unwrapRValueToString(value) {
|
|
60
|
+
if (typeof value === 'string') {
|
|
61
|
+
return value;
|
|
62
|
+
}
|
|
63
|
+
else if (typeof value === 'number') {
|
|
64
|
+
return value.toString();
|
|
65
|
+
}
|
|
66
|
+
else if (typeof value === 'boolean') {
|
|
67
|
+
return value ? convert_values_1.RTrue : convert_values_1.RFalse;
|
|
68
|
+
}
|
|
69
|
+
else if (isRStringValue(value)) {
|
|
70
|
+
return value.str;
|
|
71
|
+
}
|
|
72
|
+
else if (isRNumberValue(value)) {
|
|
73
|
+
return value.num.toString();
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function unliftRValue(value) {
|
|
80
|
+
if (!(0, r_value_1.isValue)(value)) {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
const type = value.type;
|
|
84
|
+
switch (type) {
|
|
85
|
+
case 'string': {
|
|
86
|
+
return (0, r_value_1.isValue)(value.value) ? value.value : undefined;
|
|
87
|
+
}
|
|
88
|
+
case 'number': {
|
|
89
|
+
return (0, r_value_1.isValue)(value.value) ? value.value : undefined;
|
|
90
|
+
}
|
|
91
|
+
case 'logical': {
|
|
92
|
+
return (0, r_value_1.isValue)(value.value) && typeof value.value === 'boolean' ? value.value : undefined;
|
|
93
|
+
}
|
|
94
|
+
case 'interval': {
|
|
95
|
+
const start = unliftRValue(value.start);
|
|
96
|
+
const end = unliftRValue(value.end);
|
|
97
|
+
return start !== undefined && end !== undefined && start.num === end.num ? start : undefined;
|
|
98
|
+
}
|
|
99
|
+
case 'vector': {
|
|
100
|
+
const values = (0, r_value_1.isValue)(value.elements) ? value.elements.map(unliftRValue) : undefined;
|
|
101
|
+
return values?.every(assert_1.isNotUndefined) ? values.flat() : undefined;
|
|
102
|
+
}
|
|
103
|
+
case 'set': {
|
|
104
|
+
return (0, r_value_1.isValue)(value.elements) && value.elements.length === 1 ? unliftRValue(value.elements[0]) : undefined;
|
|
105
|
+
}
|
|
106
|
+
case 'missing': {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
default:
|
|
110
|
+
(0, assert_1.assertUnreachable)(type);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=r-value.js.map
|
package/util/range.d.ts
CHANGED
|
@@ -68,3 +68,4 @@ export declare function rangeCompare([r1sl, r1sc, ,]: SourceRange, [r2sl, r2sc,
|
|
|
68
68
|
* Checks if the first range is a subset of the second range.
|
|
69
69
|
*/
|
|
70
70
|
export declare function rangeIsSubsetOf([r1sl, r1sc, r1el, r1ec]: SourceRange, [r2sl, r2sc, r2el, r2ec]: SourceRange): boolean;
|
|
71
|
+
export declare function combineRanges(...ranges: SourceRange[]): SourceRange[];
|
package/util/range.js
CHANGED
|
@@ -9,6 +9,7 @@ exports.rangesOverlap = rangesOverlap;
|
|
|
9
9
|
exports.addRanges = addRanges;
|
|
10
10
|
exports.rangeCompare = rangeCompare;
|
|
11
11
|
exports.rangeIsSubsetOf = rangeIsSubsetOf;
|
|
12
|
+
exports.combineRanges = combineRanges;
|
|
12
13
|
const assert_1 = require("./assert");
|
|
13
14
|
function getRangeStart(p) {
|
|
14
15
|
return p === undefined ? undefined : [p[0], p[1]];
|
|
@@ -70,6 +71,9 @@ function rangeCompare([r1sl, r1sc, ,], [r2sl, r2sc, ,]) {
|
|
|
70
71
|
* Checks if the first range is a subset of the second range.
|
|
71
72
|
*/
|
|
72
73
|
function rangeIsSubsetOf([r1sl, r1sc, r1el, r1ec], [r2sl, r2sc, r2el, r2ec]) {
|
|
73
|
-
return r1sl
|
|
74
|
+
return (r1sl > r2sl || r1sl === r2sl && r1sc >= r2sc) && (r1el < r2el || r1sl === r2sl && r1ec <= r2ec);
|
|
75
|
+
}
|
|
76
|
+
function combineRanges(...ranges) {
|
|
77
|
+
return ranges.filter(range => !ranges.some(other => range !== other && rangeIsSubsetOf(range, other)));
|
|
74
78
|
}
|
|
75
79
|
//# sourceMappingURL=range.js.map
|
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.
|
|
6
|
+
const version = '2.4.0';
|
|
7
7
|
function flowrVersion() {
|
|
8
8
|
return new semver_1.SemVer(version);
|
|
9
9
|
}
|
package/util/cfg/cfg.d.ts
DELETED
|
File without changes
|
package/util/cfg/cfg.js
DELETED