@mojir/lits 2.1.27 → 2.1.28
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/dist/cli/cli.js +32 -12
- package/dist/cli/src/AutoCompleter/AutoCompleter.d.ts +1 -0
- package/dist/index.esm.js +31 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +31 -11
- package/dist/index.js.map +1 -1
- package/dist/lits.iife.js +31 -11
- package/dist/lits.iife.js.map +1 -1
- package/dist/src/AutoCompleter/AutoCompleter.d.ts +1 -0
- package/dist/testFramework.esm.js +31 -11
- package/dist/testFramework.esm.js.map +1 -1
- package/dist/testFramework.js +31 -11
- package/dist/testFramework.js.map +1 -1
- package/package.json +1 -1
|
@@ -15096,27 +15096,47 @@ var AutoCompleter = /** @class */ (function () {
|
|
|
15096
15096
|
};
|
|
15097
15097
|
AutoCompleter.prototype.generateSuggestions = function (params) {
|
|
15098
15098
|
var _this = this;
|
|
15099
|
+
var blacklist = new Set(['0_def', '0_defn', '0_fn']);
|
|
15100
|
+
var startsWithCaseSensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15101
|
+
return !blacklist.has(suggestion) && suggestion.startsWith(_this.searchString);
|
|
15102
|
+
});
|
|
15103
|
+
startsWithCaseSensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15104
|
+
var startsWithCaseInsensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15105
|
+
return !blacklist.has(suggestion) && suggestion.toLowerCase().startsWith(_this.searchString.toLowerCase());
|
|
15106
|
+
});
|
|
15107
|
+
startsWithCaseInsensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15108
|
+
var includesCaseSensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15109
|
+
return !blacklist.has(suggestion) && suggestion.includes(_this.searchString);
|
|
15110
|
+
});
|
|
15111
|
+
includesCaseSensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15112
|
+
var includesCaseInsensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15113
|
+
return !blacklist.has(suggestion) && suggestion.includes(_this.searchString.toLowerCase());
|
|
15114
|
+
});
|
|
15115
|
+
includesCaseInsensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15116
|
+
return __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(startsWithCaseSensitive), false), __read(startsWithCaseInsensitive), false), __read(includesCaseSensitive), false), __read(includesCaseInsensitive), false);
|
|
15117
|
+
};
|
|
15118
|
+
AutoCompleter.prototype.generateWithPredicate = function (params, shouldInclude) {
|
|
15099
15119
|
var _a, _b, _c, _d;
|
|
15100
15120
|
var suggestions = new Set();
|
|
15101
|
-
litsCommands.forEach(function (
|
|
15102
|
-
if (
|
|
15103
|
-
suggestions.add(
|
|
15121
|
+
litsCommands.forEach(function (suggestion) {
|
|
15122
|
+
if (shouldInclude(suggestion)) {
|
|
15123
|
+
suggestions.add(suggestion);
|
|
15104
15124
|
}
|
|
15105
15125
|
});
|
|
15106
15126
|
Object.keys((_a = params.globalContext) !== null && _a !== void 0 ? _a : {})
|
|
15107
|
-
.filter(
|
|
15108
|
-
.forEach(function (
|
|
15127
|
+
.filter(shouldInclude)
|
|
15128
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15109
15129
|
(_b = params.contexts) === null || _b === void 0 ? void 0 : _b.forEach(function (context) {
|
|
15110
15130
|
Object.keys(context)
|
|
15111
|
-
.filter(
|
|
15112
|
-
.forEach(function (
|
|
15131
|
+
.filter(shouldInclude)
|
|
15132
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15113
15133
|
});
|
|
15114
15134
|
Object.keys((_c = params.jsFunctions) !== null && _c !== void 0 ? _c : {})
|
|
15115
|
-
.filter(
|
|
15116
|
-
.forEach(function (
|
|
15135
|
+
.filter(shouldInclude)
|
|
15136
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15117
15137
|
Object.keys((_d = params.values) !== null && _d !== void 0 ? _d : {})
|
|
15118
|
-
.filter(
|
|
15119
|
-
.forEach(function (
|
|
15138
|
+
.filter(shouldInclude)
|
|
15139
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15120
15140
|
return __spreadArray([], __read(suggestions), false).sort(function (a, b) { return a.localeCompare(b); });
|
|
15121
15141
|
};
|
|
15122
15142
|
return AutoCompleter;
|