@mojir/lits 2.1.26 → 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 +33 -13
- package/dist/cli/src/AutoCompleter/AutoCompleter.d.ts +1 -0
- package/dist/index.esm.js +32 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +32 -12
- package/dist/index.js.map +1 -1
- package/dist/lits.iife.js +32 -12
- package/dist/lits.iife.js.map +1 -1
- package/dist/src/AutoCompleter/AutoCompleter.d.ts +1 -0
- package/dist/testFramework.esm.js +32 -12
- package/dist/testFramework.esm.js.map +1 -1
- package/dist/testFramework.js +32 -12
- package/dist/testFramework.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/cli.js
CHANGED
|
@@ -92,7 +92,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
92
92
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
var version = "2.1.
|
|
95
|
+
var version = "2.1.28";
|
|
96
96
|
|
|
97
97
|
function getCodeMarker(sourceCodeInfo) {
|
|
98
98
|
if (!sourceCodeInfo.position || !sourceCodeInfo.code)
|
|
@@ -11358,7 +11358,7 @@ function generateDocString(reference) {
|
|
|
11358
11358
|
.replace(/`(.+?)`/g, '$1')
|
|
11359
11359
|
.replace(/\$(\w+)/g, '$1')
|
|
11360
11360
|
.replace(/\*\*\*(.+)\*\*\*/g, '$1')
|
|
11361
|
-
.replace(
|
|
11361
|
+
.replace(/\*\*(.+)\*\*/g, '$1'), "\n\n Signature:\n ").concat(signature(reference).join('\n '), "\n\n Arguments:\n ").concat(argStrings(reference).join('\n '), "\n \n Examples:\n").concat(reference.examples.map(function (example) { return smartTrim(example, 4); }).join('\n\n')));
|
|
11362
11362
|
}
|
|
11363
11363
|
function signature(_a) {
|
|
11364
11364
|
var title = _a.title, variants = _a.variants, args = _a.args, returns = _a.returns, _isOperator = _a._isOperator;
|
|
@@ -15103,27 +15103,47 @@ var AutoCompleter = /** @class */ (function () {
|
|
|
15103
15103
|
};
|
|
15104
15104
|
AutoCompleter.prototype.generateSuggestions = function (params) {
|
|
15105
15105
|
var _this = this;
|
|
15106
|
+
var blacklist = new Set(['0_def', '0_defn', '0_fn']);
|
|
15107
|
+
var startsWithCaseSensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15108
|
+
return !blacklist.has(suggestion) && suggestion.startsWith(_this.searchString);
|
|
15109
|
+
});
|
|
15110
|
+
startsWithCaseSensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15111
|
+
var startsWithCaseInsensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15112
|
+
return !blacklist.has(suggestion) && suggestion.toLowerCase().startsWith(_this.searchString.toLowerCase());
|
|
15113
|
+
});
|
|
15114
|
+
startsWithCaseInsensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15115
|
+
var includesCaseSensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15116
|
+
return !blacklist.has(suggestion) && suggestion.includes(_this.searchString);
|
|
15117
|
+
});
|
|
15118
|
+
includesCaseSensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15119
|
+
var includesCaseInsensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15120
|
+
return !blacklist.has(suggestion) && suggestion.includes(_this.searchString.toLowerCase());
|
|
15121
|
+
});
|
|
15122
|
+
includesCaseInsensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15123
|
+
return __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(startsWithCaseSensitive), false), __read(startsWithCaseInsensitive), false), __read(includesCaseSensitive), false), __read(includesCaseInsensitive), false);
|
|
15124
|
+
};
|
|
15125
|
+
AutoCompleter.prototype.generateWithPredicate = function (params, shouldInclude) {
|
|
15106
15126
|
var _a, _b, _c, _d;
|
|
15107
15127
|
var suggestions = new Set();
|
|
15108
|
-
litsCommands.forEach(function (
|
|
15109
|
-
if (
|
|
15110
|
-
suggestions.add(
|
|
15128
|
+
litsCommands.forEach(function (suggestion) {
|
|
15129
|
+
if (shouldInclude(suggestion)) {
|
|
15130
|
+
suggestions.add(suggestion);
|
|
15111
15131
|
}
|
|
15112
15132
|
});
|
|
15113
15133
|
Object.keys((_a = params.globalContext) !== null && _a !== void 0 ? _a : {})
|
|
15114
|
-
.filter(
|
|
15115
|
-
.forEach(function (
|
|
15134
|
+
.filter(shouldInclude)
|
|
15135
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15116
15136
|
(_b = params.contexts) === null || _b === void 0 ? void 0 : _b.forEach(function (context) {
|
|
15117
15137
|
Object.keys(context)
|
|
15118
|
-
.filter(
|
|
15119
|
-
.forEach(function (
|
|
15138
|
+
.filter(shouldInclude)
|
|
15139
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15120
15140
|
});
|
|
15121
15141
|
Object.keys((_c = params.jsFunctions) !== null && _c !== void 0 ? _c : {})
|
|
15122
|
-
.filter(
|
|
15123
|
-
.forEach(function (
|
|
15142
|
+
.filter(shouldInclude)
|
|
15143
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15124
15144
|
Object.keys((_d = params.values) !== null && _d !== void 0 ? _d : {})
|
|
15125
|
-
.filter(
|
|
15126
|
-
.forEach(function (
|
|
15145
|
+
.filter(shouldInclude)
|
|
15146
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15127
15147
|
return __spreadArray([], __read(suggestions), false).sort(function (a, b) { return a.localeCompare(b); });
|
|
15128
15148
|
};
|
|
15129
15149
|
return AutoCompleter;
|
package/dist/index.esm.js
CHANGED
|
@@ -11229,7 +11229,7 @@ function generateDocString(reference) {
|
|
|
11229
11229
|
.replace(/`(.+?)`/g, '$1')
|
|
11230
11230
|
.replace(/\$(\w+)/g, '$1')
|
|
11231
11231
|
.replace(/\*\*\*(.+)\*\*\*/g, '$1')
|
|
11232
|
-
.replace(
|
|
11232
|
+
.replace(/\*\*(.+)\*\*/g, '$1'), "\n\n Signature:\n ").concat(signature(reference).join('\n '), "\n\n Arguments:\n ").concat(argStrings(reference).join('\n '), "\n \n Examples:\n").concat(reference.examples.map(function (example) { return smartTrim(example, 4); }).join('\n\n')));
|
|
11233
11233
|
}
|
|
11234
11234
|
function signature(_a) {
|
|
11235
11235
|
var title = _a.title, variants = _a.variants, args = _a.args, returns = _a.returns, _isOperator = _a._isOperator;
|
|
@@ -15129,27 +15129,47 @@ var AutoCompleter = /** @class */ (function () {
|
|
|
15129
15129
|
};
|
|
15130
15130
|
AutoCompleter.prototype.generateSuggestions = function (params) {
|
|
15131
15131
|
var _this = this;
|
|
15132
|
+
var blacklist = new Set(['0_def', '0_defn', '0_fn']);
|
|
15133
|
+
var startsWithCaseSensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15134
|
+
return !blacklist.has(suggestion) && suggestion.startsWith(_this.searchString);
|
|
15135
|
+
});
|
|
15136
|
+
startsWithCaseSensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15137
|
+
var startsWithCaseInsensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15138
|
+
return !blacklist.has(suggestion) && suggestion.toLowerCase().startsWith(_this.searchString.toLowerCase());
|
|
15139
|
+
});
|
|
15140
|
+
startsWithCaseInsensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15141
|
+
var includesCaseSensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15142
|
+
return !blacklist.has(suggestion) && suggestion.includes(_this.searchString);
|
|
15143
|
+
});
|
|
15144
|
+
includesCaseSensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15145
|
+
var includesCaseInsensitive = this.generateWithPredicate(params, function (suggestion) {
|
|
15146
|
+
return !blacklist.has(suggestion) && suggestion.includes(_this.searchString.toLowerCase());
|
|
15147
|
+
});
|
|
15148
|
+
includesCaseInsensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
|
|
15149
|
+
return __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(startsWithCaseSensitive), false), __read(startsWithCaseInsensitive), false), __read(includesCaseSensitive), false), __read(includesCaseInsensitive), false);
|
|
15150
|
+
};
|
|
15151
|
+
AutoCompleter.prototype.generateWithPredicate = function (params, shouldInclude) {
|
|
15132
15152
|
var _a, _b, _c, _d;
|
|
15133
15153
|
var suggestions = new Set();
|
|
15134
|
-
litsCommands.forEach(function (
|
|
15135
|
-
if (
|
|
15136
|
-
suggestions.add(
|
|
15154
|
+
litsCommands.forEach(function (suggestion) {
|
|
15155
|
+
if (shouldInclude(suggestion)) {
|
|
15156
|
+
suggestions.add(suggestion);
|
|
15137
15157
|
}
|
|
15138
15158
|
});
|
|
15139
15159
|
Object.keys((_a = params.globalContext) !== null && _a !== void 0 ? _a : {})
|
|
15140
|
-
.filter(
|
|
15141
|
-
.forEach(function (
|
|
15160
|
+
.filter(shouldInclude)
|
|
15161
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15142
15162
|
(_b = params.contexts) === null || _b === void 0 ? void 0 : _b.forEach(function (context) {
|
|
15143
15163
|
Object.keys(context)
|
|
15144
|
-
.filter(
|
|
15145
|
-
.forEach(function (
|
|
15164
|
+
.filter(shouldInclude)
|
|
15165
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15146
15166
|
});
|
|
15147
15167
|
Object.keys((_c = params.jsFunctions) !== null && _c !== void 0 ? _c : {})
|
|
15148
|
-
.filter(
|
|
15149
|
-
.forEach(function (
|
|
15168
|
+
.filter(shouldInclude)
|
|
15169
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15150
15170
|
Object.keys((_d = params.values) !== null && _d !== void 0 ? _d : {})
|
|
15151
|
-
.filter(
|
|
15152
|
-
.forEach(function (
|
|
15171
|
+
.filter(shouldInclude)
|
|
15172
|
+
.forEach(function (suggestion) { return suggestions.add(suggestion); });
|
|
15153
15173
|
return __spreadArray([], __read(suggestions), false).sort(function (a, b) { return a.localeCompare(b); });
|
|
15154
15174
|
};
|
|
15155
15175
|
return AutoCompleter;
|