Update capacitor version
This commit is contained in:
parent
91155bce0a
commit
f3b3a86b32
610 changed files with 28718 additions and 7101 deletions
9
@capacitor/cli/node_modules/commander/lib/suggestSimilar.js
generated
vendored
9
@capacitor/cli/node_modules/commander/lib/suggestSimilar.js
generated
vendored
|
@ -6,7 +6,8 @@ function editDistance(a, b) {
|
|||
// (Simple implementation.)
|
||||
|
||||
// Quick early exit, return worst case.
|
||||
if (Math.abs(a.length - b.length) > maxDistance) return Math.max(a.length, b.length);
|
||||
if (Math.abs(a.length - b.length) > maxDistance)
|
||||
return Math.max(a.length, b.length);
|
||||
|
||||
// distance between prefix substrings of a and b
|
||||
const d = [];
|
||||
|
@ -32,7 +33,7 @@ function editDistance(a, b) {
|
|||
d[i][j] = Math.min(
|
||||
d[i - 1][j] + 1, // deletion
|
||||
d[i][j - 1] + 1, // insertion
|
||||
d[i - 1][j - 1] + cost // substitution
|
||||
d[i - 1][j - 1] + cost, // substitution
|
||||
);
|
||||
// transposition
|
||||
if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
|
||||
|
@ -60,7 +61,7 @@ function suggestSimilar(word, candidates) {
|
|||
const searchingOptions = word.startsWith('--');
|
||||
if (searchingOptions) {
|
||||
word = word.slice(2);
|
||||
candidates = candidates.map(candidate => candidate.slice(2));
|
||||
candidates = candidates.map((candidate) => candidate.slice(2));
|
||||
}
|
||||
|
||||
let similar = [];
|
||||
|
@ -85,7 +86,7 @@ function suggestSimilar(word, candidates) {
|
|||
|
||||
similar.sort((a, b) => a.localeCompare(b));
|
||||
if (searchingOptions) {
|
||||
similar = similar.map(candidate => `--${candidate}`);
|
||||
similar = similar.map((candidate) => `--${candidate}`);
|
||||
}
|
||||
|
||||
if (similar.length > 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue