@replit/clui-input
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -100,3 +100,3 @@ "use strict"; | ||
var processUpdates = function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var valueStart, current, ast, atWhitespace, previousNode, search, result, search, result, currentNode, astCommands, last, args, parsedArgKeys, options, nodeStart, commonParams, getOptions, rootCommands, search, ref, argOptions, previousNode, search, ref, argOptions, run, commandsList, refRun_1; | ||
var valueStart, current, ast, atWhitespace, previousNode, search, result, search, result, currentNode, astCommands, last, args, parsedArgKeys, options, nodeStart, commonParams, getOptions, rootCommands, search, ref, argOptions, previousNode, search, ref, argOptions, ref, argOptions, run, commandsList, refRun_1; | ||
var _a, _b, _c, _d, _e; | ||
@@ -187,3 +187,3 @@ return __generator(this, function (_f) { | ||
} | ||
return [3, 14]; | ||
return [3, 16]; | ||
case 8: | ||
@@ -207,3 +207,3 @@ if (!currentNode) return [3, 11]; | ||
options.push.apply(options, __spread(getOptions(__assign({ currentNode: currentNode }, commonParams)))); | ||
return [3, 14]; | ||
return [3, 16]; | ||
case 11: | ||
@@ -220,3 +220,3 @@ previousNode = ast_1.closestPrevious(ast, index); | ||
: undefined; | ||
if (!previousNode) return [3, 14]; | ||
if (!previousNode) return [3, 16]; | ||
if (!(previousNode.kind === 'ARG_VALUE')) return [3, 13]; | ||
@@ -236,5 +236,19 @@ ref = previousNode.parent.ref; | ||
case 13: | ||
if (!(previousNode.kind === 'ARG_KEY')) return [3, 15]; | ||
ref = previousNode.parent.ref; | ||
if (!(typeof ref.options === 'function' && !optionsCache[valueStart])) return [3, 15]; | ||
return [4, ref.options(search || undefined)]; | ||
case 14: | ||
argOptions = _f.sent(); | ||
if (current !== updatedAt) { | ||
return [2]; | ||
} | ||
if (argOptions) { | ||
optionsCache[valueStart] = argOptions; | ||
} | ||
_f.label = 15; | ||
case 15: | ||
options.push.apply(options, __spread(getOptions(__assign({ previousNode: previousNode }, commonParams)))); | ||
_f.label = 14; | ||
case 14: | ||
_f.label = 16; | ||
case 16: | ||
commandsList = astCommands.map(function (c) { | ||
@@ -241,0 +255,0 @@ var cargs = ast_1.toArgs(c); |
{ | ||
"name": "@replit/clui-input", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "A utility library for building CLI style interfaces with autocomplete", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -56,3 +56,3 @@ # CLUI Input | ||
When the input matches a command with a `run` function, the `onUpdate` callback will include a refrence to it. | ||
When the input matches a command with a `run` function, the `onUpdate` callback will include a reference to it. | ||
@@ -59,0 +59,0 @@ ```jsx |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88956
1419