Skip to content

Commit

Permalink
Build(deps): Bump leven from 3.1.0 to 4.0.0 (#11349)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored and sosukesuzuki committed Apr 2, 2022
1 parent 3c96a08 commit 378370a
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -58,7 +58,7 @@
"ignore": "5.2.0",
"jest-docblock": "27.5.1",
"json5": "2.2.1",
"leven": "3.1.0",
"leven": "4.0.0",
"lines-and-columns": "2.0.3",
"linguist-languages": "7.15.0",
"lodash": "4.17.21",
Expand Down
17 changes: 17 additions & 0 deletions scripts/vendors/vendor-meta.json
Expand Up @@ -388,6 +388,23 @@
}
]
},
{
"name": "leven",
"maintainers": [],
"version": "4.0.0",
"description": "Measure the difference between two strings using the Levenshtein distance algorithm",
"repository": "sindresorhus/leven",
"homepage": null,
"private": false,
"license": "MIT",
"licenseText": "MIT License\n\nCopyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"contributors": []
},
{
"name": "mimic-fn",
"maintainers": [],
Expand Down
1 change: 1 addition & 0 deletions scripts/vendors/vendors.mjs
Expand Up @@ -5,6 +5,7 @@ const vendors = [
"html-element-attributes",
"html-tag-names",
"html-void-elements",
"leven",
"mem",
"string-width",
"strip-ansi",
Expand Down
5 changes: 3 additions & 2 deletions src/cli/options/normalize-cli-options.js
@@ -1,9 +1,10 @@
"use strict";

const leven = require("leven");
const { optionsNormalizer } = require("../prettier-internal.js");
// eslint-disable-next-line no-restricted-modules
const { default: chalk } = require("../../../vendors/chalk.js");
// eslint-disable-next-line no-restricted-modules
const { default: leven } = require("../../../vendors/leven.js");
const { optionsNormalizer } = require("../prettier-internal.js");

function normalizeCliOptions(options, optionInfos, opts) {
return optionsNormalizer.normalizeCliOptions(options, optionInfos, {
Expand Down
3 changes: 3 additions & 0 deletions vendors/leven.d.ts
@@ -0,0 +1,3 @@
// This file is generated automatically.
export {default} from "leven";
export * from "leven";
76 changes: 76 additions & 0 deletions vendors/leven.js
@@ -0,0 +1,76 @@
// @ts-nocheck
// This file is generated automatically
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// node_modules/leven/index.js
var leven_exports = {};
__export(leven_exports, {
default: () => leven
});
module.exports = __toCommonJS(leven_exports);
var array = [];
var characterCodeCache = [];
function leven(first, second) {
if (first === second) {
return 0;
}
const swap = first;
if (first.length > second.length) {
first = second;
second = swap;
}
let firstLength = first.length;
let secondLength = second.length;
while (firstLength > 0 && first.charCodeAt(~-firstLength) === second.charCodeAt(~-secondLength)) {
firstLength--;
secondLength--;
}
let start = 0;
while (start < firstLength && first.charCodeAt(start) === second.charCodeAt(start)) {
start++;
}
firstLength -= start;
secondLength -= start;
if (firstLength === 0) {
return secondLength;
}
let bCharacterCode;
let result;
let temporary;
let temporary2;
let index = 0;
let index2 = 0;
while (index < firstLength) {
characterCodeCache[index] = first.charCodeAt(start + index);
array[index] = ++index;
}
while (index2 < secondLength) {
bCharacterCode = second.charCodeAt(start + index2);
temporary = index2++;
result = index2;
for (index = 0; index < firstLength; index++) {
temporary2 = bCharacterCode === characterCodeCache[index] ? temporary : temporary + 1;
temporary = array[index];
result = array[index] = temporary > result ? temporary2 > result ? result + 1 : temporary2 : temporary2 > temporary ? temporary + 1 : temporary2;
}
}
return result;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {});
13 changes: 9 additions & 4 deletions yarn.lock
Expand Up @@ -4663,16 +4663,21 @@ kleur@^3.0.3:
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==

leven@3.1.0, leven@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2"
integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==
leven@4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/leven/-/leven-4.0.0.tgz#b9c39c803f835950fabef9e122a9b47b95708710"
integrity sha512-puehA3YKku3osqPlNuzGDUHq8WpwXupUg1V6NXdV38G+gr+gkBwFC8g1b/+YcIvp8gnqVIus+eJCH/eGsRmJNw==

leven@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580"
integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA=

leven@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2"
integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==

levn@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade"
Expand Down

0 comments on commit 378370a

Please sign in to comment.