@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
package/dist/lits.iife.js
CHANGED
|
@@ -15132,27 +15132,47 @@ var Lits = (function (exports) {
|
|
|
15132
15132
|
};
|
|
15133
15133
|
AutoCompleter.prototype.generateSuggestions = function (params) {
|
|
15134
15134
|
var _this = this;
|
|
15135
|
+
var blacklist = new Set(['0_def', '0_defn', '0_fn']);
|
|
15136
|
+
var startsWithCaseSensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15137
|
+
return !blacklist.has(suggestion) && suggestion.startsWith(_this.searchString);
|
|
15138
|
+
});
|
|
15139
|
+
startsWithCaseSensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15140
|
+
var startsWithCaseInsensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15141
|
+
return !blacklist.has(suggestion) && suggestion.toLowerCase().startsWith(_this.searchString.toLowerCase());
|
|
15142
|
+
});
|
|
15143
|
+
startsWithCaseInsensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15144
|
+
var includesCaseSensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15145
|
+
return !blacklist.has(suggestion) && suggestion.includes(_this.searchString);
|
|
15146
|
+
});
|
|
15147
|
+
includesCaseSensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15148
|
+
var includesCaseInsensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15149
|
+
return !blacklist.has(suggestion) && suggestion.includes(_this.searchString.toLowerCase());
|
|
15150
|
+
});
|
|
15151
|
+
includesCaseInsensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15152
|
+
return __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(startsWithCaseSensitive), false), __read(startsWithCaseInsensitive), false), __read(includesCaseSensitive), false), __read(includesCaseInsensitive), false);
|
|
15153
|
+
};
|
|
15154
|
+
AutoCompleter.prototype.generateWithPredicate = function (params, shouldInclude) {
|
|
15135
15155
|
var _a, _b, _c, _d;
|
|
15136
15156
|
var suggestions = new Set();
|
|
15137
|
-
litsCommands.forEach(function (
|
|
15138
|
-
if (
|
|
15139
|
-
suggestions.add(
|
|
15157
|
+
litsCommands.forEach(function (suggestion) {
|
|
15158
|
+
if (shouldInclude(suggestion)) {
|
|
15159
|
+
suggestions.add(suggestion);
|
|
15140
15160
|
}
|
|
15141
15161
|
});
|
|
15142
15162
|
Object.keys((_a = params.globalContext) !== null && _a !== void 0 ? _a : {})
|
|
15143
|
-
.filter(
|
|
15144
|
-
.forEach(function (
|
|
15163
|
+
.filter(shouldInclude)
|
|
15164
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15145
15165
|
(_b = params.contexts) === null || _b === void 0 ? void 0 : _b.forEach(function (context) {
|
|
15146
15166
|
Object.keys(context)
|
|
15147
|
-
.filter(
|
|
15148
|
-
.forEach(function (
|
|
15167
|
+
.filter(shouldInclude)
|
|
15168
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15149
15169
|
});
|
|
15150
15170
|
Object.keys((_c = params.jsFunctions) !== null && _c !== void 0 ? _c : {})
|
|
15151
|
-
.filter(
|
|
15152
|
-
.forEach(function (
|
|
15171
|
+
.filter(shouldInclude)
|
|
15172
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15153
15173
|
Object.keys((_d = params.values) !== null && _d !== void 0 ? _d : {})
|
|
15154
|
-
.filter(
|
|
15155
|
-
.forEach(function (
|
|
15174
|
+
.filter(shouldInclude)
|
|
15175
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15156
15176
|
return __spreadArray([], __read(suggestions), false).sort(function (a, b) { return a.localeCompare(b); });
|
|
15157
15177
|
};
|
|
15158
15178
|
return AutoCompleter;
|