REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 986 B
Close
/lib/node_modules/npm/node_modules/meant/index.js
Text
Base64
function levenshteinD (s1, s2) { var d = [] var i = 0 for (i = 0; i <= s1.length; i++) d[i] = [i] for (i = 0; i <= s2.length; i++) d[0][i] = i s2.split('').forEach(function (c2, j) { s1.split('').forEach(function (c1, i) { if (c1 === c2) { d[i + 1][j + 1] = d[i][j] return } d[i + 1][j + 1] = Math.min( d[i][j + 1] + 1, d[i + 1][j] + 1, d[i][j] + 1 ) }) }) return d[s1.length][s2.length] } function meant (scmd, commands) { var d = [] var bestSimilarity = [] commands.forEach(function (cmd, i) { var item = {} item[levenshteinD(scmd, cmd)] = i d.push(item) }) d.sort(function (a, b) { return Number(Object.keys(a)[0]) - Number(Object.keys(b)[0]) }) d.forEach(function (item) { var key = Number(Object.keys(item)[0]) if (scmd.length / 2 >= key) { bestSimilarity.push(commands[item[key]]) } }) return bestSimilarity } module.exports = meant
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
.github
DIR
-
drwxr-xr-x
2024-03-03 22:36:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CHANGELOG.md
1.31 KB
lrw-r--r--
2021-03-10 14:36:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
986 B
lrw-r--r--
2021-03-10 14:36:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LICENSE
1.05 KB
lrw-r--r--
2021-03-10 14:36:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
1.38 KB
lrw-r--r--
2021-03-10 14:36:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
README.md
1.44 KB
lrw-r--r--
2021-03-10 14:36:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test.js
431 B
lrw-r--r--
2021-03-10 14:36:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).