diff --git a/bin/index.js b/bin/index.js index 3e66794..46775eb 100644 --- a/bin/index.js +++ b/bin/index.js @@ -19,10 +19,12 @@ program program .command("run ") .description("Run a Javascript file and analyze crashes") - .action(async (file) => { + .option("--lang ", "output language (e.g. hi, es, fr)", "en") + + .action(async (file,options) => { const { default: ora } = await import("ora"); const { default: chalk } = await import("chalk"); - + const isJson = Boolean(program.opts().json); const filePath = path.resolve(process.cwd(), file); const spinner = isJson @@ -58,7 +60,7 @@ program spinner.stop(); } - const { count, matches } = findError(errorOutput); + const { count, matches } = findError(errorOutput,options.lang); // Process killed by signal if (code === null) { @@ -119,10 +121,14 @@ program program .command("analyze ") .description("Analyze a specific error string") - .action(async (errorString) => { + .option("--lang ", "output language (e.g. hi, es, fr)", "en") + .argument("", "error to explain") + + + .action(async (errorString,options) => { const { default: chalk } = await import("chalk"); const isJson = Boolean(program.opts().json); - const { count, matches } = findError(errorString); + const { count, matches } = findError(errorString,options.lang); const exitCode = count > 0 ? 1 : 0; if (isJson) { @@ -143,9 +149,11 @@ program ); console.log(chalk.gray(errorString)); } + process.exit(exitCode); }); + // ----------------- PARSE ----------------- program.parse(process.argv); \ No newline at end of file diff --git a/i18n.json b/i18n.json new file mode 100644 index 0000000..8a45fa3 --- /dev/null +++ b/i18n.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://lingo.dev/schema/i18n.json", + "version": "1.10", + "locale": { + "source": "en", + "targets": ["hi", "es", "fr", "de", "zh", "ja", "pt"] + }, + "buckets": { + "json": { + "include": ["locales/[locale].json"] + } + } +} \ No newline at end of file diff --git a/i18n.lock b/i18n.lock new file mode 100644 index 0000000..34a52af --- /dev/null +++ b/i18n.lock @@ -0,0 +1,200 @@ +version: 1 +checksums: + cd45f366fd2727f232266877d34abf6c: + Cannot%20read%20properties%20of%20undefined__explanation: 1faad15c888b2a1290951e18cdb08273 + Cannot%20read%20properties%20of%20undefined__why: 3179b160bec861271f4602ebe55c69fc + Cannot%20read%20properties%20of%20undefined__fix_0: d932abe8f516daa322109d173a0a7392 + Cannot%20read%20properties%20of%20undefined__fix_1: a00a5d6e5e2580841669adfb73347a51 + is%20not%20defined__explanation: dce4ec23c37a84423385142723d57e69 + is%20not%20defined__why: d9208afa3d7b9ac25f73ea3baa18031d + is%20not%20defined__fix_0: 2d295bfe46fd45f74dcbf672bd6942dc + is%20not%20defined__fix_1: 19f5707dd78dbdfcf7ded717b3b8492b + is%20not%20a%20function__explanation: 918b8c29a15c20b52933bf461837d804 + is%20not%20a%20function__why: c6dbd2a1a5eca3d350f367d46897634d + is%20not%20a%20function__fix_0: 7e5c2caf094f77d67b7da2ecf48617a8 + is%20not%20a%20function__fix_1: 8ca8156b6dce6bc3de4b917229507664 + Cannot%20find%20module__explanation: df9406f032055379c122b11bbc8442cc + Cannot%20find%20module__why: 9c217ca8d54e7f11908515b2248477a9 + Cannot%20find%20module__fix_0: 6e59ba46293292bd210b68c33071994f + Cannot%20find%20module__fix_1: 1b75b725b28f5ce62639646665abe136 + EADDRINUSE__explanation: 4995bf9b29964b8b25c075f7d57c8c8f + EADDRINUSE__why: 8a4e66e0ad693b72654065ff11050c78 + EADDRINUSE__fix_0: 3fa6768935a227288578444de0e4bd5c + EADDRINUSE__fix_1: f739e9e9d476c7b64f32caaf3eb45fe7 + Maximum%20call%20stack%20size%20exceeded__explanation: d7e9786db5ed21d73cb4050b3b898834 + Maximum%20call%20stack%20size%20exceeded__why: 8d946b4ef685c6449c6d84beb7017d1b + Maximum%20call%20stack%20size%20exceeded__fix_0: ad83507bcca1effe6dc64bb3cbaabd47 + Maximum%20call%20stack%20size%20exceeded__fix_1: 948409dfcc1435c2f5efecc96f00d594 + Maximum%20call%20stack%20size%20exceeded__fix_2: 3095f0d91f9a2daf9debfa890d14f647 + ECONNREFUSED__explanation: 09cfe66dfe9a9699b568c8a81ea78667 + ECONNREFUSED__why: 33e4dc458a905ccbc06674166145b507 + ECONNREFUSED__fix_0: f0103434e2f0ef263c630e8151e47ad6 + ECONNREFUSED__fix_1: 540ac446681c52c37928c7c603a113d7 + Assignment%20to%20constant%20variable__explanation: 2f92f627fc27f0dfd26ae883f0603e88 + Assignment%20to%20constant%20variable__why: d34c7aafddcc8437800fa988e4f4e3b1 + Assignment%20to%20constant%20variable__fix_0: 7a2d22d9c19f5de0231f4e99852e0de6 + ENOENT__explanation: 5dd4798e91f081b27a285ad456bbe270 + ENOENT__why: b7460a442b46fb2f1247206a1e7bd4ac + ENOENT__fix_0: 3cabfd4520d70d49b2872196bd34c9a8 + ENOENT__fix_1: 4150f9d558b7ecd2b690c530fa485852 + await%20is%20only%20valid%20in%20async%20functions__explanation: 84644d836d3b797652d2dbcd740f863f + await%20is%20only%20valid%20in%20async%20functions__why: 6b3e619695d4346fdf4a86f20d747522 + await%20is%20only%20valid%20in%20async%20functions__fix_0: 188259beff59af55b9bf30fc52d56b91 + ERR_HTTP_HEADERS_SENT__explanation: 643952cd42e9568de7db01258a1054db + ERR_HTTP_HEADERS_SENT__why: c60cc02c5ec72480b94206c0d743ecca + ERR_HTTP_HEADERS_SENT__fix_0: c4f03ca555bedb02445a99d00c43d7cb + buffering%20timed%20out__explanation: 3619c59abd5eff53f070ef5eb98ab0f2 + buffering%20timed%20out__why: 2e31b51184aeb28c6d0d246accd5f6dd + buffering%20timed%20out__fix_0: a35ed84c50d70b1f8dcb1f8c63697247 + buffering%20timed%20out__fix_1: 395dbe26dba7ba3ccd023c3c67c4bc3c + jwt%20malformed__explanation: 62caf4e3abe069f9fe55d3e96e216ff3 + jwt%20malformed__why: 93e9616fbb61db7bde6144993dd6df45 + jwt%20malformed__fix_0: b4721afa33ebba6471811bdc73742d4b + jwt%20malformed__fix_1: 64d3e1e626f7575e36e40854911094d7 + secretOrPrivateKey%20must%20have%20a%20value__explanation: a855a5dd85b11b07bd5722d4a3734dac + secretOrPrivateKey%20must%20have%20a%20value__why: d002ae95fc21841550a9585b32d2e04d + secretOrPrivateKey%20must%20have%20a%20value__fix_0: 6272ebcc4a5d59438b50915e89dada86 + secretOrPrivateKey%20must%20have%20a%20value__fix_1: b85bc80c89a251cfb859c2d3567f592e + E11000__explanation: a3d6e7324f1267c2383493d2e7c1b936 + E11000__why: 37d84f4f32d319a84a26164befa1f78c + E11000__fix_0: 2744aaaeea21ffd2adc261b857643e87 + E11000__fix_1: a00adf9185b256903bd698fb60188e32 + Unexpected%20token%20%3C%20in%20JSON__explanation: 35336685e8d2c76f0b974242330d0975 + Unexpected%20token%20%3C%20in%20JSON__why: 9f8109ebe11f962d57111a3093aae6e1 + Unexpected%20token%20%3C%20in%20JSON__fix_0: 3b9f95f3402a90c30acb9736b0256c21 + Unexpected%20token%20%3C%20in%20JSON__fix_1: c82a2a9ddef7ce33e3219fe32981e4a3 + CORS__explanation: 70b04e3e9ed6defefcf2f37a8243ee3a + CORS__why: 27bc6fa1656b9568ac942af065d125df + CORS__fix_0: de5acdf0270111e93173e98f0c572023 + CORS__fix_1: 7e0d316d062534aff39bcb246bd39fc4 + "'map'%20of%20undefined__explanation": 8623a6fb138a0da5404ad67141f58fc1 + "'map'%20of%20undefined__why": b9c6b5e5cf6251c4d18af9020a62be06 + "'map'%20of%20undefined__fix_0": b351521f10b0078582478655bb439229 + "'map'%20of%20undefined__fix_1": d2988c5969a78ac503c95e1031a437ca + module%20not%20found%20'dotenv'__explanation: b5c0e169b532c55bcdacc55555cedaa8 + module%20not%20found%20'dotenv'__why: b7f34bd59ad6954385fa9fa777371c60 + module%20not%20found%20'dotenv'__fix_0: 81544c6dba548915dec5a52ee629bce3 + validation%20failed__explanation: 9d9af2de697f93326e47c48ef6582afe + validation%20failed__why: 43b5aa9edd5d2ac09074aac05dd1bbfe + validation%20failed__fix_0: 0448d5d0a5a7ff829295070cee22e9a9 + validation%20failed__fix_1: 6165448b86d2e59b8220d54f147580e2 + not%20authorized__explanation: 54f27844a9f0542f38fbed4541624a5a + not%20authorized__why: 67438e33beea817e67a16603dae9167e + not%20authorized__fix_0: cad7a414147406f1d540fe86e36c7d64 + not%20authorized__fix_1: 4d85b636feb04be3fcc9555cea3bdb88 + status%20code%20404__explanation: bbca7ace5b0d257a209686ffb3ccfe1e + status%20code%20404__why: 0e117e5d305279246d9102a284030a9a + status%20code%20404__fix_0: 8aa5265e1eecebe9585b480deb000478 + status%20code%20404__fix_1: 9bc8e39d5fe836a76cffbedd96c9e313 + status%20code%20500__explanation: 4bfedfc76ec3c8b6df5afc2227dc3be2 + status%20code%20500__why: 04d5760a4000b7abc051f950ff3b3304 + status%20code%20500__fix_0: e5b5c7452f20066c4f88f4fd640478b0 + status%20code%20500__fix_1: af06db7991552f8c69bbff51d9ade46a + is%20not%20iterable__explanation: 3b3554d0eac3e54b65b51ff4de623147 + is%20not%20iterable__why: d39026cb5bc0447e54a2a47063e9663a + is%20not%20iterable__fix_0: e455c6d763a0ae1a542c7147db65c4b0 + is%20not%20iterable__fix_1: bf65ea0c6fb4621a86bc527e0747b960 + require%20is%20not%20defined__explanation: 61b6c906a5e79fec3d07396f34e535ae + require%20is%20not%20defined__why: 3f9107676033f1badc6333c02cacd6c2 + require%20is%20not%20defined__fix_0: e854fadced8da6eeeae440d812cb2679 + require%20is%20not%20defined__fix_1: d753e9ed9a895284f2039bb6ff807b6f + EACCES__explanation: dc5e4f5e04000d8837521bebc39de36d + EACCES__why: 5f2c6e7f7208d5eecd95b7f6231103cb + EACCES__fix_0: ef078af144e4986187275484df386266 + EACCES__fix_1: 7f454605e663b32829d824fa3b108369 + has%20already%20been%20declared__explanation: 6bf7939de2636631859b552bd310b444 + has%20already%20been%20declared__why: 1a04b61b7eb912688c26d209106a6f84 + has%20already%20been%20declared__fix_0: ad701a6992f6a413b925a0095d9d96c6 + has%20already%20been%20declared__fix_1: 9a8203cbe924bbd09661888930839719 + PayloadTooLargeError__explanation: 41aabf96fbf310855061542734dd3914 + PayloadTooLargeError__why: 81e39285e49ba8e7ff06b1f5e700faa0 + PayloadTooLargeError__fix_0: 036e8726757ecf562416d8fbfb277cc0 + set%20property%20of%20null__explanation: d9448c7316667a30d2e527f2451f5a38 + set%20property%20of%20null__why: 1f7d4c1ed46d91c725c6de62741a3078 + set%20property%20of%20null__fix_0: d5064e99652eaaf448888de18a9aeecc + set%20property%20of%20null__fix_1: 90360192c140f7fa1c1ac4ac08c8a6fb + socket%20hang%20up__explanation: f1eb15fd5d6dd56b215010f70c6c7925 + socket%20hang%20up__why: 613ac50490c0fb3191bed237208f856c + socket%20hang%20up__fix_0: 38c87939504c0049d35f221eb7c80d1c + socket%20hang%20up__fix_1: 7bf21183860ec1bbbcd7e86d40bf2a30 + Unexpected%20end%20of%20JSON%20input__explanation: 6f9b0f41e69ff8ae722851041415bb7d + Unexpected%20end%20of%20JSON%20input__why: f8aa7923c3b17ffd1c0faf263aeb92c8 + Unexpected%20end%20of%20JSON%20input__fix_0: 0b48d1cc085b9d697ce0d04a523583e3 + Unexpected%20end%20of%20JSON%20input__fix_1: 19a9b4ddf3c0d32678ff7363518cdb49 + Script%20execution%20timed%20out__explanation: 80e8c1aa98796e2f8311def28b83876a + Script%20execution%20timed%20out__why: 7e3d92573c0e438a11ad46c734ce3510 + Script%20execution%20timed%20out__fix_0: 13f27f2b06ae02c841e19bac020d607e + Script%20execution%20timed%20out__fix_1: 30d7e8d779544fe82f5a70c6af2f2c8d + "'then'%20of%20undefined__explanation": a14ca654fb551e343a10dd891afe14eb + "'then'%20of%20undefined__why": b2d25ccfb11b1e69e94ea5ea00ac851f + "'then'%20of%20undefined__fix_0": 1ac24f8efda96671ca766a497076d894 + "'then'%20of%20undefined__fix_1": 32c9b8bf21b7414f3a4ee3f27a76a3f1 + Invalid%20connection%20string__explanation: 14f5626bf386c35fe9de5581fc100688 + Invalid%20connection%20string__why: 069cf3455e03ba0b3d87b4b661cf9ec2 + Invalid%20connection%20string__fix_0: 4644807643e2f6896f3ee4281a816cf9 + window%20is%20not%20defined__explanation: 293ed55f0b8dc25a72351b48ed40d3c3 + window%20is%20not%20defined__why: 2eadceb65ad81bec1e56a6a3cacbb0f3 + window%20is%20not%20defined__fix_0: 50285071c28d41a09b5249cd265c9926 + window%20is%20not%20defined__fix_1: ff5ae1c82709204024d602c4f62c9e9a + Too%20many%20listeners__explanation: c4d2550e8da00d7ed86ba3cf6107e86e + Too%20many%20listeners__why: c1cf9999ffcdce6c06a34d9a3588fe64 + Too%20many%20listeners__fix_0: 51c39fae071228304bea30efe6179a3d + Too%20many%20listeners__fix_1: dc48ed601353286d7538bc2b8cad0e8c + spread%20non-iterable__explanation: ceefe3c1623f6d771bff87389b9e4471 + spread%20non-iterable__why: 0a561a230bfe822fb0f1521593d5e42b + spread%20non-iterable__fix_0: a12639752eefe4017ab9b9f3aa6249e0 + EPIPE__explanation: 6a0f8affc26e6a1e31c39c6f0c9f5299 + EPIPE__why: 80bfe0493f10522a24778aa7813fed86 + EPIPE__fix_0: c0927e6e1fe546043c38c79c159fff81 + EPIPE__fix_1: 9c721f4d0c99d3c569a165cafeb8ceb3 + Missing%20initializer__explanation: 57cab3b2824f7f523ce954c73c08cae9 + Missing%20initializer__why: e35c7907e7aafa5400cf52a92095a30e + Missing%20initializer__fix_0: 98cb124fd77709758f9c1f181269a71d + peerinvalid__explanation: f8cc3ce3975aaaad41e88489622f7207 + peerinvalid__why: bbb0b4f220e719245b675e33acbe1b3a + peerinvalid__fix_0: d8b40b19e44801ae7371b49d9b149264 + filter%20is%20not%20a%20function__explanation: 2dd815ca2b86f48e4044b6820f59d28e + filter%20is%20not%20a%20function__why: 85411fccb964ee21650baad7486cc0d3 + filter%20is%20not%20a%20function__fix_0: e6509aa36837dc615a1106e8b2102180 + ENOTFOUND__explanation: 4f213ad0b9ac03cf2a24b3578f9fe6cb + ENOTFOUND__why: ef8f385a90ead39862cb4a2894f82361 + ENOTFOUND__fix_0: 47afce4afbf3d8f5e33713a3689deabb + ENOTFOUND__fix_1: 89318ad17a3c3a08890cd215cb06e40d + reserved%20word__explanation: 4d4b3016ed00bd0f33a9a01bd65e5867 + reserved%20word__why: be0507ac77678d6096d8b0be68a06406 + reserved%20word__fix_0: bebeea5fb5dbc077b6e56f84c1e947d1 + Cannot%20find%20name__explanation: 3ef4a0fdf0b67043dd087ec90004b4b0 + Cannot%20find%20name__why: 10b078fba28fbb569048ffe78d143ef0 + Cannot%20find%20name__fix_0: 7e5c2caf094f77d67b7da2ecf48617a8 + Cannot%20find%20name__fix_1: a63770f64eeee222dd718b90a2c09b2e + convert%20undefined%20or%20null%20to%20object__explanation: eb0847b5e485bde6428b1daea4be33c1 + convert%20undefined%20or%20null%20to%20object__why: 90953678308688d93af48a614a736efd + convert%20undefined%20or%20null%20to%20object__fix_0: 3376a40c0d55afec4eacadd92bb014f1 + Access-Control-Allow-Origin__explanation: 7ab03605cdc9aa387f6d148d48687f86 + Access-Control-Allow-Origin__why: e336ccba7c256cb4c931839ae176c5ce + Access-Control-Allow-Origin__fix_0: 0313f9a5eb29c38e3645bbf1dba08caa + Invalid%20or%20unexpected%20token__explanation: 7143746c889306fa441f10c2ea91cd30 + Invalid%20or%20unexpected%20token__why: dcc4e55ed24b76aeb5580501792f6b30 + Invalid%20or%20unexpected%20token__fix_0: 721a3691053419a44a4f32a6eededd9e + Invalid%20or%20unexpected%20token__fix_1: 166381222f0b86af2dd5729ccff6e542 + timeout%20of%202000ms%20exceeded__explanation: 2d9a63a7c04bd0a94a789e61575a5d51 + timeout%20of%202000ms%20exceeded__why: 0122d56fc40efda5d84d1267381e1393 + timeout%20of%202000ms%20exceeded__fix_0: 04475d180de140134b159b35825fe66d + timeout%20of%202000ms%20exceeded__fix_1: 2345f28a91ce9d63c171a8e288a9fe91 + does%20not%20exist%20on%20type__explanation: 4f31168b6bcbdc7cf233cc205de1fd11 + does%20not%20exist%20on%20type__why: dbd3aad72f9c390a4a7b39613cd60371 + does%20not%20exist%20on%20type__fix_0: 0f16abd8a1c5040b68cfae15baa886dd + does%20not%20exist%20on%20type__fix_1: 971355fffe0dc9e286af3836d7f9c854 + npm%20ERR!%20404__explanation: 8d4b1708db44bc4f34120774e5e05783 + npm%20ERR!%20404__why: 8db41b323b5bbbbaadfe8851c0c7dbe7 + npm%20ERR!%20404__fix_0: 958e997b8e5dcea7a3f477415199f922 + npm%20ERR!%20404__fix_1: 6aed2dda9753dc6b9a7db6bee2da3a7f + Unexpected%20end%20of%20input__explanation: 9adc4a9073ebb8fac3c0c93b100f88ef + Unexpected%20end%20of%20input__why: dfbb540307ab05b9fa252b007fa4f940 + Unexpected%20end%20of%20input__fix_0: 84909eef8d62e870da26b9bebce44df8 + Unexpected%20end%20of%20input__fix_1: 3441fd4ff396e1299156e4a887c2c8d0 + Unexpected%20end%20of%20input__fix_2: 7fa94f53fa73a8283ac2c5b68fd03763 + missing%20)%20after%20argument%20list__explanation: bc01bb743ae3354e6e7b090584d789c6 + missing%20)%20after%20argument%20list__why: 5d2c1d927a96c1e67ace72b448653625 + missing%20)%20after%20argument%20list__fix_0: 19a4b63b4aa7213e762134f4cf7cdb7d + missing%20)%20after%20argument%20list__fix_1: d2e96f3e7fbdb91fe002dd7a446bce37 diff --git a/lib/matcher.js b/lib/matcher.js index 6c71412..e1536df 100644 --- a/lib/matcher.js +++ b/lib/matcher.js @@ -1,13 +1,46 @@ const database = require("./database.json"); +const fs = require('fs') +const path = require("path"); -function findError(input) { +// Loading the locale file +function loadLocale(lang = "en"){ + const filepath = path.join(__dirname,"../locales", `${lang}.json`); + const fallback = path.join(__dirname,"../locales/en.json"); + try { + return JSON.parse(fs.readFileSync(filepath,"utf8")) + } catch (error) { + return JSON.parse(fs.readFileSync(fallback,"utf8")) + + } +} + +//this function will translate every single entry using the loaded locals +function translateEntry(entry,locale){ + const key = entry.match + return{ + ...entry, + explanation:locale[`${key}__explanation`] || entry.explanation, + why: locale[`${key}__why`] || entry.why, + fixes: entry.fixes.map( + (fix,i) =>locale[`${key}__fix_${i}`] || fix + ) + } +} + + +function findError(input,lang = "en") { + if (!input) return { count: 0, matches: [] }; if (typeof input !== "string") input = String(input); // 1. Normalize the input (Lowercase and remove extra whitespace) const lowerInput = input.toLowerCase(); - + + + const locale = loadLocale(lang) // I'm calling the load local file here + + //untouched // 2. Filter the database let foundMatches = database.filter(entry => { const matchPhrase = entry.match.toLowerCase(); @@ -28,7 +61,7 @@ function findError(input) { for (const match of foundMatches) { if (!seenNames.has(match.name)) { - uniqueMatches.push(match); + uniqueMatches.push(translateEntry(match,locale)); seenNames.add(match.name); } } diff --git a/locales/de.json b/locales/de.json new file mode 100644 index 0000000..a6bf04c --- /dev/null +++ b/locales/de.json @@ -0,0 +1,199 @@ +{ + "Cannot read properties of undefined__explanation": "Sie versuchen, auf eine Eigenschaft einer Variable zuzugreifen, die derzeit leer ist.", + "Cannot read properties of undefined__why": "Die Variable wurde nicht initialisiert oder ein API-Aufruf ist noch nicht abgeschlossen.", + "Cannot read properties of undefined__fix_0": "Verwenden Sie Optional Chaining: user?.name", + "Cannot read properties of undefined__fix_1": "Setzen Sie einen Standardwert: data || []", + "is not defined__explanation": "Sie verwenden eine Variable, die nicht deklariert wurde.", + "is not defined__why": "Tippfehler im Namen oder die Variable ist innerhalb einer anderen Funktion gekapselt.", + "is not defined__fix_0": "Auf Tippfehler prüfen", + "is not defined__fix_1": "Mit const/let deklarieren", + "is not a function__explanation": "Sie haben eine Variable als Funktion aufgerufen, aber es ist ein anderer Typ (String/Object).", + "is not a function__why": "Import fehlgeschlagen oder ein Callback wurde nicht korrekt übergeben.", + "is not a function__fix_0": "Imports überprüfen", + "is not a function__fix_1": "Typ mit typeof verifizieren", + "Cannot find module__explanation": "Node.js kann die Datei oder das Paket, das Sie importieren, nicht finden.", + "Cannot find module__why": "Das Paket ist nicht installiert oder der relative Pfad ist falsch.", + "Cannot find module__fix_0": "Führen Sie 'npm install' aus", + "Cannot find module__fix_1": "Dateipfad-Schreibweise überprüfen", + "EADDRINUSE__explanation": "Der Port, den Ihr Server verwenden möchte, wird bereits verwendet.", + "EADDRINUSE__why": "Eine andere Instanz Ihrer Anwendung läuft bereits.", + "EADDRINUSE__fix_0": "Den anderen Prozess beenden", + "EADDRINUSE__fix_1": "Die Portnummer ändern", + "Maximum call stack size exceeded__explanation": "Die Aufrufstapel-Grenze wurde aufgrund übermäßiger Rekursion oder einer sehr tiefen Aufrufkette erreicht.", + "Maximum call stack size exceeded__why": "Eine rekursive Funktion ruft sich zu oft selbst auf, ohne einen Basisfall zu erreichen, oder eine Kette von Funktionsaufrufen baut sich zu tief auf.", + "Maximum call stack size exceeded__fix_0": "Rekursions-Abbruchbedingungen prüfen", + "Maximum call stack size exceeded__fix_1": "Verifizieren, dass rekursive Basisfälle erreichbar sind", + "Maximum call stack size exceeded__fix_2": "Aufrufketten-Tiefe und stapelbildende Schleifen überprüfen", + "ECONNREFUSED__explanation": "Ihre App hat versucht, sich mit einer Datenbank/API zu verbinden, wurde aber abgelehnt.", + "ECONNREFUSED__why": "Der Zielserver ist nicht erreichbar oder die URL ist falsch.", + "ECONNREFUSED__fix_0": "Stellen Sie sicher, dass die Datenbank läuft", + "ECONNREFUSED__fix_1": "Überprüfen Sie die API-URL", + "Assignment to constant variable__explanation": "Sie haben versucht, eine 'const'-Variable zu ändern.", + "Assignment to constant variable__why": "Const-Variablen können nicht neu zugewiesen werden.", + "Assignment to constant variable__fix_0": "Verwenden Sie 'let' anstelle von 'const'", + "ENOENT__explanation": "Sie versuchen, eine Datei zu lesen, die nicht existiert.", + "ENOENT__why": "Die Datei wurde verschoben oder der Pfad-String ist falsch.", + "ENOENT__fix_0": "Überprüfen Sie, ob die Datei existiert", + "ENOENT__fix_1": "Verwenden Sie path.join()", + "await is only valid in async functions__explanation": "Sie haben 'await' innerhalb einer normalen Funktion verwendet.", + "await is only valid in async functions__why": "Await erfordert das Schlüsselwort 'async' bei der übergeordneten Funktion.", + "await is only valid in async functions__fix_0": "Fügen Sie 'async' zur Funktionsdefinition hinzu", + "ERR_HTTP_HEADERS_SENT__explanation": "Sie haben eine Antwort gesendet, nachdem bereits eine gesendet wurde.", + "ERR_HTTP_HEADERS_SENT__why": "Mehrere res.send()-Aufrufe in einer Route.", + "ERR_HTTP_HEADERS_SENT__fix_0": "Verwenden Sie 'return res.send()', um die Ausführung zu stoppen", + "buffering timed out__explanation": "Mongoose konnte sich nicht rechtzeitig mit MongoDB verbinden.", + "buffering timed out__why": "Die Datenbank ist offline oder die Verbindungszeichenkette ist falsch.", + "buffering timed out__fix_0": "Überprüfen Sie den MongoDB-Status", + "buffering timed out__fix_1": "Überprüfen Sie die Verbindungszeichenkette", + "jwt malformed__explanation": "Der bereitgestellte Token hat keine gültige JWT-Struktur.", + "jwt malformed__why": "Der Token ist beschädigt oder es wurde nur ein Teil davon gesendet.", + "jwt malformed__fix_0": "Überprüfen Sie den 'Authorization'-Header", + "jwt malformed__fix_1": "Überprüfen Sie die Token-Generierung", + "secretOrPrivateKey must have a value__explanation": "JWT-Geheimschlüssel fehlt.", + "secretOrPrivateKey must have a value__why": "Umgebungsvariable (JWT_SECRET) ist nicht geladen.", + "secretOrPrivateKey must have a value__fix_0": ".env-Datei prüfen", + "secretOrPrivateKey must have a value__fix_1": "dotenv.config() ausführen", + "E11000__explanation": "Sie versuchen, Daten mit einem 'unique'-Feld zu speichern, das bereits existiert.", + "E11000__why": "Meist eine doppelte E-Mail oder Benutzername in der DB.", + "E11000__fix_0": "Prüfen, ob Daten existieren, bevor gespeichert wird", + "E11000__fix_1": "Eindeutige Fehlerbehandlung verwenden", + "Unexpected token < in JSON__explanation": "Sie haben versucht, JSON zu parsen, aber stattdessen HTML erhalten.", + "Unexpected token < in JSON__why": "Ihre API hat eine Fehlerseite (HTML) statt Daten (JSON) zurückgegeben.", + "Unexpected token < in JSON__fix_0": "API-URL prüfen", + "Unexpected token < in JSON__fix_1": "Server-Logs auf Abstürze prüfen", + "CORS__explanation": "Browser hat Ihre Anfrage aus Sicherheitsgründen blockiert.", + "CORS__why": "Der Server erlaubt keine Anfragen von Ihrer Frontend-Domain.", + "CORS__fix_0": "'cors'-Paket auf dem Server installieren", + "CORS__fix_1": "app.use(cors())", + "'map' of undefined__explanation": "Sie versuchen, durch ein Array zu iterieren, das nicht existiert.", + "'map' of undefined__why": "Die Variable ist null/undefined statt einem Array.", + "'map' of undefined__fix_0": "Als leeres Array initialisieren: data || []", + "'map' of undefined__fix_1": "API-Antwort prüfen", + "module not found 'dotenv'__explanation": "Das 'dotenv'-Paket fehlt.", + "module not found 'dotenv'__why": "Sie haben es im Code verwendet, aber nicht installiert.", + "module not found 'dotenv'__fix_0": "npm install dotenv", + "validation failed__explanation": "Daten stimmen nicht mit Ihrem Mongoose-Schema überein.", + "validation failed__why": "Pflichtfelder fehlen oder falsche Datentypen.", + "validation failed__fix_0": "Pflichtfelder überprüfen", + "validation failed__fix_1": "Daten im Frontend validieren", + "not authorized__explanation": "Zugriff verweigert aufgrund fehlender oder ungültiger Anmeldedaten.", + "not authorized__why": "Token abgelaufen oder falscher API-Schlüssel.", + "not authorized__fix_0": "Erneut anmelden", + "not authorized__fix_1": "Header überprüfen", + "status code 404__explanation": "Der API-Endpunkt, den Sie aufrufen, existiert nicht.", + "status code 404__why": "Falsche URL oder die Server-Route ist nicht definiert.", + "status code 404__fix_0": "Schreibweise der API-Route überprüfen", + "status code 404__fix_1": "Basis-URL überprüfen", + "status code 500__explanation": "Der Server ist beim Verarbeiten Ihrer Anfrage abgestürzt.", + "status code 500__why": "Ein Fehler im Backend-Server-Code.", + "status code 500__fix_0": "Server-Konsolenprotokolle überprüfen", + "status code 500__fix_1": "Try/Catch auf dem Server hinzufügen", + "is not iterable__explanation": "Sie haben eine for...of-Schleife oder Spread (...) auf einem Nicht-Array verwendet.", + "is not iterable__why": "Sie haben versucht, über ein Objekt oder Null zu iterieren.", + "is not iterable__fix_0": "Sicherstellen, dass die Variable ein Array ist", + "is not iterable__fix_1": "Object.keys() verwenden", + "require is not defined__explanation": "Sie verwenden 'require' in einem ES-Modul.", + "require is not defined__why": "Node.js ist in package.json auf 'type': 'module' eingestellt.", + "require is not defined__fix_0": "Stattdessen 'import' verwenden", + "require is not defined__fix_1": "'type: module' entfernen", + "EACCES__explanation": "Sie haben keine Berechtigung, auf diese Datei/diesen Port zuzugreifen.", + "EACCES__why": "Sie benötigen Administratorrechte oder die Datei ist gesperrt.", + "EACCES__fix_0": "'sudo' verwenden (Linux/Mac)", + "EACCES__fix_1": "Dateiberechtigungen überprüfen", + "has already been declared__explanation": "Sie haben denselben Variablennamen zweimal deklariert.", + "has already been declared__why": "Verwendung von 'let' oder 'const' für einen Namen, der bereits im selben Gültigkeitsbereich existiert.", + "has already been declared__fix_0": "Eine der Variablen umbenennen", + "has already been declared__fix_1": "Die zweite Deklaration entfernen", + "PayloadTooLargeError__explanation": "Die von Ihnen gesendeten Daten sind zu groß für den Server.", + "PayloadTooLargeError__why": "Normalerweise ein Bild oder eine Datei, die das Body-Parser-Limit überschreitet.", + "PayloadTooLargeError__fix_0": "Limit erhöhen: app.use(express.json({limit: '50mb'}))", + "set property of null__explanation": "Sie versuchen, einer Eigenschaft einer leeren Variable einen Wert zuzuweisen.", + "set property of null__why": "Das Objekt, das Sie ändern möchten, wurde noch nicht erstellt.", + "set property of null__fix_0": "Das Objekt zuerst initialisieren", + "set property of null__fix_1": "Auf null prüfen", + "socket hang up__explanation": "Der Server hat die Verbindung unerwartet geschlossen.", + "socket hang up__why": "Server abgestürzt oder Zeitüberschreitung aufgetreten.", + "socket hang up__fix_0": "Server-Status überprüfen", + "socket hang up__fix_1": "Zeitlimit erhöhen", + "Unexpected end of JSON input__explanation": "Die JSON-Daten sind unvollständig oder leer.", + "Unexpected end of JSON input__why": "Der Server hat eine leere Zeichenfolge anstelle von JSON gesendet.", + "Unexpected end of JSON input__fix_0": "API-Antwort überprüfen", + "Unexpected end of JSON input__fix_1": "Leere Antworten behandeln", + "Script execution timed out__explanation": "Ihr Code hat zu lange für die Ausführung gebraucht.", + "Script execution timed out__why": "Aufwändige Berechnung oder Endlosschleife.", + "Script execution timed out__fix_0": "Logik optimieren", + "Script execution timed out__fix_1": "Worker-Threads verwenden", + "'then' of undefined__explanation": "Sie haben .then() auf etwas aufgerufen, das kein Promise ist.", + "'then' of undefined__why": "Die Funktion hat kein Promise zurückgegeben.", + "'then' of undefined__fix_0": "Funktion 'async' machen", + "'then' of undefined__fix_1": "Promise zurückgeben", + "Invalid connection string__explanation": "Das Format der Datenbank-URL ist falsch.", + "Invalid connection string__why": "Fehlende Symbole wie '@' oder '/' in der URI.", + "Invalid connection string__fix_0": "DB-URI-Format prüfen", + "window is not defined__explanation": "Sie versuchen, Browser-Code (window) in Node.js zu verwenden.", + "window is not defined__why": "Node.js hat kein 'window'-Objekt (das ist für Browser).", + "window is not defined__fix_0": "Prüfen, ob im Browser ausgeführt", + "window is not defined__fix_1": "Stattdessen 'global' verwenden", + "Too many listeners__explanation": "Speicherleck bei EventEmitters erkannt.", + "Too many listeners__why": "Event-Listener werden innerhalb einer Schleife oder wiederholten Funktion hinzugefügt.", + "Too many listeners__fix_0": ".once() statt .on() verwenden", + "Too many listeners__fix_1": "Alte Listener entfernen", + "spread non-iterable__explanation": "Sie haben versucht, `...obj` zu verwenden, wo es nicht erlaubt ist.", + "spread non-iterable__why": "Versuch, ein Objekt in ein Array zu spreaden.", + "spread non-iterable__fix_0": "Eckige Klammern [] für Arrays und {} für Objekte verwenden", + "EPIPE__explanation": "Broken Pipe: Daten werden an eine geschlossene Verbindung gesendet.", + "EPIPE__why": "Die Gegenseite (Client/Prozess) hört nicht mehr zu.", + "EPIPE__fix_0": "Stream-Fehler behandeln", + "EPIPE__fix_1": "Prüfen, ob Prozess aktiv ist", + "Missing initializer__explanation": "Sie haben eine Konstante ohne Wertzuweisung deklariert.", + "Missing initializer__why": "Const muss sofort bei der Erstellung gesetzt werden.", + "Missing initializer__fix_0": "Wert zuweisen: const x = 1;", + "peerinvalid__explanation": "Installierte Pakete haben widersprüchliche Versionen.", + "peerinvalid__why": "Eine Bibliothek benötigt Version A, eine andere benötigt Version B.", + "peerinvalid__fix_0": "npm install --legacy-peer-deps", + "filter is not a function__explanation": "Sie versuchen, etwas zu filtern, das kein Array ist.", + "filter is not a function__why": "Die Variable ist ein Objekt oder Null.", + "filter is not a function__fix_0": "Stellen Sie sicher, dass data ein Array ist: Array.isArray(data)", + "ENOTFOUND__explanation": "DNS-Auflösung für die URL fehlgeschlagen.", + "ENOTFOUND__why": "Tippfehler in der URL oder keine Internetverbindung.", + "ENOTFOUND__fix_0": "URL-Schreibweise überprüfen", + "ENOTFOUND__fix_1": "DNS/Internet überprüfen", + "reserved word__explanation": "Sie haben ein für JS reserviertes Wort (wie 'class' oder 'await') als Variablennamen verwendet.", + "reserved word__why": "Sie können eine Variable nicht 'class' oder 'function' nennen.", + "reserved word__fix_0": "Variable umbenennen", + "Cannot find name__explanation": "TypeScript kann diese Variable oder diesen Typ nicht finden.", + "Cannot find name__why": "Variable nicht deklariert oder @types-Paket fehlt.", + "Cannot find name__fix_0": "Imports überprüfen", + "Cannot find name__fix_1": "Typen installieren: npm install @types/node", + "convert undefined or null to object__explanation": "Object-Methoden werden auf eine leere Variable angewendet.", + "convert undefined or null to object__why": "Object.keys(data) wird verwendet, wenn data null ist.", + "convert undefined or null to object__fix_0": "Überprüfen Sie, ob data existiert: data && Object.keys(data)", + "Access-Control-Allow-Origin__explanation": "CORS-Fehler: Der Server teilt keine Daten mit Ihrer Domain.", + "Access-Control-Allow-Origin__why": "Sicherheitsrichtlinie im Backend.", + "Access-Control-Allow-Origin__fix_0": "CORS serverseitig aktivieren", + "Invalid or unexpected token__explanation": "Es befindet sich ein Zeichen in Ihrem Code, das dort nicht sein sollte.", + "Invalid or unexpected token__why": "Beim Kopieren und Einfügen werden versteckte Symbole übertragen oder typografische Anführungszeichen („ statt \") verwendet.", + "Invalid or unexpected token__fix_0": "Zeile manuell neu eingeben", + "Invalid or unexpected token__fix_1": "Prüfe auf unsichtbare Zeichen", + "timeout of 2000ms exceeded__explanation": "Dein Test hat zu lange gebraucht, um abzuschließen.", + "timeout of 2000ms exceeded__why": "Asynchroner Code hat 'done()' nicht aufgerufen oder wurde nicht rechtzeitig beendet.", + "timeout of 2000ms exceeded__fix_0": "Erhöhe das Test-Timeout", + "timeout of 2000ms exceeded__fix_1": "Prüfe auf langsame API-Aufrufe", + "does not exist on type__explanation": "TypeScript-Fehler: Zugriff auf eine Eigenschaft, die nicht im Interface vorhanden ist.", + "does not exist on type__why": "Die Objektstruktur stimmt nicht mit der TypeScript-Typdefinition überein.", + "does not exist on type__fix_0": "Aktualisiere das Interface", + "does not exist on type__fix_1": "Verwende Type Casting: (obj as any).prop", + "npm ERR! 404__explanation": "NPM kann das Paket, das du installieren möchtest, nicht finden.", + "npm ERR! 404__why": "Tippfehler im Paketnamen oder es ist ein privates Paket.", + "npm ERR! 404__fix_0": "Prüfe die Schreibweise des Pakets", + "npm ERR! 404__fix_1": "npm login", + "Unexpected end of input__explanation": "Dein Code wurde abrupt beendet, wahrscheinlich fehlt eine schließende Klammer.", + "Unexpected end of input__why": "Du hast eine ( [ oder { geöffnet, aber vergessen, sie mit ) ] oder } zu schließen.", + "Unexpected end of input__fix_0": "Prüfe auf fehlende schließende Klammern )", + "Unexpected end of input__fix_1": "Prüfe auf fehlende geschweifte Klammern }", + "Unexpected end of input__fix_2": "Stelle sicher, dass alle Anführungszeichen ' oder \" geschlossen sind", + "missing ) after argument list__explanation": "Du hast vergessen, einen Funktionsaufruf mit ')' zu schließen.", + "missing ) after argument list__why": "Eine Klammer wurde geöffnet, aber die Zeile endete oder ein anderes Symbol erschien, bevor sie geschlossen wurde.", + "missing ) after argument list__fix_0": "Füge eine ')' am Ende deines Funktionsaufrufs hinzu", + "missing ) after argument list__fix_1": "Prüfe, ob du versehentlich eine ')' beim Tippen gelöscht hast" +} \ No newline at end of file diff --git a/locales/en.json b/locales/en.json new file mode 100644 index 0000000..9ecbe48 --- /dev/null +++ b/locales/en.json @@ -0,0 +1,199 @@ +{ + "Cannot read properties of undefined__explanation": "You are trying to access a property on a variable that is currently empty.", + "Cannot read properties of undefined__why": "The variable wasn't initialized, or an API call hasn't finished yet.", + "Cannot read properties of undefined__fix_0": "Use optional chaining: user?.name", + "Cannot read properties of undefined__fix_1": "Set a default value: data || []", + "is not defined__explanation": "You're using a variable that hasn't been declared.", + "is not defined__why": "Typo in the name or the variable is scoped inside another function.", + "is not defined__fix_0": "Check for typos", + "is not defined__fix_1": "Declare with const/let", + "is not a function__explanation": "You called a variable as a function, but it's another type (String/Object).", + "is not a function__why": "Import failed or a callback wasn't passed correctly.", + "is not a function__fix_0": "Check imports", + "is not a function__fix_1": "Verify type with typeof", + "Cannot find module__explanation": "Node.js cannot find the file or package you are importing.", + "Cannot find module__why": "The package isn't installed or the relative path is wrong.", + "Cannot find module__fix_0": "Run 'npm install'", + "Cannot find module__fix_1": "Check file path spelling", + "EADDRINUSE__explanation": "The port your server wants is already being used.", + "EADDRINUSE__why": "Another instance of your app is already running.", + "EADDRINUSE__fix_0": "Kill the other process", + "EADDRINUSE__fix_1": "Change the port number", + "Maximum call stack size exceeded__explanation": "The call stack limit was reached due to excessive recursion or a very deep call chain.", + "Maximum call stack size exceeded__why": "A recursive function is calling itself too many times without hitting a base case, or a chain of function calls builds up too deeply.", + "Maximum call stack size exceeded__fix_0": "Check recursion exit conditions", + "Maximum call stack size exceeded__fix_1": "Verify recursive base cases are reachable", + "Maximum call stack size exceeded__fix_2": "Check call-chain depth and stack-building loops", + "ECONNREFUSED__explanation": "Your app tried to connect to a database/API but was rejected.", + "ECONNREFUSED__why": "The target server is down or the URL is wrong.", + "ECONNREFUSED__fix_0": "Ensure DB is running", + "ECONNREFUSED__fix_1": "Check API URL", + "Assignment to constant variable__explanation": "You tried to change a 'const' variable.", + "Assignment to constant variable__why": "Const variables cannot be reassigned.", + "Assignment to constant variable__fix_0": "Use 'let' instead of 'const'", + "ENOENT__explanation": "You're trying to read a file that doesn't exist.", + "ENOENT__why": "File moved or path string is incorrect.", + "ENOENT__fix_0": "Verify file exists", + "ENOENT__fix_1": "Use path.join()", + "await is only valid in async functions__explanation": "You used 'await' inside a normal function.", + "await is only valid in async functions__why": "Await requires the 'async' keyword on the parent function.", + "await is only valid in async functions__fix_0": "Add 'async' to function definition", + "ERR_HTTP_HEADERS_SENT__explanation": "You sent a response after already sending one.", + "ERR_HTTP_HEADERS_SENT__why": "Multiple res.send() calls in one route.", + "ERR_HTTP_HEADERS_SENT__fix_0": "Use 'return res.send()' to stop execution", + "buffering timed out__explanation": "Mongoose couldn't connect to MongoDB in time.", + "buffering timed out__why": "Database is offline or connection string is wrong.", + "buffering timed out__fix_0": "Check MongoDB status", + "buffering timed out__fix_1": "Check connection string", + "jwt malformed__explanation": "The token provided is not a valid JWT structure.", + "jwt malformed__why": "Token is corrupted or only part of it was sent.", + "jwt malformed__fix_0": "Check 'Authorization' header", + "jwt malformed__fix_1": "Verify token generation", + "secretOrPrivateKey must have a value__explanation": "JWT secret key is missing.", + "secretOrPrivateKey must have a value__why": "Environment variable (JWT_SECRET) is not loaded.", + "secretOrPrivateKey must have a value__fix_0": "Check .env file", + "secretOrPrivateKey must have a value__fix_1": "Run dotenv.config()", + "E11000__explanation": "You're saving data with a 'unique' field that already exists.", + "E11000__why": "Usually a duplicate Email or Username in the DB.", + "E11000__fix_0": "Check if data exists before saving", + "E11000__fix_1": "Use unique error handling", + "Unexpected token < in JSON__explanation": "You tried to parse JSON, but got HTML instead.", + "Unexpected token < in JSON__why": "Your API returned an error page (HTML) instead of data (JSON).", + "Unexpected token < in JSON__fix_0": "Check the API URL", + "Unexpected token < in JSON__fix_1": "Check server logs for crashes", + "CORS__explanation": "Browser blocked your request for security reasons.", + "CORS__why": "The server doesn't allow requests from your frontend domain.", + "CORS__fix_0": "Install 'cors' package on server", + "CORS__fix_1": "app.use(cors())", + "'map' of undefined__explanation": "You're trying to loop through an array that doesn't exist.", + "'map' of undefined__why": "The variable is null/undefined instead of an Array.", + "'map' of undefined__fix_0": "Initialize as empty array: data || []", + "'map' of undefined__fix_1": "Check API response", + "module not found 'dotenv'__explanation": "The 'dotenv' package is missing.", + "module not found 'dotenv'__why": "You used it in code but didn't install it.", + "module not found 'dotenv'__fix_0": "npm install dotenv", + "validation failed__explanation": "Data doesn't match your Mongoose schema.", + "validation failed__why": "Missing required fields or wrong data types.", + "validation failed__fix_0": "Check required fields", + "validation failed__fix_1": "Validate data on frontend", + "not authorized__explanation": "Access denied because of missing or invalid credentials.", + "not authorized__why": "Token expired or wrong API key.", + "not authorized__fix_0": "Login again", + "not authorized__fix_1": "Check headers", + "status code 404__explanation": "The API endpoint you are calling doesn't exist.", + "status code 404__why": "Wrong URL or the server route isn't defined.", + "status code 404__fix_0": "Check API route spelling", + "status code 404__fix_1": "Check Base URL", + "status code 500__explanation": "The server crashed while processing your request.", + "status code 500__why": "A bug on the backend server code.", + "status code 500__fix_0": "Check server console logs", + "status code 500__fix_1": "Add try/catch on server", + "is not iterable__explanation": "You used a for...of loop or spread (...) on a non-array.", + "is not iterable__why": "You tried to iterate over an Object or Null.", + "is not iterable__fix_0": "Ensure variable is an Array", + "is not iterable__fix_1": "Use Object.keys()", + "require is not defined__explanation": "You're using 'require' in an ES Module.", + "require is not defined__why": "Node.js is set to 'type': 'module' in package.json.", + "require is not defined__fix_0": "Use 'import' instead", + "require is not defined__fix_1": "Remove 'type: module'", + "EACCES__explanation": "You don't have permission to access this file/port.", + "EACCES__why": "You need admin rights or the file is locked.", + "EACCES__fix_0": "Use 'sudo' (Linux/Mac)", + "EACCES__fix_1": "Check file permissions", + "has already been declared__explanation": "You declared the same variable name twice.", + "has already been declared__why": "Using 'let' or 'const' on a name that exists in the same scope.", + "has already been declared__fix_0": "Rename one of the variables", + "has already been declared__fix_1": "Remove the second declaration", + "PayloadTooLargeError__explanation": "The data you sent is too big for the server.", + "PayloadTooLargeError__why": "Usually an image or file that exceeds the body-parser limit.", + "PayloadTooLargeError__fix_0": "Increase limit: app.use(express.json({limit: '50mb'}))", + "set property of null__explanation": "You're trying to give a value to a property of an empty variable.", + "set property of null__why": "The object you're modifying hasn't been created yet.", + "set property of null__fix_0": "Initialize the object first", + "set property of null__fix_1": "Check for null", + "socket hang up__explanation": "The server closed the connection unexpectedly.", + "socket hang up__why": "Server crashed or timeout occurred.", + "socket hang up__fix_0": "Check server health", + "socket hang up__fix_1": "Increase timeout limit", + "Unexpected end of JSON input__explanation": "The JSON data is incomplete or empty.", + "Unexpected end of JSON input__why": "The server sent an empty string instead of JSON.", + "Unexpected end of JSON input__fix_0": "Check API response body", + "Unexpected end of JSON input__fix_1": "Handle empty responses", + "Script execution timed out__explanation": "Your code took too long to run.", + "Script execution timed out__why": "Heavy computation or infinite loop.", + "Script execution timed out__fix_0": "Optimize logic", + "Script execution timed out__fix_1": "Use worker threads", + "'then' of undefined__explanation": "You called .then() on something that isn't a Promise.", + "'then' of undefined__why": "The function didn't return a promise.", + "'then' of undefined__fix_0": "Make function 'async'", + "'then' of undefined__fix_1": "Return a Promise", + "Invalid connection string__explanation": "The database URL format is wrong.", + "Invalid connection string__why": "Missing symbols like '@' or '/' in the URI.", + "Invalid connection string__fix_0": "Check DB URI format", + "window is not defined__explanation": "You're trying to use browser code (window) in Node.js.", + "window is not defined__why": "Node.js doesn't have a 'window' object (that's for browsers).", + "window is not defined__fix_0": "Check if running in browser", + "window is not defined__fix_1": "Use 'global' instead", + "Too many listeners__explanation": "Memory leak detected in EventEmitters.", + "Too many listeners__why": "Adding event listeners inside a loop or repeated function.", + "Too many listeners__fix_0": "Use .once() instead of .on()", + "Too many listeners__fix_1": "Remove old listeners", + "spread non-iterable__explanation": "You tried to use `...obj` where it's not allowed.", + "spread non-iterable__why": "Trying to spread an object into an array.", + "spread non-iterable__fix_0": "Use brackets [] for arrays and {} for objects", + "EPIPE__explanation": "Broken pipe: sending data to a closed connection.", + "EPIPE__why": "The other side (client/process) stopped listening.", + "EPIPE__fix_0": "Handle stream errors", + "EPIPE__fix_1": "Check if process is alive", + "Missing initializer__explanation": "You declared a const without giving it a value.", + "Missing initializer__why": "Const must be set immediately when created.", + "Missing initializer__fix_0": "Assign a value: const x = 1;", + "peerinvalid__explanation": "Installed packages have conflicting versions.", + "peerinvalid__why": "One library needs version A, another needs version B.", + "peerinvalid__fix_0": "npm install --legacy-peer-deps", + "filter is not a function__explanation": "You're trying to filter something that isn't an array.", + "filter is not a function__why": "The variable is an Object or Null.", + "filter is not a function__fix_0": "Ensure data is an Array: Array.isArray(data)", + "ENOTFOUND__explanation": "DNS lookup failed for the URL.", + "ENOTFOUND__why": "Typo in the URL or no internet connection.", + "ENOTFOUND__fix_0": "Check URL spelling", + "ENOTFOUND__fix_1": "Check DNS/Internet", + "reserved word__explanation": "You used a word saved for JS (like 'class' or 'await') as a variable name.", + "reserved word__why": "You can't name a variable 'class' or 'function'.", + "reserved word__fix_0": "Rename the variable", + "Cannot find name__explanation": "TypeScript cannot find this variable or type.", + "Cannot find name__why": "Variable not declared or missing @types package.", + "Cannot find name__fix_0": "Check imports", + "Cannot find name__fix_1": "Install types: npm install @types/node", + "convert undefined or null to object__explanation": "Calling Object methods on an empty variable.", + "convert undefined or null to object__why": "Using Object.keys(data) when data is null.", + "convert undefined or null to object__fix_0": "Check if data exists: data && Object.keys(data)", + "Access-Control-Allow-Origin__explanation": "CORS error: Server isn't sharing data with your domain.", + "Access-Control-Allow-Origin__why": "Security policy on the backend.", + "Access-Control-Allow-Origin__fix_0": "Enable CORS on the server side", + "Invalid or unexpected token__explanation": "There is a character in your code that shouldn't be there.", + "Invalid or unexpected token__why": "Copy-pasting hidden symbols or using smart quotes (” instead of \").", + "Invalid or unexpected token__fix_0": "Retype the line manually", + "Invalid or unexpected token__fix_1": "Check for invisible symbols", + "timeout of 2000ms exceeded__explanation": "Your test took too long to finish.", + "timeout of 2000ms exceeded__why": "Asynchronous code didn't call 'done()' or finish in time.", + "timeout of 2000ms exceeded__fix_0": "Increase test timeout", + "timeout of 2000ms exceeded__fix_1": "Check for slow API calls", + "does not exist on type__explanation": "TypeScript Error: Accessing a property that isn't in the Interface.", + "does not exist on type__why": "The object structure doesn't match the TS Type definition.", + "does not exist on type__fix_0": "Update the Interface", + "does not exist on type__fix_1": "Use type casting: (obj as any).prop", + "npm ERR! 404__explanation": "NPM can't find the package you want to install.", + "npm ERR! 404__why": "Typo in the package name or it's a private package.", + "npm ERR! 404__fix_0": "Check package spelling", + "npm ERR! 404__fix_1": "npm login", + "Unexpected end of input__explanation": "Your code stopped abruptly, likely due to a missing closing bracket.", + "Unexpected end of input__why": "You opened a ( [ or { but forgot to close it with ) ] or }.", + "Unexpected end of input__fix_0": "Check for missing closing parentheses )", + "Unexpected end of input__fix_1": "Check for missing curly braces }", + "Unexpected end of input__fix_2": "Ensure all quotes ' or \" are closed", + "missing ) after argument list__explanation": "You forgot to close a function call with a ')'.", + "missing ) after argument list__why": "A parenthesis was opened but the line ended or another symbol appeared before it was closed.", + "missing ) after argument list__fix_0": "Add a ')' at the end of your function call", + "missing ) after argument list__fix_1": "Check if you accidentally deleted a ')' while typing" +} \ No newline at end of file diff --git a/locales/es.json b/locales/es.json new file mode 100644 index 0000000..4be3c68 --- /dev/null +++ b/locales/es.json @@ -0,0 +1,199 @@ +{ + "Cannot read properties of undefined__explanation": "Estás intentando acceder a una propiedad de una variable que actualmente está vacía.", + "Cannot read properties of undefined__why": "La variable no fue inicializada, o una llamada a la API aún no ha finalizado.", + "Cannot read properties of undefined__fix_0": "Usa encadenamiento opcional: user?.name", + "Cannot read properties of undefined__fix_1": "Establece un valor predeterminado: data || []", + "is not defined__explanation": "Estás usando una variable que no ha sido declarada.", + "is not defined__why": "Error tipográfico en el nombre o la variable está dentro del alcance de otra función.", + "is not defined__fix_0": "Verifica errores tipográficos", + "is not defined__fix_1": "Declara con const/let", + "is not a function__explanation": "Llamaste a una variable como función, pero es de otro tipo (String/Object).", + "is not a function__why": "La importación falló o un callback no se pasó correctamente.", + "is not a function__fix_0": "Verifica las importaciones", + "is not a function__fix_1": "Verifica el tipo con typeof", + "Cannot find module__explanation": "Node.js no puede encontrar el archivo o paquete que estás importando.", + "Cannot find module__why": "El paquete no está instalado o la ruta relativa es incorrecta.", + "Cannot find module__fix_0": "Ejecuta 'npm install'", + "Cannot find module__fix_1": "Verifica la ortografía de la ruta del archivo", + "EADDRINUSE__explanation": "El puerto que tu servidor quiere usar ya está siendo utilizado.", + "EADDRINUSE__why": "Otra instancia de tu aplicación ya está en ejecución.", + "EADDRINUSE__fix_0": "Finaliza el otro proceso", + "EADDRINUSE__fix_1": "Cambia el número de puerto", + "Maximum call stack size exceeded__explanation": "Se alcanzó el límite de la pila de llamadas debido a una recursión excesiva o una cadena de llamadas muy profunda.", + "Maximum call stack size exceeded__why": "Una función recursiva se está llamando a sí misma demasiadas veces sin alcanzar un caso base, o una cadena de llamadas de funciones se acumula con demasiada profundidad.", + "Maximum call stack size exceeded__fix_0": "Verifica las condiciones de salida de la recursión", + "Maximum call stack size exceeded__fix_1": "Verifica que los casos base recursivos sean alcanzables", + "Maximum call stack size exceeded__fix_2": "Verifica la profundidad de la cadena de llamadas y bucles que construyen la pila", + "ECONNREFUSED__explanation": "Tu aplicación intentó conectarse a una base de datos/API pero fue rechazada.", + "ECONNREFUSED__why": "El servidor de destino está caído o la URL es incorrecta.", + "ECONNREFUSED__fix_0": "Asegúrate de que la BD esté ejecutándose", + "ECONNREFUSED__fix_1": "Verifica la URL de la API", + "Assignment to constant variable__explanation": "Intentaste cambiar una variable 'const'.", + "Assignment to constant variable__why": "Las variables const no pueden ser reasignadas.", + "Assignment to constant variable__fix_0": "Usa 'let' en lugar de 'const'", + "ENOENT__explanation": "Estás intentando leer un archivo que no existe.", + "ENOENT__why": "El archivo fue movido o la ruta es incorrecta.", + "ENOENT__fix_0": "Verifica que el archivo exista", + "ENOENT__fix_1": "Usa path.join()", + "await is only valid in async functions__explanation": "Usaste 'await' dentro de una función normal.", + "await is only valid in async functions__why": "Await requiere la palabra clave 'async' en la función padre.", + "await is only valid in async functions__fix_0": "Agrega 'async' a la definición de la función", + "ERR_HTTP_HEADERS_SENT__explanation": "Enviaste una respuesta después de haber enviado una anteriormente.", + "ERR_HTTP_HEADERS_SENT__why": "Múltiples llamadas a res.send() en una misma ruta.", + "ERR_HTTP_HEADERS_SENT__fix_0": "Usa 'return res.send()' para detener la ejecución", + "buffering timed out__explanation": "Mongoose no pudo conectarse a MongoDB a tiempo.", + "buffering timed out__why": "La base de datos está fuera de línea o la cadena de conexión es incorrecta.", + "buffering timed out__fix_0": "Verifica el estado de MongoDB", + "buffering timed out__fix_1": "Verifica la cadena de conexión", + "jwt malformed__explanation": "El token proporcionado no tiene una estructura JWT válida.", + "jwt malformed__why": "El token está corrupto o solo se envió una parte de él.", + "jwt malformed__fix_0": "Verifica el encabezado 'Authorization'", + "jwt malformed__fix_1": "Verifica la generación del token", + "secretOrPrivateKey must have a value__explanation": "Falta la clave secreta JWT.", + "secretOrPrivateKey must have a value__why": "La variable de entorno (JWT_SECRET) no está cargada.", + "secretOrPrivateKey must have a value__fix_0": "Verifica el archivo .env", + "secretOrPrivateKey must have a value__fix_1": "Ejecuta dotenv.config()", + "E11000__explanation": "Estás guardando datos con un campo 'unique' que ya existe.", + "E11000__why": "Normalmente un Email o Username duplicado en la base de datos.", + "E11000__fix_0": "Verifica si los datos existen antes de guardar", + "E11000__fix_1": "Usa manejo de errores para duplicados", + "Unexpected token < in JSON__explanation": "Intentaste analizar JSON, pero recibiste HTML en su lugar.", + "Unexpected token < in JSON__why": "Tu API devolvió una página de error (HTML) en lugar de datos (JSON).", + "Unexpected token < in JSON__fix_0": "Verifica la URL de la API", + "Unexpected token < in JSON__fix_1": "Revisa los registros del servidor en busca de fallos", + "CORS__explanation": "El navegador bloqueó tu solicitud por razones de seguridad.", + "CORS__why": "El servidor no permite solicitudes desde el dominio de tu frontend.", + "CORS__fix_0": "Instala el paquete 'cors' en el servidor", + "CORS__fix_1": "app.use(cors())", + "'map' of undefined__explanation": "Estás intentando iterar sobre un array que no existe.", + "'map' of undefined__why": "La variable es null/undefined en lugar de un Array.", + "'map' of undefined__fix_0": "Inicializa como array vacío: data || []", + "'map' of undefined__fix_1": "Verifica la respuesta de la API", + "module not found 'dotenv'__explanation": "Falta el paquete 'dotenv'.", + "module not found 'dotenv'__why": "Lo usaste en el código pero no lo instalaste.", + "module not found 'dotenv'__fix_0": "npm install dotenv", + "validation failed__explanation": "Los datos no coinciden con tu esquema de Mongoose.", + "validation failed__why": "Faltan campos requeridos o hay tipos de datos incorrectos.", + "validation failed__fix_0": "Verifica los campos obligatorios", + "validation failed__fix_1": "Valida los datos en el frontend", + "not authorized__explanation": "Acceso denegado debido a credenciales faltantes o inválidas.", + "not authorized__why": "Token expirado o clave de API incorrecta.", + "not authorized__fix_0": "Inicia sesión nuevamente", + "not authorized__fix_1": "Verifica los encabezados", + "status code 404__explanation": "El endpoint de la API que estás llamando no existe.", + "status code 404__why": "URL incorrecta o la ruta del servidor no está definida.", + "status code 404__fix_0": "Verifica la ortografía de la ruta de la API", + "status code 404__fix_1": "Verifica la URL base", + "status code 500__explanation": "El servidor falló mientras procesaba tu solicitud.", + "status code 500__why": "Un error en el código del servidor backend.", + "status code 500__fix_0": "Verifica los registros de consola del servidor", + "status code 500__fix_1": "Agrega try/catch en el servidor", + "is not iterable__explanation": "Usaste un bucle for...of o spread (...) en un no-array.", + "is not iterable__why": "Intentaste iterar sobre un Object o Null.", + "is not iterable__fix_0": "Asegúrate de que la variable sea un Array", + "is not iterable__fix_1": "Usa Object.keys()", + "require is not defined__explanation": "Estás usando 'require' en un módulo ES.", + "require is not defined__why": "Node.js está configurado con 'type': 'module' en package.json.", + "require is not defined__fix_0": "Usa 'import' en su lugar", + "require is not defined__fix_1": "Elimina 'type: module'", + "EACCES__explanation": "No tienes permiso para acceder a este archivo/puerto.", + "EACCES__why": "Necesitas permisos de administrador o el archivo está bloqueado.", + "EACCES__fix_0": "Usa 'sudo' (Linux/Mac)", + "EACCES__fix_1": "Verificar los permisos del archivo", + "has already been declared__explanation": "Declaraste el mismo nombre de variable dos veces.", + "has already been declared__why": "Usar 'let' o 'const' en un nombre que ya existe en el mismo ámbito.", + "has already been declared__fix_0": "Renombrar una de las variables", + "has already been declared__fix_1": "Eliminar la segunda declaración", + "PayloadTooLargeError__explanation": "Los datos que enviaste son demasiado grandes para el servidor.", + "PayloadTooLargeError__why": "Generalmente una imagen o archivo que excede el límite de body-parser.", + "PayloadTooLargeError__fix_0": "Aumentar el límite: app.use(express.json({limit: '50mb'}))", + "set property of null__explanation": "Estás intentando asignar un valor a una propiedad de una variable vacía.", + "set property of null__why": "El objeto que estás modificando aún no ha sido creado.", + "set property of null__fix_0": "Inicializar el objeto primero", + "set property of null__fix_1": "Verificar si es null", + "socket hang up__explanation": "El servidor cerró la conexión inesperadamente.", + "socket hang up__why": "El servidor se bloqueó o se agotó el tiempo de espera.", + "socket hang up__fix_0": "Verificar el estado del servidor", + "socket hang up__fix_1": "Aumentar el límite de tiempo de espera", + "Unexpected end of JSON input__explanation": "Los datos JSON están incompletos o vacíos.", + "Unexpected end of JSON input__why": "El servidor envió una cadena vacía en lugar de JSON.", + "Unexpected end of JSON input__fix_0": "Verificar el cuerpo de la respuesta de la API", + "Unexpected end of JSON input__fix_1": "Manejar respuestas vacías", + "Script execution timed out__explanation": "Tu código tardó demasiado en ejecutarse.", + "Script execution timed out__why": "Cálculo pesado o bucle infinito.", + "Script execution timed out__fix_0": "Optimizar la lógica", + "Script execution timed out__fix_1": "Usar hilos de trabajo", + "'then' of undefined__explanation": "Llamaste a .then() en algo que no es una Promesa.", + "'then' of undefined__why": "La función no devolvió una promesa.", + "'then' of undefined__fix_0": "Hacer la función 'async'", + "'then' of undefined__fix_1": "Devolver una Promise", + "Invalid connection string__explanation": "El formato de la URL de la base de datos es incorrecto.", + "Invalid connection string__why": "Faltan símbolos como '@' o '/' en el URI.", + "Invalid connection string__fix_0": "Verificar formato del URI de la BD", + "window is not defined__explanation": "Estás intentando usar código del navegador (window) en Node.js.", + "window is not defined__why": "Node.js no tiene un objeto 'window' (eso es para navegadores).", + "window is not defined__fix_0": "Verificar si se ejecuta en navegador", + "window is not defined__fix_1": "Usar 'global' en su lugar", + "Too many listeners__explanation": "Fuga de memoria detectada en EventEmitters.", + "Too many listeners__why": "Agregando escuchadores de eventos dentro de un bucle o función repetida.", + "Too many listeners__fix_0": "Usar .once() en lugar de .on()", + "Too many listeners__fix_1": "Eliminar escuchadores antiguos", + "spread non-iterable__explanation": "Intentaste usar `...obj` donde no está permitido.", + "spread non-iterable__why": "Intentando expandir un objeto en un array.", + "spread non-iterable__fix_0": "Usar corchetes [] para arrays y {} para objetos", + "EPIPE__explanation": "Tubería rota: enviando datos a una conexión cerrada.", + "EPIPE__why": "El otro lado (cliente/proceso) dejó de escuchar.", + "EPIPE__fix_0": "Manejar errores de stream", + "EPIPE__fix_1": "Verificar si el proceso está activo", + "Missing initializer__explanation": "Declaraste una constante sin asignarle un valor.", + "Missing initializer__why": "Las constantes deben inicializarse inmediatamente al crearlas.", + "Missing initializer__fix_0": "Asignar un valor: const x = 1;", + "peerinvalid__explanation": "Los paquetes instalados tienen versiones en conflicto.", + "peerinvalid__why": "Una biblioteca necesita la versión A y otra la versión B.", + "peerinvalid__fix_0": "npm install --legacy-peer-deps", + "filter is not a function__explanation": "Estás intentando filtrar algo que no es un arreglo.", + "filter is not a function__why": "La variable es un objeto o Null.", + "filter is not a function__fix_0": "Asegúrate de que los datos sean un arreglo: Array.isArray(data)", + "ENOTFOUND__explanation": "Falló la búsqueda DNS de la URL.", + "ENOTFOUND__why": "Error de escritura en la URL o no hay conexión a internet.", + "ENOTFOUND__fix_0": "Verifica la ortografía de la URL", + "ENOTFOUND__fix_1": "Verifica el DNS/Internet", + "reserved word__explanation": "Usaste una palabra reservada de JS (como 'class' o 'await') como nombre de variable.", + "reserved word__why": "No se puede nombrar una variable como 'class' o 'function'.", + "reserved word__fix_0": "Renombra la variable", + "Cannot find name__explanation": "TypeScript no puede encontrar esta variable o tipo.", + "Cannot find name__why": "La variable no está declarada o falta el paquete @types.", + "Cannot find name__fix_0": "Verifica las importaciones", + "Cannot find name__fix_1": "Instala los tipos: npm install @types/node", + "convert undefined or null to object__explanation": "Estás llamando métodos de Object sobre una variable vacía.", + "convert undefined or null to object__why": "Usas Object.keys(data) cuando data es null.", + "convert undefined or null to object__fix_0": "Verifica si existen datos: data && Object.keys(data)", + "Access-Control-Allow-Origin__explanation": "Error de CORS: el servidor no comparte los datos con tu dominio.", + "Access-Control-Allow-Origin__why": "Política de seguridad en el backend.", + "Access-Control-Allow-Origin__fix_0": "Habilita CORS en el servidor", + "Invalid or unexpected token__explanation": "Hay un carácter en tu código que no debería estar ahí.", + "Invalid or unexpected token__why": "Pegaste símbolos ocultos o usaste comillas tipográficas (” en vez de \").", + "Invalid or unexpected token__fix_0": "Escribe la línea manualmente", + "Invalid or unexpected token__fix_1": "Busca símbolos invisibles", + "timeout of 2000ms exceeded__explanation": "Tu prueba tardó demasiado en finalizar.", + "timeout of 2000ms exceeded__why": "El código asíncrono no llamó a 'done()' o no finalizó a tiempo.", + "timeout of 2000ms exceeded__fix_0": "Aumenta el tiempo de espera de la prueba", + "timeout of 2000ms exceeded__fix_1": "Revisa las llamadas lentas a la API", + "does not exist on type__explanation": "Error de TypeScript: Estás accediendo a una propiedad que no existe en la interfaz.", + "does not exist on type__why": "La estructura del objeto no coincide con la definición del tipo TS.", + "does not exist on type__fix_0": "Actualiza la interfaz", + "does not exist on type__fix_1": "Usa conversión de tipos: (obj as any).prop", + "npm ERR! 404__explanation": "NPM no puede encontrar el paquete que quieres instalar.", + "npm ERR! 404__why": "Error tipográfico en el nombre del paquete o es un paquete privado.", + "npm ERR! 404__fix_0": "Verifica la ortografía del paquete", + "npm ERR! 404__fix_1": "npm login", + "Unexpected end of input__explanation": "Tu código se detuvo abruptamente, probablemente debido a un corchete de cierre faltante.", + "Unexpected end of input__why": "Abriste un ( [ o { pero olvidaste cerrarlo con ) ] o }.", + "Unexpected end of input__fix_0": "Revisa si faltan paréntesis de cierre )", + "Unexpected end of input__fix_1": "Revisa si faltan llaves de cierre }", + "Unexpected end of input__fix_2": "Asegúrate de que todas las comillas ' o \" estén cerradas", + "missing ) after argument list__explanation": "Olvidaste cerrar una llamada a función con un ')'.", + "missing ) after argument list__why": "Se abrió un paréntesis pero la línea terminó o apareció otro símbolo antes de que se cerrara.", + "missing ) after argument list__fix_0": "Añade un ')' al final de tu llamada a función", + "missing ) after argument list__fix_1": "Revisa si borraste accidentalmente un ')' mientras escribías" +} \ No newline at end of file diff --git a/locales/fr.json b/locales/fr.json new file mode 100644 index 0000000..f4eb5f4 --- /dev/null +++ b/locales/fr.json @@ -0,0 +1,199 @@ +{ + "Cannot read properties of undefined__explanation": "Vous essayez d'accéder à une propriété sur une variable qui est actuellement vide.", + "Cannot read properties of undefined__why": "La variable n'a pas été initialisée, ou un appel API n'est pas encore terminé.", + "Cannot read properties of undefined__fix_0": "Utilisez le chaînage optionnel : user?.name", + "Cannot read properties of undefined__fix_1": "Définissez une valeur par défaut : data || []", + "is not defined__explanation": "Vous utilisez une variable qui n'a pas été déclarée.", + "is not defined__why": "Faute de frappe dans le nom ou la variable est limitée à la portée d'une autre fonction.", + "is not defined__fix_0": "Vérifiez les fautes de frappe", + "is not defined__fix_1": "Déclarez avec const/let", + "is not a function__explanation": "Vous avez appelé une variable comme une fonction, mais c'est un autre type (String/Object).", + "is not a function__why": "L'importation a échoué ou un callback n'a pas été transmis correctement.", + "is not a function__fix_0": "Vérifiez les importations", + "is not a function__fix_1": "Vérifiez le type avec typeof", + "Cannot find module__explanation": "Node.js ne peut pas trouver le fichier ou le package que vous importez.", + "Cannot find module__why": "Le package n'est pas installé ou le chemin relatif est incorrect.", + "Cannot find module__fix_0": "Exécutez 'npm install'", + "Cannot find module__fix_1": "Vérifiez l'orthographe du chemin du fichier", + "EADDRINUSE__explanation": "Le port que votre serveur souhaite utiliser est déjà occupé.", + "EADDRINUSE__why": "Une autre instance de votre application est déjà en cours d'exécution.", + "EADDRINUSE__fix_0": "Arrêtez l'autre processus", + "EADDRINUSE__fix_1": "Changez le numéro de port", + "Maximum call stack size exceeded__explanation": "La limite de la pile d'appels a été atteinte en raison d'une récursion excessive ou d'une chaîne d'appels très profonde.", + "Maximum call stack size exceeded__why": "Une fonction récursive s'appelle elle-même trop de fois sans atteindre de cas de base, ou une chaîne d'appels de fonctions s'accumule trop profondément.", + "Maximum call stack size exceeded__fix_0": "Vérifiez les conditions de sortie de la récursion", + "Maximum call stack size exceeded__fix_1": "Vérifiez que les cas de base récursifs sont accessibles", + "Maximum call stack size exceeded__fix_2": "Vérifiez la profondeur de la chaîne d'appels et les boucles qui accumulent la pile", + "ECONNREFUSED__explanation": "Votre application a tenté de se connecter à une base de données/API mais a été refusée.", + "ECONNREFUSED__why": "Le serveur cible est hors ligne ou l'URL est incorrecte.", + "ECONNREFUSED__fix_0": "Vérifiez que la base de données est en cours d'exécution", + "ECONNREFUSED__fix_1": "Vérifiez l'URL de l'API", + "Assignment to constant variable__explanation": "Vous avez essayé de modifier une variable 'const'.", + "Assignment to constant variable__why": "Les variables const ne peuvent pas être réaffectées.", + "Assignment to constant variable__fix_0": "Utilisez 'let' au lieu de 'const'", + "ENOENT__explanation": "Vous essayez de lire un fichier qui n'existe pas.", + "ENOENT__why": "Le fichier a été déplacé ou le chemin est incorrect.", + "ENOENT__fix_0": "Vérifiez que le fichier existe", + "ENOENT__fix_1": "Utilisez path.join()", + "await is only valid in async functions__explanation": "Vous avez utilisé 'await' à l'intérieur d'une fonction normale.", + "await is only valid in async functions__why": "Await nécessite le mot-clé 'async' sur la fonction parente.", + "await is only valid in async functions__fix_0": "Ajoutez 'async' à la définition de la fonction", + "ERR_HTTP_HEADERS_SENT__explanation": "Vous avez envoyé une réponse après en avoir déjà envoyé une.", + "ERR_HTTP_HEADERS_SENT__why": "Plusieurs appels à res.send() dans une seule route.", + "ERR_HTTP_HEADERS_SENT__fix_0": "Utilisez 'return res.send()' pour arrêter l'exécution", + "buffering timed out__explanation": "Mongoose n'a pas pu se connecter à MongoDB à temps.", + "buffering timed out__why": "La base de données est hors ligne ou la chaîne de connexion est incorrecte.", + "buffering timed out__fix_0": "Vérifiez l'état de MongoDB", + "buffering timed out__fix_1": "Vérifiez la chaîne de connexion", + "jwt malformed__explanation": "Le token fourni n'a pas une structure JWT valide.", + "jwt malformed__why": "Le token est corrompu ou seule une partie a été envoyée.", + "jwt malformed__fix_0": "Vérifiez l'en-tête 'Authorization'", + "jwt malformed__fix_1": "Vérifiez la génération du token", + "secretOrPrivateKey must have a value__explanation": "La clé secrète JWT est manquante.", + "secretOrPrivateKey must have a value__why": "La variable d'environnement (JWT_SECRET) n'est pas chargée.", + "secretOrPrivateKey must have a value__fix_0": "Vérifiez le fichier .env", + "secretOrPrivateKey must have a value__fix_1": "Exécutez dotenv.config()", + "E11000__explanation": "Vous enregistrez des données avec un champ 'unique' qui existe déjà.", + "E11000__why": "Généralement un email ou un nom d'utilisateur en double dans la base de données.", + "E11000__fix_0": "Vérifiez si les données existent avant de les enregistrer", + "E11000__fix_1": "Utilisez la gestion des erreurs pour les doublons", + "Unexpected token < in JSON__explanation": "Vous avez tenté d'analyser du JSON, mais avez reçu du HTML à la place.", + "Unexpected token < in JSON__why": "Votre API a renvoyé une page d'erreur (HTML) au lieu de données (JSON).", + "Unexpected token < in JSON__fix_0": "Vérifiez l'URL de l'API", + "Unexpected token < in JSON__fix_1": "Consultez les logs du serveur pour détecter les plantages", + "CORS__explanation": "Le navigateur a bloqué votre requête pour des raisons de sécurité.", + "CORS__why": "Le serveur n'autorise pas les requêtes provenant du domaine de votre frontend.", + "CORS__fix_0": "Installez le package 'cors' sur le serveur", + "CORS__fix_1": "app.use(cors())", + "'map' of undefined__explanation": "Vous essayez de parcourir un tableau qui n'existe pas.", + "'map' of undefined__why": "La variable est null/undefined au lieu d'être un tableau.", + "'map' of undefined__fix_0": "Initialisez comme tableau vide : data || []", + "'map' of undefined__fix_1": "Vérifiez la réponse de l'API", + "module not found 'dotenv'__explanation": "Le package 'dotenv' est manquant.", + "module not found 'dotenv'__why": "Vous l'avez utilisé dans le code mais ne l'avez pas installé.", + "module not found 'dotenv'__fix_0": "npm install dotenv", + "validation failed__explanation": "Les données ne correspondent pas à votre schéma Mongoose.", + "validation failed__why": "Champs requis manquants ou types de données incorrects.", + "validation failed__fix_0": "Vérifier les champs obligatoires", + "validation failed__fix_1": "Valider les données côté frontend", + "not authorized__explanation": "Accès refusé en raison d'identifiants manquants ou invalides.", + "not authorized__why": "Jeton expiré ou clé API incorrecte.", + "not authorized__fix_0": "Se reconnecter", + "not authorized__fix_1": "Vérifier les en-têtes", + "status code 404__explanation": "Le point de terminaison API que vous appelez n'existe pas.", + "status code 404__why": "URL incorrecte ou la route serveur n'est pas définie.", + "status code 404__fix_0": "Vérifier l'orthographe de la route API", + "status code 404__fix_1": "Vérifier l'URL de base", + "status code 500__explanation": "Le serveur a planté lors du traitement de votre requête.", + "status code 500__why": "Un bug dans le code backend du serveur.", + "status code 500__fix_0": "Vérifier les logs de la console serveur", + "status code 500__fix_1": "Ajouter try/catch sur le serveur", + "is not iterable__explanation": "Vous avez utilisé une boucle for...of ou la décomposition (...) sur un non-tableau.", + "is not iterable__why": "Vous avez essayé d'itérer sur un Object ou Null.", + "is not iterable__fix_0": "S'assurer que la variable est un Array", + "is not iterable__fix_1": "Utiliser Object.keys()", + "require is not defined__explanation": "Vous utilisez 'require' dans un module ES.", + "require is not defined__why": "Node.js est configuré avec 'type': 'module' dans package.json.", + "require is not defined__fix_0": "Utiliser 'import' à la place", + "require is not defined__fix_1": "Supprimer 'type: module'", + "EACCES__explanation": "Vous n'avez pas la permission d'accéder à ce fichier/port.", + "EACCES__why": "Vous avez besoin de droits administrateur ou le fichier est verrouillé.", + "EACCES__fix_0": "Utiliser 'sudo' (Linux/Mac)", + "EACCES__fix_1": "Vérifier les permissions du fichier", + "has already been declared__explanation": "Vous avez déclaré le même nom de variable deux fois.", + "has already been declared__why": "Utilisation de 'let' ou 'const' sur un nom qui existe déjà dans la même portée.", + "has already been declared__fix_0": "Renommer l'une des variables", + "has already been declared__fix_1": "Supprimer la seconde déclaration", + "PayloadTooLargeError__explanation": "Les données que vous avez envoyées sont trop volumineuses pour le serveur.", + "PayloadTooLargeError__why": "Généralement une image ou un fichier qui dépasse la limite du body-parser.", + "PayloadTooLargeError__fix_0": "Augmenter la limite : app.use(express.json({limit: '50mb'}))", + "set property of null__explanation": "Vous essayez d'attribuer une valeur à une propriété d'une variable vide.", + "set property of null__why": "L'objet que vous modifiez n'a pas encore été créé.", + "set property of null__fix_0": "Initialiser l'objet d'abord", + "set property of null__fix_1": "Vérifier la présence de null", + "socket hang up__explanation": "Le serveur a fermé la connexion de manière inattendue.", + "socket hang up__why": "Le serveur s'est arrêté ou un délai d'attente s'est produit.", + "socket hang up__fix_0": "Vérifier l'état du serveur", + "socket hang up__fix_1": "Augmenter le délai d'attente", + "Unexpected end of JSON input__explanation": "Les données JSON sont incomplètes ou vides.", + "Unexpected end of JSON input__why": "Le serveur a envoyé une chaîne vide au lieu de JSON.", + "Unexpected end of JSON input__fix_0": "Vérifier le corps de la réponse API", + "Unexpected end of JSON input__fix_1": "Gérer les réponses vides", + "Script execution timed out__explanation": "Votre code a mis trop de temps à s'exécuter.", + "Script execution timed out__why": "Calcul intensif ou boucle infinie.", + "Script execution timed out__fix_0": "Optimiser la logique", + "Script execution timed out__fix_1": "Utiliser des worker threads", + "'then' of undefined__explanation": "Vous avez appelé .then() sur quelque chose qui n'est pas une Promise.", + "'then' of undefined__why": "La fonction n'a pas renvoyé de promesse.", + "'then' of undefined__fix_0": "Rendre la fonction 'async'", + "'then' of undefined__fix_1": "Renvoyer une Promise", + "Invalid connection string__explanation": "Le format de l'URL de la base de données est incorrect.", + "Invalid connection string__why": "Symboles manquants comme '@' ou '/' dans l'URI.", + "Invalid connection string__fix_0": "Vérifier le format de l'URI DB", + "window is not defined__explanation": "Vous essayez d'utiliser du code navigateur (window) dans Node.js.", + "window is not defined__why": "Node.js n'a pas d'objet 'window' (c'est pour les navigateurs).", + "window is not defined__fix_0": "Vérifier si exécuté dans un navigateur", + "window is not defined__fix_1": "Utiliser 'global' à la place", + "Too many listeners__explanation": "Fuite mémoire détectée dans les EventEmitters.", + "Too many listeners__why": "Ajout d'écouteurs d'événements dans une boucle ou fonction répétée.", + "Too many listeners__fix_0": "Utiliser .once() au lieu de .on()", + "Too many listeners__fix_1": "Supprimer les anciens écouteurs", + "spread non-iterable__explanation": "Vous avez essayé d'utiliser `...obj` là où ce n'est pas autorisé.", + "spread non-iterable__why": "Tentative de décomposition d'un objet dans un tableau.", + "spread non-iterable__fix_0": "Utiliser [] pour les tableaux et {} pour les objets", + "EPIPE__explanation": "Canal rompu : envoi de données vers une connexion fermée.", + "EPIPE__why": "L'autre côté (client/processus) a arrêté d'écouter.", + "EPIPE__fix_0": "Gérer les erreurs de flux", + "EPIPE__fix_1": "Vérifier si le processus est actif", + "Missing initializer__explanation": "Vous avez déclaré une const sans lui donner de valeur.", + "Missing initializer__why": "Une const doit être définie immédiatement lors de sa création.", + "Missing initializer__fix_0": "Assigner une valeur : const x = 1;", + "peerinvalid__explanation": "Les paquets installés ont des versions incompatibles.", + "peerinvalid__why": "Une bibliothèque nécessite la version A, une autre nécessite la version B.", + "peerinvalid__fix_0": "npm install --legacy-peer-deps", + "filter is not a function__explanation": "Vous tentez de filtrer quelque chose qui n'est pas un tableau.", + "filter is not a function__why": "La variable est un objet ou null.", + "filter is not a function__fix_0": "Vérifiez que les données sont un tableau : Array.isArray(data)", + "ENOTFOUND__explanation": "Échec de la recherche DNS pour l'URL.", + "ENOTFOUND__why": "Faute de frappe dans l'URL ou absence de connexion Internet.", + "ENOTFOUND__fix_0": "Vérifiez l'orthographe de l'URL", + "ENOTFOUND__fix_1": "Vérifiez le DNS/Internet", + "reserved word__explanation": "Vous avez utilisé un mot réservé pour JS (comme 'class' ou 'await') comme nom de variable.", + "reserved word__why": "Vous ne pouvez pas nommer une variable 'class' ou 'function'.", + "reserved word__fix_0": "Renommez la variable", + "Cannot find name__explanation": "TypeScript ne trouve pas cette variable ou ce type.", + "Cannot find name__why": "Variable non déclarée ou package @types manquant.", + "Cannot find name__fix_0": "Vérifiez les imports", + "Cannot find name__fix_1": "Installez les types : npm install @types/node", + "convert undefined or null to object__explanation": "Appel de méthodes Object sur une variable vide.", + "convert undefined or null to object__why": "Utilisation de Object.keys(data) lorsque data est null.", + "convert undefined or null to object__fix_0": "Vérifiez que data existe : data && Object.keys(data)", + "Access-Control-Allow-Origin__explanation": "Erreur CORS : le serveur ne partage pas de données avec votre domaine.", + "Access-Control-Allow-Origin__why": "Politique de sécurité côté backend.", + "Access-Control-Allow-Origin__fix_0": "Activez CORS côté serveur", + "Invalid or unexpected token__explanation": "Il y a un caractère dans votre code qui ne devrait pas s'y trouver.", + "Invalid or unexpected token__why": "Copier-coller de symboles masqués ou utilisation de guillemets typographiques (\" au lieu de \").", + "Invalid or unexpected token__fix_0": "Retapez la ligne manuellement", + "Invalid or unexpected token__fix_1": "Vérifiez la présence de symboles invisibles", + "timeout of 2000ms exceeded__explanation": "Votre test a mis trop de temps à se terminer.", + "timeout of 2000ms exceeded__why": "Le code asynchrone n'a pas appelé 'done()' ou ne s'est pas terminé à temps.", + "timeout of 2000ms exceeded__fix_0": "Augmentez le délai d'expiration du test", + "timeout of 2000ms exceeded__fix_1": "Vérifiez les appels d'API lents", + "does not exist on type__explanation": "Erreur TypeScript : Accès à une propriété qui n'existe pas dans l'Interface.", + "does not exist on type__why": "La structure de l'objet ne correspond pas à la définition du Type TS.", + "does not exist on type__fix_0": "Mettez à jour l'Interface", + "does not exist on type__fix_1": "Utilisez une conversion de type : (obj as any).prop", + "npm ERR! 404__explanation": "NPM ne trouve pas le package que vous souhaitez installer.", + "npm ERR! 404__why": "Faute de frappe dans le nom du package ou il s'agit d'un package privé.", + "npm ERR! 404__fix_0": "Vérifiez l'orthographe du package", + "npm ERR! 404__fix_1": "npm login", + "Unexpected end of input__explanation": "Votre code s'est arrêté brusquement, probablement en raison d'un crochet fermant manquant.", + "Unexpected end of input__why": "Vous avez ouvert un ( [ ou { mais vous avez oublié de le fermer avec ) ] ou }.", + "Unexpected end of input__fix_0": "Vérifiez les parenthèses fermantes manquantes )", + "Unexpected end of input__fix_1": "Vérifiez les accolades fermantes manquantes }", + "Unexpected end of input__fix_2": "Assurez-vous que tous les guillemets ' ou \" sont fermés", + "missing ) after argument list__explanation": "Vous avez oublié de fermer un appel de fonction avec une ')'.", + "missing ) after argument list__why": "Une parenthèse a été ouverte mais la ligne s'est terminée ou un autre symbole est apparu avant qu'elle ne soit fermée.", + "missing ) after argument list__fix_0": "Ajoutez une ')' à la fin de votre appel de fonction", + "missing ) after argument list__fix_1": "Vérifiez si vous avez accidentellement supprimé une ')' en tapant" +} \ No newline at end of file diff --git a/locales/hi.json b/locales/hi.json new file mode 100644 index 0000000..1df7498 --- /dev/null +++ b/locales/hi.json @@ -0,0 +1,199 @@ +{ + "Cannot read properties of undefined__explanation": "आप एक वेरिएबल पर प्रॉपर्टी एक्सेस करने की कोशिश कर रहे हैं जो फिलहाल खाली है।", + "Cannot read properties of undefined__why": "वेरिएबल को इनिशियलाइज़ नहीं किया गया था, या API कॉल अभी तक पूरी नहीं हुई है।", + "Cannot read properties of undefined__fix_0": "ऑप्शनल चेनिंग का उपयोग करें: user?.name", + "Cannot read properties of undefined__fix_1": "डिफ़ॉल्ट वैल्यू सेट करें: data || []", + "is not defined__explanation": "आप एक ऐसे वेरिएबल का उपयोग कर रहे हैं जिसे डिक्लेयर नहीं किया गया है।", + "is not defined__why": "नाम में टाइपो है या वेरिएबल किसी दूसरे फ़ंक्शन के अंदर स्कोप्ड है।", + "is not defined__fix_0": "टाइपो की जाँच करें", + "is not defined__fix_1": "const/let से डिक्लेयर करें", + "is not a function__explanation": "आपने एक वेरिएबल को फ़ंक्शन की तरह कॉल किया, लेकिन यह दूसरे प्रकार का है (String/Object)।", + "is not a function__why": "इम्पोर्ट विफल हुआ या कॉलबैक सही तरीके से पास नहीं किया गया।", + "is not a function__fix_0": "इम्पोर्ट की जाँच करें", + "is not a function__fix_1": "typeof से टाइप वेरिफ़ाई करें", + "Cannot find module__explanation": "Node.js आपके द्वारा इम्पोर्ट की जा रही फ़ाइल या पैकेज को नहीं ढूँढ पा रहा है।", + "Cannot find module__why": "पैकेज इंस्टॉल नहीं है या रिलेटिव पाथ गलत है।", + "Cannot find module__fix_0": "'npm install' रन करें", + "Cannot find module__fix_1": "फ़ाइल पाथ की स्पेलिंग जाँचें", + "EADDRINUSE__explanation": "आपका सर्वर जिस पोर्ट का उपयोग करना चाहता है वह पहले से उपयोग में है।", + "EADDRINUSE__why": "आपकी ऐप का दूसरा इंस्टेंस पहले से चल रहा है।", + "EADDRINUSE__fix_0": "दूसरी प्रोसेस को बंद करें", + "EADDRINUSE__fix_1": "पोर्ट नंबर बदलें", + "Maximum call stack size exceeded__explanation": "अत्यधिक रिकर्शन या बहुत गहरी कॉल चेन के कारण कॉल स्टैक की सीमा पार हो गई।", + "Maximum call stack size exceeded__why": "एक रिकर्सिव फ़ंक्शन बेस केस तक पहुँचे बिना खुद को बार-बार कॉल कर रहा है, या फ़ंक्शन कॉल की चेन बहुत गहरी हो गई है।", + "Maximum call stack size exceeded__fix_0": "रिकर्शन एग्ज़िट कंडीशन की जाँच करें", + "Maximum call stack size exceeded__fix_1": "वेरिफ़ाई करें कि रिकर्सिव बेस केस तक पहुँचा जा सकता है", + "Maximum call stack size exceeded__fix_2": "कॉल-चेन की गहराई और स्टैक बनाने वाले लूप की जाँच करें", + "ECONNREFUSED__explanation": "आपकी ऐप ने डेटाबेस/API से कनेक्ट करने की कोशिश की लेकिन अस्वीकार कर दिया गया।", + "ECONNREFUSED__why": "टारगेट सर्वर डाउन है या URL गलत है।", + "ECONNREFUSED__fix_0": "सुनिश्चित करें कि DB चल रहा है", + "ECONNREFUSED__fix_1": "API URL जाँचें", + "Assignment to constant variable__explanation": "आपने 'const' वेरिएबल को बदलने की कोशिश की।", + "Assignment to constant variable__why": "Const वेरिएबल को दोबारा असाइन नहीं किया जा सकता।", + "Assignment to constant variable__fix_0": "'const' की जगह 'let' का उपयोग करें", + "ENOENT__explanation": "आप एक ऐसी फ़ाइल पढ़ने की कोशिश कर रहे हैं जो मौजूद नहीं है।", + "ENOENT__why": "फ़ाइल हटा दी गई या पाथ स्ट्रिंग गलत है।", + "ENOENT__fix_0": "सत्यापित करें कि फ़ाइल मौजूद है", + "ENOENT__fix_1": "path.join() का उपयोग करें", + "await is only valid in async functions__explanation": "आपने एक सामान्य फ़ंक्शन के अंदर 'await' का उपयोग किया।", + "await is only valid in async functions__why": "Await के लिए पैरेंट फ़ंक्शन पर 'async' कीवर्ड की आवश्यकता होती है।", + "await is only valid in async functions__fix_0": "फ़ंक्शन डेफिनिशन में 'async' जोड़ें", + "ERR_HTTP_HEADERS_SENT__explanation": "आपने पहले से एक रिस्पॉन्स भेजने के बाद फिर से रिस्पॉन्स भेजा।", + "ERR_HTTP_HEADERS_SENT__why": "एक राउट में कई res.send() कॉल हैं।", + "ERR_HTTP_HEADERS_SENT__fix_0": "एक्जीक्यूशन रोकने के लिए 'return res.send()' का उपयोग करें", + "buffering timed out__explanation": "Mongoose समय पर MongoDB से कनेक्ट नहीं हो सका।", + "buffering timed out__why": "डेटाबेस ऑफ़लाइन है या कनेक्शन स्ट्रिंग गलत है।", + "buffering timed out__fix_0": "MongoDB स्टेटस जाँचें", + "buffering timed out__fix_1": "कनेक्शन स्ट्रिंग जाँचें", + "jwt malformed__explanation": "प्रदान किया गया टोकन एक वैध JWT स्ट्रक्चर नहीं है।", + "jwt malformed__why": "टोकन करप्ट है या इसका केवल एक हिस्सा भेजा गया था।", + "jwt malformed__fix_0": "'Authorization' हेडर जाँचें", + "jwt malformed__fix_1": "टोकन जेनरेशन सत्यापित करें", + "secretOrPrivateKey must have a value__explanation": "JWT सीक्रेट की गायब है।", + "secretOrPrivateKey must have a value__why": "एनवायरनमेंट वेरिएबल (JWT_SECRET) लोड नहीं हुआ है।", + "secretOrPrivateKey must have a value__fix_0": ".env फाइल जांचें", + "secretOrPrivateKey must have a value__fix_1": "dotenv.config() चलाएं", + "E11000__explanation": "आप 'unique' फील्ड वाला डेटा सेव कर रहे हैं जो पहले से मौजूद है।", + "E11000__why": "आमतौर पर डेटाबेस में डुप्लिकेट ईमेल या यूजरनेम।", + "E11000__fix_0": "सेव करने से पहले डेटा की जांच करें", + "E11000__fix_1": "यूनिक एरर हैंडलिंग का उपयोग करें", + "Unexpected token < in JSON__explanation": "आपने JSON पार्स करने की कोशिश की, लेकिन HTML मिला।", + "Unexpected token < in JSON__why": "आपके API ने डेटा (JSON) की जगह एरर पेज (HTML) रिटर्न किया।", + "Unexpected token < in JSON__fix_0": "API URL जांचें", + "Unexpected token < in JSON__fix_1": "क्रैश के लिए सर्वर लॉग्स देखें", + "CORS__explanation": "ब्राउज़र ने सुरक्षा कारणों से आपका रिक्वेस्ट ब्लॉक कर दिया।", + "CORS__why": "सर्वर आपके फ्रंटएंड डोमेन से रिक्वेस्ट की अनुमति नहीं देता।", + "CORS__fix_0": "सर्वर पर 'cors' पैकेज इंस्टॉल करें", + "CORS__fix_1": "app.use(cors())", + "'map' of undefined__explanation": "आप एक ऐसे ऐरे पर लूप चलाने की कोशिश कर रहे हैं जो मौजूद नहीं है।", + "'map' of undefined__why": "वेरिएबल ऐरे की बजाय null/undefined है।", + "'map' of undefined__fix_0": "खाली ऐरे के रूप में इनिशियलाइज़ करें: data || []", + "'map' of undefined__fix_1": "API रिस्पॉन्स जांचें", + "module not found 'dotenv'__explanation": "'dotenv' पैकेज गायब है।", + "module not found 'dotenv'__why": "आपने इसे कोड में उपयोग किया लेकिन इंस्टॉल नहीं किया।", + "module not found 'dotenv'__fix_0": "npm install dotenv", + "validation failed__explanation": "डेटा आपके Mongoose स्कीमा से मेल नहीं खाता।", + "validation failed__why": "आवश्यक फील्ड गायब हैं या गलत डेटा टाइप हैं।", + "validation failed__fix_0": "आवश्यक फ़ील्ड की जाँच करें", + "validation failed__fix_1": "फ्रंटएंड पर डेटा को मान्य करें", + "not authorized__explanation": "गुम या अमान्य क्रेडेंशियल के कारण एक्सेस अस्वीकृत।", + "not authorized__why": "टोकन समाप्त हो गया या गलत API की।", + "not authorized__fix_0": "फिर से लॉगिन करें", + "not authorized__fix_1": "हेडर की जाँच करें", + "status code 404__explanation": "आप जिस API एंडपॉइंट को कॉल कर रहे हैं वह मौजूद नहीं है।", + "status code 404__why": "गलत URL या सर्वर रूट परिभाषित नहीं है।", + "status code 404__fix_0": "API रूट की स्पेलिंग जाँचें", + "status code 404__fix_1": "बेस URL जाँचें", + "status code 500__explanation": "आपके अनुरोध को प्रोसेस करते समय सर्वर क्रैश हो गया।", + "status code 500__why": "बैकएंड सर्वर कोड में एक बग।", + "status code 500__fix_0": "सर्वर कंसोल लॉग्स की जाँच करें", + "status code 500__fix_1": "सर्वर पर try/catch जोड़ें", + "is not iterable__explanation": "आपने एक गैर-एरे पर for...of लूप या स्प्रेड (...) का उपयोग किया।", + "is not iterable__why": "आपने किसी ऑब्जेक्ट या नल पर इटरेट करने का प्रयास किया।", + "is not iterable__fix_0": "सुनिश्चित करें कि वेरिएबल एक ऐरे है", + "is not iterable__fix_1": "Object.keys() का उपयोग करें", + "require is not defined__explanation": "आप ES मॉड्यूल में 'require' का उपयोग कर रहे हैं।", + "require is not defined__why": "package.json में Node.js 'type': 'module' पर सेट है।", + "require is not defined__fix_0": "इसके बजाय 'import' का उपयोग करें", + "require is not defined__fix_1": "'type: module' हटाएँ", + "EACCES__explanation": "आपके पास इस फ़ाइल/पोर्ट तक पहुँचने की अनुमति नहीं है।", + "EACCES__why": "आपको एडमिन अधिकार चाहिए या फ़ाइल लॉक है।", + "EACCES__fix_0": "'sudo' का उपयोग करें (Linux/Mac)", + "EACCES__fix_1": "फ़ाइल अनुमतियाँ जांचें", + "has already been declared__explanation": "आपने एक ही वेरिएबल नाम दो बार घोषित किया है।", + "has already been declared__why": "एक ही स्कोप में मौजूद नाम पर 'let' या 'const' का उपयोग करना।", + "has already been declared__fix_0": "वेरिएबल में से एक का नाम बदलें", + "has already been declared__fix_1": "दूसरी घोषणा हटाएं", + "PayloadTooLargeError__explanation": "आपके द्वारा भेजा गया डेटा सर्वर के लिए बहुत बड़ा है।", + "PayloadTooLargeError__why": "आमतौर पर कोई इमेज या फ़ाइल जो body-parser की सीमा से अधिक है।", + "PayloadTooLargeError__fix_0": "सीमा बढ़ाएं: app.use(express.json({limit: '50mb'}))", + "set property of null__explanation": "आप एक खाली वेरिएबल की प्रॉपर्टी को वैल्यू देने की कोशिश कर रहे हैं।", + "set property of null__why": "जिस ऑब्जेक्ट को आप संशोधित कर रहे हैं वह अभी तक बनाया नहीं गया है।", + "set property of null__fix_0": "पहले ऑब्जेक्ट को इनिशियलाइज़ करें", + "set property of null__fix_1": "null के लिए जांचें", + "socket hang up__explanation": "सर्वर ने अप्रत्याशित रूप से कनेक्शन बंद कर दिया।", + "socket hang up__why": "सर्वर क्रैश हो गया या टाइमआउट हो गया।", + "socket hang up__fix_0": "सर्वर की सेहत जांचें", + "socket hang up__fix_1": "टाइमआउट सीमा बढ़ाएं", + "Unexpected end of JSON input__explanation": "JSON डेटा अधूरा या खाली है।", + "Unexpected end of JSON input__why": "सर्वर ने JSON के बजाय एक खाली स्ट्रिंग भेजी।", + "Unexpected end of JSON input__fix_0": "API रिस्पॉन्स बॉडी जांचें", + "Unexpected end of JSON input__fix_1": "खाली रिस्पॉन्स को हैंडल करें", + "Script execution timed out__explanation": "आपके कोड को चलने में बहुत अधिक समय लग गया।", + "Script execution timed out__why": "भारी कम्प्यूटेशन या अनंत लूप।", + "Script execution timed out__fix_0": "लॉजिक को ऑप्टिमाइज़ करें", + "Script execution timed out__fix_1": "वर्कर थ्रेड्स का उपयोग करें", + "'then' of undefined__explanation": "आपने किसी ऐसी चीज़ पर .then() कॉल किया जो Promise नहीं है।", + "'then' of undefined__why": "फ़ंक्शन ने प्रॉमिस नहीं लौटाया।", + "'then' of undefined__fix_0": "फ़ंक्शन को 'async' बनाएं", + "'then' of undefined__fix_1": "एक Promise लौटाएं", + "Invalid connection string__explanation": "डेटाबेस URL का फ़ॉर्मेट ग़लत है।", + "Invalid connection string__why": "URI में '@' या '/' जैसे चिह्न गायब हैं।", + "Invalid connection string__fix_0": "DB URI फ़ॉर्मेट जांचें", + "window is not defined__explanation": "आप Node.js में ब्राउज़र कोड (window) का उपयोग करने की कोशिश कर रहे हैं।", + "window is not defined__why": "Node.js में 'window' ऑब्जेक्ट नहीं होता (यह ब्राउज़र के लिए है)।", + "window is not defined__fix_0": "ब्राउज़र में चल रहा है या नहीं जांचें", + "window is not defined__fix_1": "इसके बजाय 'global' का उपयोग करें", + "Too many listeners__explanation": "EventEmitters में मेमोरी लीक पाया गया।", + "Too many listeners__why": "लूप या बार-बार चलने वाले फ़ंक्शन में इवेंट लिसनर जोड़ना।", + "Too many listeners__fix_0": ".on() के बजाय .once() का उपयोग करें", + "Too many listeners__fix_1": "पुराने लिसनर हटाएं", + "spread non-iterable__explanation": "आपने `...obj` का उपयोग वहां किया जहां यह अनुमत नहीं है।", + "spread non-iterable__why": "ऑब्जेक्ट को ऐरे में स्प्रेड करने की कोशिश कर रहे हैं।", + "spread non-iterable__fix_0": "ऐरे के लिए [] और ऑब्जेक्ट के लिए {} का उपयोग करें", + "EPIPE__explanation": "ब्रोकन पाइप: बंद कनेक्शन पर डेटा भेज रहे हैं।", + "EPIPE__why": "दूसरी तरफ (क्लाइंट/प्रोसेस) ने सुनना बंद कर दिया।", + "EPIPE__fix_0": "स्ट्रीम एरर हैंडल करें", + "EPIPE__fix_1": "जांचें कि प्रोसेस चल रहा है या नहीं", + "Missing initializer__explanation": "आपने const घोषित किया लेकिन इसे कोई मान नहीं दिया।", + "Missing initializer__why": "Const को बनाते समय तुरंत सेट करना अनिवार्य है।", + "Missing initializer__fix_0": "एक मान असाइन करें: const x = 1;", + "peerinvalid__explanation": "इंस्टॉल किए गए पैकेज में विरोधाभासी वर्ज़न हैं।", + "peerinvalid__why": "एक लाइब्रेरी को संस्करण A की आवश्यकता है, दूसरी को संस्करण B की।", + "peerinvalid__fix_0": "npm install --legacy-peer-deps", + "filter is not a function__explanation": "आप किसी ऐसी चीज़ को फ़िल्टर करने का प्रयास कर रहे हैं जो Array नहीं है।", + "filter is not a function__why": "वेरिएबल एक Object या Null है।", + "filter is not a function__fix_0": "सुनिश्चित करें कि data एक Array है: Array.isArray(data)", + "ENOTFOUND__explanation": "URL के लिए DNS लुकअप विफल रहा।", + "ENOTFOUND__why": "URL में टाइपो या इंटरनेट कनेक्शन नहीं है।", + "ENOTFOUND__fix_0": "URL की स्पेलिंग जांचें", + "ENOTFOUND__fix_1": "DNS/इंटरनेट जांचें", + "reserved word__explanation": "आपने JS के लिए आरक्षित शब्द (जैसे 'class' या 'await') को वेरिएबल नाम के रूप में उपयोग किया है।", + "reserved word__why": "आप किसी वेरिएबल का नाम 'class' या 'function' नहीं रख सकते।", + "reserved word__fix_0": "वेरिएबल का नाम बदलें", + "Cannot find name__explanation": "TypeScript इस वेरिएबल या टाइप को नहीं खोज सकता।", + "Cannot find name__why": "वेरिएबल घोषित नहीं है या @types पैकेज अनुपलब्ध है।", + "Cannot find name__fix_0": "इम्पोर्ट जांचें", + "Cannot find name__fix_1": "टाइप्स इंस्टॉल करें: npm install @types/node", + "convert undefined or null to object__explanation": "एक खाली वेरिएबल पर Object मेथड्स को कॉल कर रहे हैं।", + "convert undefined or null to object__why": "जब data null हो तो Object.keys(data) का उपयोग करना।", + "convert undefined or null to object__fix_0": "जांचें कि data मौजूद है: data && Object.keys(data)", + "Access-Control-Allow-Origin__explanation": "CORS त्रुटि: सर्वर आपके डोमेन के साथ डेटा साझा नहीं कर रहा है।", + "Access-Control-Allow-Origin__why": "बैकएंड पर सुरक्षा नीति।", + "Access-Control-Allow-Origin__fix_0": "सर्वर साइड पर CORS सक्षम करें", + "Invalid or unexpected token__explanation": "आपके कोड में एक ऐसा कैरेक्टर है जो नहीं होना चाहिए।", + "Invalid or unexpected token__why": "छिपे हुए सिम्बल कॉपी-पेस्ट करना या स्मार्ट कोट्स का उपयोग करना (\" के बजाय \")।", + "Invalid or unexpected token__fix_0": "लाइन को मैन्युअली फिर से टाइप करें", + "Invalid or unexpected token__fix_1": "अदृश्य प्रतीकों की जांच करें", + "timeout of 2000ms exceeded__explanation": "आपके टेस्ट को पूरा होने में बहुत अधिक समय लग गया।", + "timeout of 2000ms exceeded__why": "एसिंक्रोनस कोड ने 'done()' को कॉल नहीं किया या समय पर पूरा नहीं हुआ।", + "timeout of 2000ms exceeded__fix_0": "टेस्ट टाइमआउट बढ़ाएं", + "timeout of 2000ms exceeded__fix_1": "धीमी API कॉल्स की जांच करें", + "does not exist on type__explanation": "TypeScript त्रुटि: ऐसी प्रॉपर्टी को एक्सेस करना जो इंटरफ़ेस में नहीं है।", + "does not exist on type__why": "ऑब्जेक्ट की संरचना TS टाइप परिभाषा से मेल नहीं खाती।", + "does not exist on type__fix_0": "इंटरफ़ेस को अपडेट करें", + "does not exist on type__fix_1": "टाइप कास्टिंग का उपयोग करें: (obj as any).prop", + "npm ERR! 404__explanation": "NPM को वह पैकेज नहीं मिल रहा जिसे आप इंस्टॉल करना चाहते हैं।", + "npm ERR! 404__why": "पैकेज नाम में टाइपो है या यह एक प्राइवेट पैकेज है।", + "npm ERR! 404__fix_0": "पैकेज की स्पेलिंग जांचें", + "npm ERR! 404__fix_1": "npm login", + "Unexpected end of input__explanation": "आपका कोड अचानक रुक गया, संभवतः एक क्लोजिंग ब्रैकेट गायब होने के कारण।", + "Unexpected end of input__why": "आपने ( [ या { खोला लेकिन इसे ) ] या } से बंद करना भूल गए।", + "Unexpected end of input__fix_0": "क्लोजिंग पैरेन्थीसिस ) के लिए जांचें", + "Unexpected end of input__fix_1": "कर्ली ब्रेसेस } के लिए जांचें", + "Unexpected end of input__fix_2": "सुनिश्चित करें कि सभी कोट्स ' या \" बंद हैं", + "missing ) after argument list__explanation": "आप फ़ंक्शन कॉल को ')' से बंद करना भूल गए।", + "missing ) after argument list__why": "एक पैरेन्थीसिस खोला गया था लेकिन इसे बंद होने से पहले लाइन समाप्त हो गई या कोई अन्य प्रतीक आ गया।", + "missing ) after argument list__fix_0": "अपनी फ़ंक्शन कॉल के अंत में ')' जोड़ें", + "missing ) after argument list__fix_1": "जांचें कि क्या आपने टाइप करते समय गलती से ')' डिलीट कर दिया" +} \ No newline at end of file diff --git a/locales/ja.json b/locales/ja.json new file mode 100644 index 0000000..49ec3db --- /dev/null +++ b/locales/ja.json @@ -0,0 +1,199 @@ +{ + "Cannot read properties of undefined__explanation": "現在空である変数のプロパティにアクセスしようとしています。", + "Cannot read properties of undefined__why": "変数が初期化されていないか、API呼び出しがまだ完了していません。", + "Cannot read properties of undefined__fix_0": "オプショナルチェーンを使用: user?.name", + "Cannot read properties of undefined__fix_1": "デフォルト値を設定: data || []", + "is not defined__explanation": "宣言されていない変数を使用しています。", + "is not defined__why": "名前のタイプミス、または変数が別の関数内でスコープされています。", + "is not defined__fix_0": "タイプミスを確認", + "is not defined__fix_1": "const/letで宣言", + "is not a function__explanation": "関数として変数を呼び出しましたが、それは別の型(String/Object)です。", + "is not a function__why": "インポートが失敗したか、コールバックが正しく渡されませんでした。", + "is not a function__fix_0": "インポートを確認", + "is not a function__fix_1": "typeofで型を検証", + "Cannot find module__explanation": "Node.jsがインポートしようとしているファイルまたはパッケージを見つけられません。", + "Cannot find module__why": "パッケージがインストールされていないか、相対パスが間違っています。", + "Cannot find module__fix_0": "'npm install'を実行", + "Cannot find module__fix_1": "ファイルパスのスペルを確認", + "EADDRINUSE__explanation": "サーバーが使用したいポートがすでに使用されています。", + "EADDRINUSE__why": "アプリの別のインスタンスがすでに実行されています。", + "EADDRINUSE__fix_0": "他のプロセスを終了", + "EADDRINUSE__fix_1": "ポート番号を変更", + "Maximum call stack size exceeded__explanation": "過度な再帰または非常に深い呼び出しチェーンにより、コールスタックの制限に達しました。", + "Maximum call stack size exceeded__why": "再帰関数が基底ケースに到達せずに何度も自分自身を呼び出しているか、関数呼び出しのチェーンが深く積み上がっています。", + "Maximum call stack size exceeded__fix_0": "再帰の終了条件を確認", + "Maximum call stack size exceeded__fix_1": "再帰の基底ケースに到達可能か検証", + "Maximum call stack size exceeded__fix_2": "呼び出しチェーンの深さとスタック構築ループを確認", + "ECONNREFUSED__explanation": "アプリがデータベース/APIへの接続を試みましたが、拒否されました。", + "ECONNREFUSED__why": "対象サーバーがダウンしているか、URLが間違っています。", + "ECONNREFUSED__fix_0": "DBが実行中であることを確認", + "ECONNREFUSED__fix_1": "API URLを確認", + "Assignment to constant variable__explanation": "'const'変数を変更しようとしました。", + "Assignment to constant variable__why": "const変数は再代入できません。", + "Assignment to constant variable__fix_0": "'const'の代わりに'let'を使用", + "ENOENT__explanation": "存在しないファイルを読み込もうとしています。", + "ENOENT__why": "ファイルが移動されたか、パス文字列が間違っています。", + "ENOENT__fix_0": "ファイルが存在することを確認", + "ENOENT__fix_1": "path.join()を使用", + "await is only valid in async functions__explanation": "通常の関数内で'await'を使用しました。", + "await is only valid in async functions__why": "awaitは親関数に'async'キーワードが必要です。", + "await is only valid in async functions__fix_0": "関数定義に'async'を追加", + "ERR_HTTP_HEADERS_SENT__explanation": "すでにレスポンスを送信した後に、再度レスポンスを送信しました。", + "ERR_HTTP_HEADERS_SENT__why": "1つのルート内で複数回res.send()を呼び出しています。", + "ERR_HTTP_HEADERS_SENT__fix_0": "実行を停止するために'return res.send()'を使用", + "buffering timed out__explanation": "MongooseがMongoDBに時間内に接続できませんでした。", + "buffering timed out__why": "データベースがオフラインか、接続文字列が間違っています。", + "buffering timed out__fix_0": "MongoDBのステータスを確認", + "buffering timed out__fix_1": "接続文字列を確認", + "jwt malformed__explanation": "提供されたトークンは有効なJWT構造ではありません。", + "jwt malformed__why": "トークンが破損しているか、一部のみが送信されました。", + "jwt malformed__fix_0": "'Authorization'ヘッダーを確認", + "jwt malformed__fix_1": "トークン生成を検証", + "secretOrPrivateKey must have a value__explanation": "JWTシークレットキーが設定されていません。", + "secretOrPrivateKey must have a value__why": "環境変数(JWT_SECRET)が読み込まれていません。", + "secretOrPrivateKey must have a value__fix_0": ".envファイルを確認する", + "secretOrPrivateKey must have a value__fix_1": "dotenv.config()を実行する", + "E11000__explanation": "すでに存在する「一意」フィールドを持つデータを保存しようとしています。", + "E11000__why": "通常、データベース内にメールアドレスまたはユーザー名が重複しています。", + "E11000__fix_0": "保存前にデータが存在するか確認する", + "E11000__fix_1": "一意性エラーの処理を実装する", + "Unexpected token < in JSON__explanation": "JSONをパースしようとしましたが、代わりにHTMLを受け取りました。", + "Unexpected token < in JSON__why": "APIがデータ(JSON)の代わりにエラーページ(HTML)を返しました。", + "Unexpected token < in JSON__fix_0": "APIのURLを確認する", + "Unexpected token < in JSON__fix_1": "サーバーログでクラッシュを確認する", + "CORS__explanation": "ブラウザがセキュリティ上の理由でリクエストをブロックしました。", + "CORS__why": "サーバーがフロントエンドのドメインからのリクエストを許可していません。", + "CORS__fix_0": "サーバーに'cors'パッケージをインストールする", + "CORS__fix_1": "app.use(cors())を実行する", + "'map' of undefined__explanation": "存在しない配列をループしようとしています。", + "'map' of undefined__why": "変数が配列ではなくnull/undefinedになっています。", + "'map' of undefined__fix_0": "空配列で初期化する: data || []", + "'map' of undefined__fix_1": "APIレスポンスを確認する", + "module not found 'dotenv'__explanation": "'dotenv'パッケージが見つかりません。", + "module not found 'dotenv'__why": "コード内で使用していますが、インストールされていません。", + "module not found 'dotenv'__fix_0": "npm install dotenvを実行する", + "validation failed__explanation": "データがMongooseスキーマと一致しません。", + "validation failed__why": "必須フィールドが不足しているか、データ型が間違っています。", + "validation failed__fix_0": "必須フィールドを確認してください", + "validation failed__fix_1": "フロントエンドでデータを検証してください", + "not authorized__explanation": "認証情報が欠落しているか無効なため、アクセスが拒否されました。", + "not authorized__why": "トークンの有効期限が切れているか、APIキーが間違っています。", + "not authorized__fix_0": "再度ログインしてください", + "not authorized__fix_1": "ヘッダーを確認してください", + "status code 404__explanation": "呼び出そうとしているAPIエンドポイントが存在しません。", + "status code 404__why": "URLが間違っているか、サーバールートが定義されていません。", + "status code 404__fix_0": "APIルートのスペルを確認してください", + "status code 404__fix_1": "ベースURLを確認してください", + "status code 500__explanation": "リクエストの処理中にサーバーがクラッシュしました。", + "status code 500__why": "バックエンドサーバーコードにバグがあります。", + "status code 500__fix_0": "サーバーコンソールログを確認してください", + "status code 500__fix_1": "サーバーにtry/catchを追加してください", + "is not iterable__explanation": "配列ではないものに対してfor...ofループまたはスプレッド演算子(...)を使用しました。", + "is not iterable__why": "ObjectまたはNullに対して反復処理を試みました。", + "is not iterable__fix_0": "変数が配列であることを確認してください", + "is not iterable__fix_1": "Object.keys()を使用してください", + "require is not defined__explanation": "ESモジュールで'require'を使用しています。", + "require is not defined__why": "package.jsonで'type': 'module'に設定されています。", + "require is not defined__fix_0": "代わりに'import'を使用してください", + "require is not defined__fix_1": "'type: module'を削除してください", + "EACCES__explanation": "このファイル/ポートにアクセスする権限がありません。", + "EACCES__why": "管理者権限が必要か、ファイルがロックされています。", + "EACCES__fix_0": "'sudo'を使用してください(Linux/Mac)", + "EACCES__fix_1": "ファイルのアクセス権限を確認してください", + "has already been declared__explanation": "同じ変数名を2回宣言しています。", + "has already been declared__why": "同じスコープ内に存在する名前に対して'let'または'const'を使用しています。", + "has already been declared__fix_0": "変数のいずれかを別の名前に変更してください", + "has already been declared__fix_1": "2番目の宣言を削除してください", + "PayloadTooLargeError__explanation": "送信したデータがサーバーの許容サイズを超えています。", + "PayloadTooLargeError__why": "通常、body-parserの制限を超える画像やファイルが原因です。", + "PayloadTooLargeError__fix_0": "制限を増やす: app.use(express.json({limit: '50mb'}))", + "set property of null__explanation": "空の変数のプロパティに値を設定しようとしています。", + "set property of null__why": "変更しようとしているオブジェクトがまだ作成されていません。", + "set property of null__fix_0": "最初にオブジェクトを初期化してください", + "set property of null__fix_1": "nullかどうかを確認してください", + "socket hang up__explanation": "サーバーが予期せず接続を切断しました。", + "socket hang up__why": "サーバーがクラッシュしたか、タイムアウトが発生しました。", + "socket hang up__fix_0": "サーバーの状態を確認してください", + "socket hang up__fix_1": "タイムアウト制限を増やしてください", + "Unexpected end of JSON input__explanation": "JSONデータが不完全または空です。", + "Unexpected end of JSON input__why": "サーバーがJSONの代わりに空文字列を送信しました。", + "Unexpected end of JSON input__fix_0": "APIレスポンスのボディを確認してください", + "Unexpected end of JSON input__fix_1": "空のレスポンスを処理してください", + "Script execution timed out__explanation": "コードの実行時間が長すぎました。", + "Script execution timed out__why": "重い計算処理または無限ループが原因です。", + "Script execution timed out__fix_0": "ロジックを最適化してください", + "Script execution timed out__fix_1": "ワーカースレッドを使用してください", + "'then' of undefined__explanation": "Promiseではないものに対して.then()を呼び出しています。", + "'then' of undefined__why": "関数がプロミスを返していません。", + "'then' of undefined__fix_0": "関数を'async'にする", + "'then' of undefined__fix_1": "Promiseを返す", + "Invalid connection string__explanation": "データベースURLの形式が間違っています。", + "Invalid connection string__why": "URIに'@'や'/'などの記号が不足しています。", + "Invalid connection string__fix_0": "DB URIの形式を確認", + "window is not defined__explanation": "Node.jsでブラウザのコード(window)を使用しようとしています。", + "window is not defined__why": "Node.jsには'window'オブジェクトがありません(これはブラウザ用です)。", + "window is not defined__fix_0": "ブラウザで実行されているか確認", + "window is not defined__fix_1": "代わりに'global'を使用", + "Too many listeners__explanation": "EventEmittersでメモリリークが検出されました。", + "Too many listeners__why": "ループや繰り返し実行される関数内でイベントリスナーを追加しています。", + "Too many listeners__fix_0": ".on()の代わりに.once()を使用", + "Too many listeners__fix_1": "古いリスナーを削除", + "spread non-iterable__explanation": "許可されていない場所で`...obj`を使用しようとしました。", + "spread non-iterable__why": "オブジェクトを配列にスプレッドしようとしています。", + "spread non-iterable__fix_0": "配列には[]、オブジェクトには{}を使用", + "EPIPE__explanation": "パイプ破損:閉じられた接続にデータを送信しています。", + "EPIPE__why": "相手側(クライアント/プロセス)が受信を停止しました。", + "EPIPE__fix_0": "ストリームエラーを処理", + "EPIPE__fix_1": "プロセスが生きているか確認", + "Missing initializer__explanation": "値を与えずにconstを宣言しました。", + "Missing initializer__why": "Constは作成時に即座に設定する必要があります。", + "Missing initializer__fix_0": "値を割り当てる: const x = 1;", + "peerinvalid__explanation": "インストールされたパッケージのバージョンが競合しています。", + "peerinvalid__why": "一つのライブラリがバージョンAを必要とし、別のライブラリがバージョンBを必要としています。", + "peerinvalid__fix_0": "npm install --legacy-peer-deps", + "filter is not a function__explanation": "配列ではないものに対してフィルタ処理を実行しようとしています。", + "filter is not a function__why": "変数がオブジェクトまたはNullです。", + "filter is not a function__fix_0": "データが配列であることを確認: Array.isArray(data)", + "ENOTFOUND__explanation": "URLのDNSルックアップに失敗しました。", + "ENOTFOUND__why": "URLのタイプミスまたはインターネット接続がありません。", + "ENOTFOUND__fix_0": "URLのスペルを確認", + "ENOTFOUND__fix_1": "DNS/インターネット接続を確認", + "reserved word__explanation": "JavaScriptの予約語('class'や'await'など)を変数名として使用しています。", + "reserved word__why": "変数名に'class'や'function'を使用することはできません。", + "reserved word__fix_0": "変数名を変更", + "Cannot find name__explanation": "TypeScriptがこの変数または型を見つけることができません。", + "Cannot find name__why": "変数が宣言されていないか、@typesパッケージが不足しています。", + "Cannot find name__fix_0": "インポートを確認", + "Cannot find name__fix_1": "型をインストール: npm install @types/node", + "convert undefined or null to object__explanation": "空の変数に対してObjectメソッドを呼び出しています。", + "convert undefined or null to object__why": "dataがnullの時にObject.keys(data)を使用しています。", + "convert undefined or null to object__fix_0": "データが存在するか確認: data && Object.keys(data)", + "Access-Control-Allow-Origin__explanation": "CORSエラー: サーバーがあなたのドメインとデータを共有していません。", + "Access-Control-Allow-Origin__why": "バックエンドのセキュリティポリシーによるものです。", + "Access-Control-Allow-Origin__fix_0": "サーバー側でCORSを有効化", + "Invalid or unexpected token__explanation": "コード内に存在すべきでない文字があります。", + "Invalid or unexpected token__why": "非表示の記号をコピー&ペーストしたか、スマート引用符(\"の代わりに\")を使用しています。", + "Invalid or unexpected token__fix_0": "その行を手動で再入力", + "Invalid or unexpected token__fix_1": "非表示文字がないか確認してください", + "timeout of 2000ms exceeded__explanation": "テストの完了に時間がかかりすぎました。", + "timeout of 2000ms exceeded__why": "非同期コードが 'done()' を呼び出さなかったか、時間内に完了しませんでした。", + "timeout of 2000ms exceeded__fix_0": "テストのタイムアウト時間を延長する", + "timeout of 2000ms exceeded__fix_1": "遅いAPI呼び出しがないか確認してください", + "does not exist on type__explanation": "TypeScriptエラー: インターフェースに存在しないプロパティにアクセスしています。", + "does not exist on type__why": "オブジェクトの構造がTypeScriptの型定義と一致していません。", + "does not exist on type__fix_0": "インターフェースを更新する", + "does not exist on type__fix_1": "型キャストを使用: (obj as any).prop", + "npm ERR! 404__explanation": "NPMがインストールしようとしているパッケージを見つけられません。", + "npm ERR! 404__why": "パッケージ名のタイプミスまたはプライベートパッケージです。", + "npm ERR! 404__fix_0": "パッケージ名のスペルを確認してください", + "npm ERR! 404__fix_1": "npm login", + "Unexpected end of input__explanation": "コードが突然終了しました。閉じ括弧が不足している可能性があります。", + "Unexpected end of input__why": "( [ または { を開いたのに、) ] または } で閉じるのを忘れました。", + "Unexpected end of input__fix_0": "閉じ丸括弧 ) が不足していないか確認してください", + "Unexpected end of input__fix_1": "閉じ波括弧 } が不足していないか確認してください", + "Unexpected end of input__fix_2": "すべての引用符 ' または \" が閉じられているか確認してください", + "missing ) after argument list__explanation": "関数呼び出しを ')' で閉じるのを忘れました。", + "missing ) after argument list__why": "括弧が開かれたまま、行が終了したか別の記号が現れました。", + "missing ) after argument list__fix_0": "関数呼び出しの最後に ')' を追加してください", + "missing ) after argument list__fix_1": "入力中に誤って ')' を削除していないか確認してください" +} \ No newline at end of file diff --git a/locales/pt.json b/locales/pt.json new file mode 100644 index 0000000..6e4801d --- /dev/null +++ b/locales/pt.json @@ -0,0 +1,199 @@ +{ + "Cannot read properties of undefined__explanation": "Você está tentando acessar uma propriedade de uma variável que está atualmente vazia.", + "Cannot read properties of undefined__why": "A variável não foi inicializada ou uma chamada de API ainda não foi concluída.", + "Cannot read properties of undefined__fix_0": "Use encadeamento opcional: user?.name", + "Cannot read properties of undefined__fix_1": "Defina um valor padrão: data || []", + "is not defined__explanation": "Você está usando uma variável que não foi declarada.", + "is not defined__why": "Erro de digitação no nome ou a variável está no escopo de outra função.", + "is not defined__fix_0": "Verifique erros de digitação", + "is not defined__fix_1": "Declare com const/let", + "is not a function__explanation": "Você chamou uma variável como função, mas ela é de outro tipo (String/Object).", + "is not a function__why": "A importação falhou ou um callback não foi passado corretamente.", + "is not a function__fix_0": "Verifique as importações", + "is not a function__fix_1": "Verifique o tipo com typeof", + "Cannot find module__explanation": "O Node.js não consegue encontrar o arquivo ou pacote que você está importando.", + "Cannot find module__why": "O pacote não está instalado ou o caminho relativo está incorreto.", + "Cannot find module__fix_0": "Execute 'npm install'", + "Cannot find module__fix_1": "Verifique a ortografia do caminho do arquivo", + "EADDRINUSE__explanation": "A porta que o seu servidor deseja usar já está sendo utilizada.", + "EADDRINUSE__why": "Outra instância da sua aplicação já está em execução.", + "EADDRINUSE__fix_0": "Encerre o outro processo", + "EADDRINUSE__fix_1": "Altere o número da porta", + "Maximum call stack size exceeded__explanation": "O limite da pilha de chamadas foi atingido devido a recursão excessiva ou uma cadeia de chamadas muito profunda.", + "Maximum call stack size exceeded__why": "Uma função recursiva está se chamando muitas vezes sem atingir um caso base, ou uma cadeia de chamadas de função se acumula de forma muito profunda.", + "Maximum call stack size exceeded__fix_0": "Verifique as condições de saída da recursão", + "Maximum call stack size exceeded__fix_1": "Verifique se os casos base recursivos são alcançáveis", + "Maximum call stack size exceeded__fix_2": "Verifique a profundidade da cadeia de chamadas e loops de construção de pilha", + "ECONNREFUSED__explanation": "Sua aplicação tentou se conectar a um banco de dados/API mas foi rejeitada.", + "ECONNREFUSED__why": "O servidor de destino está fora do ar ou a URL está incorreta.", + "ECONNREFUSED__fix_0": "Certifique-se de que o BD está em execução", + "ECONNREFUSED__fix_1": "Verifique a URL da API", + "Assignment to constant variable__explanation": "Você tentou alterar uma variável 'const'.", + "Assignment to constant variable__why": "Variáveis const não podem ser reatribuídas.", + "Assignment to constant variable__fix_0": "Use 'let' em vez de 'const'", + "ENOENT__explanation": "Você está tentando ler um arquivo que não existe.", + "ENOENT__why": "O arquivo foi movido ou a string do caminho está incorreta.", + "ENOENT__fix_0": "Verifique se o arquivo existe", + "ENOENT__fix_1": "Use path.join()", + "await is only valid in async functions__explanation": "Você usou 'await' dentro de uma função normal.", + "await is only valid in async functions__why": "Await requer a palavra-chave 'async' na função pai.", + "await is only valid in async functions__fix_0": "Adicione 'async' à definição da função", + "ERR_HTTP_HEADERS_SENT__explanation": "Você enviou uma resposta depois de já ter enviado uma.", + "ERR_HTTP_HEADERS_SENT__why": "Múltiplas chamadas res.send() em uma única rota.", + "ERR_HTTP_HEADERS_SENT__fix_0": "Use 'return res.send()' para interromper a execução", + "buffering timed out__explanation": "O Mongoose não conseguiu se conectar ao MongoDB a tempo.", + "buffering timed out__why": "O banco de dados está offline ou a string de conexão está incorreta.", + "buffering timed out__fix_0": "Verifique o status do MongoDB", + "buffering timed out__fix_1": "Verifique a string de conexão", + "jwt malformed__explanation": "O token fornecido não possui uma estrutura JWT válida.", + "jwt malformed__why": "O token está corrompido ou apenas parte dele foi enviada.", + "jwt malformed__fix_0": "Verifique o cabeçalho 'Authorization'", + "jwt malformed__fix_1": "Verifique a geração do token", + "secretOrPrivateKey must have a value__explanation": "A chave secreta JWT está ausente.", + "secretOrPrivateKey must have a value__why": "A variável de ambiente (JWT_SECRET) não está carregada.", + "secretOrPrivateKey must have a value__fix_0": "Verifique o arquivo .env", + "secretOrPrivateKey must have a value__fix_1": "Execute dotenv.config()", + "E11000__explanation": "Você está salvando dados com um campo 'unique' que já existe.", + "E11000__why": "Geralmente um Email ou Nome de Usuário duplicado no banco de dados.", + "E11000__fix_0": "Verifique se os dados existem antes de salvar", + "E11000__fix_1": "Use tratamento de erro para unicidade", + "Unexpected token < in JSON__explanation": "Você tentou analisar JSON, mas recebeu HTML.", + "Unexpected token < in JSON__why": "Sua API retornou uma página de erro (HTML) em vez de dados (JSON).", + "Unexpected token < in JSON__fix_0": "Verifique a URL da API", + "Unexpected token < in JSON__fix_1": "Verifique os logs do servidor para falhas", + "CORS__explanation": "O navegador bloqueou sua solicitação por motivos de segurança.", + "CORS__why": "O servidor não permite solicitações do domínio do seu frontend.", + "CORS__fix_0": "Instale o pacote 'cors' no servidor", + "CORS__fix_1": "app.use(cors())", + "'map' of undefined__explanation": "Você está tentando iterar por um array que não existe.", + "'map' of undefined__why": "A variável é null/undefined em vez de um Array.", + "'map' of undefined__fix_0": "Inicialize como array vazio: data || []", + "'map' of undefined__fix_1": "Verifique a resposta da API", + "module not found 'dotenv'__explanation": "O pacote 'dotenv' está ausente.", + "module not found 'dotenv'__why": "Você o usou no código, mas não o instalou.", + "module not found 'dotenv'__fix_0": "npm install dotenv", + "validation failed__explanation": "Os dados não correspondem ao seu esquema Mongoose.", + "validation failed__why": "Campos obrigatórios ausentes ou tipos de dados incorretos.", + "validation failed__fix_0": "Verifique os campos obrigatórios", + "validation failed__fix_1": "Valide os dados no frontend", + "not authorized__explanation": "Acesso negado devido a credenciais ausentes ou inválidas.", + "not authorized__why": "Token expirado ou chave de API incorreta.", + "not authorized__fix_0": "Faça login novamente", + "not authorized__fix_1": "Verifique os cabeçalhos", + "status code 404__explanation": "O endpoint da API que você está chamando não existe.", + "status code 404__why": "URL incorreta ou a rota do servidor não está definida.", + "status code 404__fix_0": "Verifique a ortografia da rota da API", + "status code 404__fix_1": "Verifique a URL base", + "status code 500__explanation": "O servidor falhou ao processar sua solicitação.", + "status code 500__why": "Um erro no código do servidor backend.", + "status code 500__fix_0": "Verifique os logs do console do servidor", + "status code 500__fix_1": "Adicione try/catch no servidor", + "is not iterable__explanation": "Você usou um loop for...of ou spread (...) em algo que não é um array.", + "is not iterable__why": "Você tentou iterar sobre um Object ou Null.", + "is not iterable__fix_0": "Certifique-se de que a variável é um Array", + "is not iterable__fix_1": "Use Object.keys()", + "require is not defined__explanation": "Você está usando 'require' em um Módulo ES.", + "require is not defined__why": "O Node.js está configurado com 'type': 'module' no package.json.", + "require is not defined__fix_0": "Use 'import' em vez disso", + "require is not defined__fix_1": "Remova 'type: module'", + "EACCES__explanation": "Você não tem permissão para acessar este arquivo/porta.", + "EACCES__why": "Você precisa de direitos de administrador ou o arquivo está bloqueado.", + "EACCES__fix_0": "Use 'sudo' (Linux/Mac)", + "EACCES__fix_1": "Verifique as permissões do arquivo", + "has already been declared__explanation": "Você declarou o mesmo nome de variável duas vezes.", + "has already been declared__why": "Usar 'let' ou 'const' num nome que já existe no mesmo escopo.", + "has already been declared__fix_0": "Renomeie uma das variáveis", + "has already been declared__fix_1": "Remova a segunda declaração", + "PayloadTooLargeError__explanation": "Os dados que você enviou são grandes demais para o servidor.", + "PayloadTooLargeError__why": "Geralmente uma imagem ou arquivo que excede o limite do body-parser.", + "PayloadTooLargeError__fix_0": "Aumente o limite: app.use(express.json({limit: '50mb'}))", + "set property of null__explanation": "Você está tentando atribuir um valor a uma propriedade de uma variável vazia.", + "set property of null__why": "O objeto que você está modificando ainda não foi criado.", + "set property of null__fix_0": "Inicialize o objeto primeiro", + "set property of null__fix_1": "Verifique se não é null", + "socket hang up__explanation": "O servidor fechou a conexão inesperadamente.", + "socket hang up__why": "O servidor travou ou ocorreu um timeout.", + "socket hang up__fix_0": "Verifique a saúde do servidor", + "socket hang up__fix_1": "Aumente o limite de timeout", + "Unexpected end of JSON input__explanation": "Os dados JSON estão incompletos ou vazios.", + "Unexpected end of JSON input__why": "O servidor enviou uma string vazia em vez de JSON.", + "Unexpected end of JSON input__fix_0": "Verifique o corpo da resposta da API", + "Unexpected end of JSON input__fix_1": "Trate respostas vazias", + "Script execution timed out__explanation": "Seu código demorou muito para executar.", + "Script execution timed out__why": "Computação pesada ou loop infinito.", + "Script execution timed out__fix_0": "Otimize a lógica", + "Script execution timed out__fix_1": "Use worker threads", + "'then' of undefined__explanation": "Você chamou .then() em algo que não é uma Promise.", + "'then' of undefined__why": "A função não retornou uma promise.", + "'then' of undefined__fix_0": "Tornar a função 'async'", + "'then' of undefined__fix_1": "Retornar uma Promise", + "Invalid connection string__explanation": "O formato da URL do banco de dados está incorreto.", + "Invalid connection string__why": "Faltam símbolos como '@' ou '/' no URI.", + "Invalid connection string__fix_0": "Verificar o formato do URI do BD", + "window is not defined__explanation": "Você está tentando usar código de navegador (window) no Node.js.", + "window is not defined__why": "Node.js não possui um objeto 'window' (isso é para navegadores).", + "window is not defined__fix_0": "Verificar se está executando no navegador", + "window is not defined__fix_1": "Usar 'global' em vez disso", + "Too many listeners__explanation": "Vazamento de memória detectado em EventEmitters.", + "Too many listeners__why": "Adicionando event listeners dentro de um loop ou função repetida.", + "Too many listeners__fix_0": "Usar .once() em vez de .on()", + "Too many listeners__fix_1": "Remover listeners antigos", + "spread non-iterable__explanation": "Você tentou usar `...obj` onde não é permitido.", + "spread non-iterable__why": "Tentando fazer spread de um objeto em um array.", + "spread non-iterable__fix_0": "Usar colchetes [] para arrays e {} para objetos", + "EPIPE__explanation": "Pipe quebrado: enviando dados para uma conexão fechada.", + "EPIPE__why": "O outro lado (cliente/processo) parou de escutar.", + "EPIPE__fix_0": "Tratar erros de stream", + "EPIPE__fix_1": "Verificar se o processo está ativo", + "Missing initializer__explanation": "Você declarou uma const sem atribuir um valor.", + "Missing initializer__why": "Const deve ser definida imediatamente quando criada.", + "Missing initializer__fix_0": "Atribuir um valor: const x = 1;", + "peerinvalid__explanation": "Os pacotes instalados têm versões conflitantes.", + "peerinvalid__why": "Uma biblioteca precisa da versão A, outra precisa da versão B.", + "peerinvalid__fix_0": "npm install --legacy-peer-deps", + "filter is not a function__explanation": "Você está tentando filtrar algo que não é um array.", + "filter is not a function__why": "A variável é um objeto ou Null.", + "filter is not a function__fix_0": "Garanta que data é um Array: Array.isArray(data)", + "ENOTFOUND__explanation": "Falha na busca DNS para a URL.", + "ENOTFOUND__why": "Erro de digitação na URL ou sem conexão com a internet.", + "ENOTFOUND__fix_0": "Verifique a grafia da URL", + "ENOTFOUND__fix_1": "Verifique o DNS/Internet", + "reserved word__explanation": "Você usou uma palavra reservada do JS (como 'class' ou 'await') como nome de variável.", + "reserved word__why": "Não é permitido usar nomes como 'class' ou 'function' para variáveis.", + "reserved word__fix_0": "Renomeie a variável", + "Cannot find name__explanation": "O TypeScript não consegue encontrar essa variável ou tipo.", + "Cannot find name__why": "Variável não declarada ou falta o pacote @types.", + "Cannot find name__fix_0": "Verifique os imports", + "Cannot find name__fix_1": "Instale os tipos: npm install @types/node", + "convert undefined or null to object__explanation": "Chamando métodos de Object em uma variável vazia.", + "convert undefined or null to object__why": "Usando Object.keys(data) quando data é null.", + "convert undefined or null to object__fix_0": "Verifique se data existe: data && Object.keys(data)", + "Access-Control-Allow-Origin__explanation": "Erro de CORS: o servidor não está compartilhando dados com seu domínio.", + "Access-Control-Allow-Origin__why": "Política de segurança no backend.", + "Access-Control-Allow-Origin__fix_0": "Habilite o CORS no servidor", + "Invalid or unexpected token__explanation": "Há um caractere no seu código que não deveria estar lá.", + "Invalid or unexpected token__why": "Copiar e colar símbolos ocultos ou usar aspas inteligentes (” em vez de \").", + "Invalid or unexpected token__fix_0": "Digite manualmente a linha novamente", + "Invalid or unexpected token__fix_1": "Verifique se há símbolos invisíveis", + "timeout of 2000ms exceeded__explanation": "O seu teste demorou muito tempo a terminar.", + "timeout of 2000ms exceeded__why": "O código assíncrono não chamou 'done()' ou não terminou a tempo.", + "timeout of 2000ms exceeded__fix_0": "Aumente o tempo limite do teste", + "timeout of 2000ms exceeded__fix_1": "Verifique se há chamadas API lentas", + "does not exist on type__explanation": "Erro TypeScript: Acesso a uma propriedade que não existe na Interface.", + "does not exist on type__why": "A estrutura do objeto não corresponde à definição de Tipo do TS.", + "does not exist on type__fix_0": "Atualize a Interface", + "does not exist on type__fix_1": "Use conversão de tipo: (obj as any).prop", + "npm ERR! 404__explanation": "O NPM não consegue encontrar o pacote que pretende instalar.", + "npm ERR! 404__why": "Erro de digitação no nome do pacote ou é um pacote privado.", + "npm ERR! 404__fix_0": "Verifique a ortografia do pacote", + "npm ERR! 404__fix_1": "npm login", + "Unexpected end of input__explanation": "O seu código terminou abruptamente, provavelmente devido a um parêntese de fecho em falta.", + "Unexpected end of input__why": "Abriu um ( [ ou { mas esqueceu-se de o fechar com ) ] ou }.", + "Unexpected end of input__fix_0": "Verifique se faltam parênteses de fecho )", + "Unexpected end of input__fix_1": "Verifique se faltam chavetas }", + "Unexpected end of input__fix_2": "Certifique-se de que todas as aspas ' ou \" estão fechadas", + "missing ) after argument list__explanation": "Esqueceu-se de fechar uma chamada de função com ')'.", + "missing ) after argument list__why": "Um parêntese foi aberto mas a linha terminou ou outro símbolo apareceu antes de ser fechado.", + "missing ) after argument list__fix_0": "Adicione um ')' no final da sua chamada de função", + "missing ) after argument list__fix_1": "Verifique se apagou acidentalmente um ')' enquanto digitava" +} \ No newline at end of file diff --git a/locales/zh.json b/locales/zh.json new file mode 100644 index 0000000..9b187c3 --- /dev/null +++ b/locales/zh.json @@ -0,0 +1,199 @@ +{ + "Cannot read properties of undefined__explanation": "您正在尝试访问一个当前为空的变量的属性。", + "Cannot read properties of undefined__why": "该变量未被初始化,或者 API 调用尚未完成。", + "Cannot read properties of undefined__fix_0": "使用可选链:user?.name", + "Cannot read properties of undefined__fix_1": "设置默认值:data || []", + "is not defined__explanation": "您正在使用一个尚未声明的变量。", + "is not defined__why": "名称拼写错误,或该变量的作用域在另一个函数内部。", + "is not defined__fix_0": "检查拼写错误", + "is not defined__fix_1": "使用 const/let 声明变量", + "is not a function__explanation": "您将一个变量作为函数调用,但它是其他类型(字符串/对象)。", + "is not a function__why": "导入失败或回调函数未正确传递。", + "is not a function__fix_0": "检查导入语句", + "is not a function__fix_1": "使用 typeof 验证类型", + "Cannot find module__explanation": "Node.js 无法找到您正在导入的文件或包。", + "Cannot find module__why": "包未安装或相对路径错误。", + "Cannot find module__fix_0": "运行 'npm install'", + "Cannot find module__fix_1": "检查文件路径拼写", + "EADDRINUSE__explanation": "您的服务器想要使用的端口已被占用。", + "EADDRINUSE__why": "您的应用程序的另一个实例已在运行。", + "EADDRINUSE__fix_0": "终止其他进程", + "EADDRINUSE__fix_1": "更改端口号", + "Maximum call stack size exceeded__explanation": "由于过度递归或非常深的调用链,已达到调用栈限制。", + "Maximum call stack size exceeded__why": "递归函数在未达到基本情况的情况下多次调用自身,或函数调用链累积过深。", + "Maximum call stack size exceeded__fix_0": "检查递归退出条件", + "Maximum call stack size exceeded__fix_1": "验证递归基本情况是否可达", + "Maximum call stack size exceeded__fix_2": "检查调用链深度和栈累积循环", + "ECONNREFUSED__explanation": "您的应用尝试连接到数据库/API 但被拒绝。", + "ECONNREFUSED__why": "目标服务器已关闭或 URL 错误。", + "ECONNREFUSED__fix_0": "确保数据库正在运行", + "ECONNREFUSED__fix_1": "检查 API URL", + "Assignment to constant variable__explanation": "您尝试修改一个 'const' 变量。", + "Assignment to constant variable__why": "常量变量无法被重新赋值。", + "Assignment to constant variable__fix_0": "使用 'let' 而非 'const'", + "ENOENT__explanation": "您正在尝试读取一个不存在的文件。", + "ENOENT__why": "文件已移动或路径字符串不正确。", + "ENOENT__fix_0": "验证文件是否存在", + "ENOENT__fix_1": "使用 path.join()", + "await is only valid in async functions__explanation": "您在普通函数内使用了 'await'。", + "await is only valid in async functions__why": "Await 需要在父函数上使用 'async' 关键字。", + "await is only valid in async functions__fix_0": "在函数定义中添加 'async'", + "ERR_HTTP_HEADERS_SENT__explanation": "您在已发送响应后又发送了一次响应。", + "ERR_HTTP_HEADERS_SENT__why": "在一个路由中多次调用 res.send()。", + "ERR_HTTP_HEADERS_SENT__fix_0": "使用 'return res.send()' 停止执行", + "buffering timed out__explanation": "Mongoose 无法在规定时间内连接到 MongoDB。", + "buffering timed out__why": "数据库离线或连接字符串错误。", + "buffering timed out__fix_0": "检查 MongoDB 状态", + "buffering timed out__fix_1": "检查连接字符串", + "jwt malformed__explanation": "提供的令牌不是有效的 JWT 结构。", + "jwt malformed__why": "令牌已损坏或只发送了部分令牌。", + "jwt malformed__fix_0": "检查 'Authorization' 标头", + "jwt malformed__fix_1": "验证令牌生成过程", + "secretOrPrivateKey must have a value__explanation": "JWT 密钥缺失。", + "secretOrPrivateKey must have a value__why": "环境变量(JWT_SECRET)未加载。", + "secretOrPrivateKey must have a value__fix_0": "检查 .env 文件", + "secretOrPrivateKey must have a value__fix_1": "运行 dotenv.config()", + "E11000__explanation": "您保存的数据中某个\"唯一\"字段已存在。", + "E11000__why": "通常是数据库中存在重复的邮箱或用户名。", + "E11000__fix_0": "保存前检查数据是否已存在", + "E11000__fix_1": "使用唯一性错误处理", + "Unexpected token < in JSON__explanation": "您尝试解析 JSON,但获得的是 HTML。", + "Unexpected token < in JSON__why": "您的 API 返回了错误页面(HTML)而非数据(JSON)。", + "Unexpected token < in JSON__fix_0": "检查 API 地址", + "Unexpected token < in JSON__fix_1": "检查服务器日志是否有崩溃", + "CORS__explanation": "浏览器出于安全原因阻止了您的请求。", + "CORS__why": "服务器不允许来自您前端域名的请求。", + "CORS__fix_0": "在服务器上安装 'cors' 包", + "CORS__fix_1": "app.use(cors())", + "'map' of undefined__explanation": "您正在尝试遍历一个不存在的数组。", + "'map' of undefined__why": "该变量是 null/undefined 而非数组。", + "'map' of undefined__fix_0": "初始化为空数组:data || []", + "'map' of undefined__fix_1": "检查 API 响应", + "module not found 'dotenv'__explanation": "缺少 'dotenv' 包。", + "module not found 'dotenv'__why": "您在代码中使用了它但未安装。", + "module not found 'dotenv'__fix_0": "npm install dotenv", + "validation failed__explanation": "数据与您的 Mongoose 模式不匹配。", + "validation failed__why": "缺少必填字段或数据类型错误。", + "validation failed__fix_0": "检查必填字段", + "validation failed__fix_1": "在前端验证数据", + "not authorized__explanation": "由于凭据缺失或无效而拒绝访问。", + "not authorized__why": "令牌已过期或 API 密钥错误。", + "not authorized__fix_0": "重新登录", + "not authorized__fix_1": "检查请求头", + "status code 404__explanation": "您调用的 API 端点不存在。", + "status code 404__why": "URL 错误或服务器路由未定义。", + "status code 404__fix_0": "检查 API 路由拼写", + "status code 404__fix_1": "检查基础 URL", + "status code 500__explanation": "服务器在处理您的请求时崩溃了。", + "status code 500__why": "后端服务器代码存在错误。", + "status code 500__fix_0": "检查服务器控制台日志", + "status code 500__fix_1": "在服务器端添加 try/catch", + "is not iterable__explanation": "您在非数组对象上使用了 for...of 循环或展开运算符 (...)。", + "is not iterable__why": "您尝试对 Object 或 Null 进行迭代。", + "is not iterable__fix_0": "确保变量是数组", + "is not iterable__fix_1": "使用 Object.keys()", + "require is not defined__explanation": "您在 ES 模块中使用了 'require'。", + "require is not defined__why": "package.json 中设置了 'type': 'module'。", + "require is not defined__fix_0": "改用 'import'", + "require is not defined__fix_1": "移除 'type: module'", + "EACCES__explanation": "您没有访问此文件/端口的权限。", + "EACCES__why": "您需要管理员权限或文件被锁定。", + "EACCES__fix_0": "使用 'sudo'(Linux/Mac)", + "EACCES__fix_1": "检查文件权限", + "has already been declared__explanation": "您重复声明了同一个变量名。", + "has already been declared__why": "在同一作用域中对已存在的名称使用了 'let' 或 'const'。", + "has already been declared__fix_0": "重命名其中一个变量", + "has already been declared__fix_1": "删除第二次声明", + "PayloadTooLargeError__explanation": "您发送的数据对服务器来说太大了。", + "PayloadTooLargeError__why": "通常是图片或文件超出了 body-parser 的限制。", + "PayloadTooLargeError__fix_0": "增加限制:app.use(express.json({limit: '50mb'}))", + "set property of null__explanation": "您试图为空变量的属性赋值。", + "set property of null__why": "您要修改的对象尚未创建。", + "set property of null__fix_0": "先初始化对象", + "set property of null__fix_1": "检查是否为 null", + "socket hang up__explanation": "服务器意外关闭了连接。", + "socket hang up__why": "服务器崩溃或发生超时。", + "socket hang up__fix_0": "检查服务器健康状态", + "socket hang up__fix_1": "增加超时限制", + "Unexpected end of JSON input__explanation": "JSON 数据不完整或为空。", + "Unexpected end of JSON input__why": "服务器发送了空字符串而不是 JSON。", + "Unexpected end of JSON input__fix_0": "检查 API 响应体", + "Unexpected end of JSON input__fix_1": "处理空响应", + "Script execution timed out__explanation": "您的代码运行时间过长。", + "Script execution timed out__why": "大量计算或无限循环。", + "Script execution timed out__fix_0": "优化逻辑", + "Script execution timed out__fix_1": "使用工作线程", + "'then' of undefined__explanation": "您在不是 Promise 的对象上调用了 .then()。", + "'then' of undefined__why": "该函数没有返回 promise。", + "'then' of undefined__fix_0": "将函数声明为 'async'", + "'then' of undefined__fix_1": "返回一个 Promise", + "Invalid connection string__explanation": "数据库 URL 格式错误。", + "Invalid connection string__why": "URI 中缺少 '@' 或 '/' 等符号。", + "Invalid connection string__fix_0": "检查数据库 URI 格式", + "window is not defined__explanation": "您正在 Node.js 中尝试使用浏览器代码 (window)。", + "window is not defined__why": "Node.js 没有 'window' 对象(这是浏览器专用的)。", + "window is not defined__fix_0": "检查是否在浏览器中运行", + "window is not defined__fix_1": "改用 'global'", + "Too many listeners__explanation": "EventEmitters 中检测到内存泄漏。", + "Too many listeners__why": "在循环或重复调用的函数中添加事件监听器。", + "Too many listeners__fix_0": "使用 .once() 而不是 .on()", + "Too many listeners__fix_1": "移除旧的监听器", + "spread non-iterable__explanation": "您在不允许的地方尝试使用 `...obj`。", + "spread non-iterable__why": "尝试将对象展开到数组中。", + "spread non-iterable__fix_0": "数组使用方括号 [],对象使用花括号 {}", + "EPIPE__explanation": "管道中断:向已关闭的连接发送数据。", + "EPIPE__why": "另一端(客户端/进程)停止监听。", + "EPIPE__fix_0": "处理流错误", + "EPIPE__fix_1": "检查进程是否存活", + "Missing initializer__explanation": "您声明了一个 const 但没有赋值。", + "Missing initializer__why": "常量必须在创建时立即设置。", + "Missing initializer__fix_0": "赋值:const x = 1;", + "peerinvalid__explanation": "已安装的包存在版本冲突。", + "peerinvalid__why": "一个库需要版本A,另一个库需要版本B。", + "peerinvalid__fix_0": "npm install --legacy-peer-deps", + "filter is not a function__explanation": "你试图对不是数组的内容进行 filter 操作。", + "filter is not a function__why": "该变量是对象或为 Null。", + "filter is not a function__fix_0": "确保数据是数组:Array.isArray(data)", + "ENOTFOUND__explanation": "该 URL 的 DNS 查询失败。", + "ENOTFOUND__why": "URL 拼写错误或没有网络连接。", + "ENOTFOUND__fix_0": "检查 URL 拼写", + "ENOTFOUND__fix_1": "检查 DNS/网络连接", + "reserved word__explanation": "你使用了 JS 的保留字(如 'class' 或 'await')作为变量名。", + "reserved word__why": "变量不能命名为 'class' 或 'function'。", + "reserved word__fix_0": "重命名该变量", + "Cannot find name__explanation": "TypeScript 找不到该变量或类型。", + "Cannot find name__why": "变量未声明或缺少 @types 包。", + "Cannot find name__fix_0": "检查 import 导入", + "Cannot find name__fix_1": "安装类型:npm install @types/node", + "convert undefined or null to object__explanation": "在空变量上调用 Object 方法。", + "convert undefined or null to object__why": "当 data 为 null 时使用 Object.keys(data)。", + "convert undefined or null to object__fix_0": "检查数据是否存在:data && Object.keys(data)", + "Access-Control-Allow-Origin__explanation": "CORS 错误:服务器未向你的域名开放数据共享。", + "Access-Control-Allow-Origin__why": "后端的安全策略。", + "Access-Control-Allow-Origin__fix_0": "在服务器端启用 CORS", + "Invalid or unexpected token__explanation": "代码中包含不该出现的字符。", + "Invalid or unexpected token__why": "复制粘贴时带有隐藏符号或用到了智能引号(如 ” 替代 \")。", + "Invalid or unexpected token__fix_0": "手动重新输入这一行", + "Invalid or unexpected token__fix_1": "检查是否存在不可见字符", + "timeout of 2000ms exceeded__explanation": "您的测试运行时间过长。", + "timeout of 2000ms exceeded__why": "异步代码未调用 'done()' 或未在规定时间内完成。", + "timeout of 2000ms exceeded__fix_0": "增加测试超时时间", + "timeout of 2000ms exceeded__fix_1": "检查是否存在缓慢的 API 调用", + "does not exist on type__explanation": "TypeScript 错误:访问了接口中不存在的属性。", + "does not exist on type__why": "对象结构与 TypeScript 类型定义不匹配。", + "does not exist on type__fix_0": "更新接口定义", + "does not exist on type__fix_1": "使用类型断言:(obj as any).prop", + "npm ERR! 404__explanation": "NPM 找不到您想要安装的包。", + "npm ERR! 404__why": "包名拼写错误或这是一个私有包。", + "npm ERR! 404__fix_0": "检查包名拼写", + "npm ERR! 404__fix_1": "npm login", + "Unexpected end of input__explanation": "您的代码突然中断,可能是缺少闭合括号。", + "Unexpected end of input__why": "您打开了 ( [ 或 { 但忘记用 ) ] 或 } 闭合。", + "Unexpected end of input__fix_0": "检查是否缺少闭合圆括号 )", + "Unexpected end of input__fix_1": "检查是否缺少闭合花括号 }", + "Unexpected end of input__fix_2": "确保所有引号 ' 或 \" 都已闭合", + "missing ) after argument list__explanation": "您忘记用 ')' 闭合函数调用。", + "missing ) after argument list__why": "圆括号已打开,但在闭合之前该行已结束或出现了其他符号。", + "missing ) after argument list__fix_0": "在函数调用末尾添加 ')'", + "missing ) after argument list__fix_1": "检查是否在输入时意外删除了 ')'" +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e9b58e1..c1504b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,499 +1,2008 @@ -{ - "name": "errlens", - "version": "1.0.9", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "errlens", - "version": "1.0.9", - "license": "MIT", - "dependencies": { - "boxen": "^5.1.2", - "chalk": "^4.1.2", - "commander": "^14.0.3", - "fuse.js": "^7.0.0", - "ora": "^9.3.0" - }, - "bin": { - "errlens": "bin/index.js" - }, - "engines": { - "node": ">=20.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/BeyteFlow" - } - }, - "node_modules/ansi-align": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", - "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", - "license": "ISC", - "dependencies": { - "string-width": "^4.1.0" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/boxen": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", - "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", - "license": "MIT", - "dependencies": { - "ansi-align": "^3.0.0", - "camelcase": "^6.2.0", - "chalk": "^4.1.0", - "cli-boxes": "^2.2.1", - "string-width": "^4.2.2", - "type-fest": "^0.20.2", - "widest-line": "^3.1.0", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/cli-boxes": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", - "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", - "license": "MIT", - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-cursor": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", - "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", - "license": "MIT", - "dependencies": { - "restore-cursor": "^5.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-spinners": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-3.4.0.tgz", - "integrity": "sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==", - "license": "MIT", - "engines": { - "node": ">=18.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "license": "MIT" - }, - "node_modules/commander": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", - "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", - "license": "MIT", - "engines": { - "node": ">=20" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" - }, - "node_modules/fuse.js": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-7.1.0.tgz", - "integrity": "sha512-trLf4SzuuUxfusZADLINj+dE8clK1frKdmqiJNb1Es75fmI5oY6X2mxLVUciLLjxqw/xr72Dhy+lER6dGd02FQ==", - "license": "Apache-2.0", - "engines": { - "node": ">=10" - } - }, - "node_modules/get-east-asian-width": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.5.0.tgz", - "integrity": "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-interactive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", - "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-unicode-supported": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", - "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-symbols": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-7.0.1.tgz", - "integrity": "sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==", - "license": "MIT", - "dependencies": { - "is-unicode-supported": "^2.0.0", - "yoctocolors": "^2.1.1" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mimic-function": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", - "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/onetime": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", - "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", - "license": "MIT", - "dependencies": { - "mimic-function": "^5.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ora": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/ora/-/ora-9.3.0.tgz", - "integrity": "sha512-lBX72MWFduWEf7v7uWf5DHp9Jn5BI8bNPGuFgtXMmr2uDz2Gz2749y3am3agSDdkhHPHYmmxEGSKH85ZLGzgXw==", - "license": "MIT", - "dependencies": { - "chalk": "^5.6.2", - "cli-cursor": "^5.0.0", - "cli-spinners": "^3.2.0", - "is-interactive": "^2.0.0", - "is-unicode-supported": "^2.1.0", - "log-symbols": "^7.0.1", - "stdin-discarder": "^0.3.1", - "string-width": "^8.1.0" - }, - "engines": { - "node": ">=20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ora/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/ora/node_modules/chalk": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", - "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/ora/node_modules/string-width": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.0.tgz", - "integrity": "sha512-6hJPQ8N0V0P3SNmP6h2J99RLuzrWz2gvT7VnK5tKvrNqJoyS9W4/Fb8mo31UiPvy00z7DQXkP2hnKBVav76thw==", - "license": "MIT", - "dependencies": { - "get-east-asian-width": "^1.5.0", - "strip-ansi": "^7.1.2" - }, - "engines": { - "node": ">=20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ora/node_modules/strip-ansi": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", - "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.2.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/restore-cursor": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", - "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", - "license": "MIT", - "dependencies": { - "onetime": "^7.0.0", - "signal-exit": "^4.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/stdin-discarder": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.3.1.tgz", - "integrity": "sha512-reExS1kSGoElkextOcPkel4NE99S0BWxjUHQeDFnR8S993JxpPX7KU4MNmO19NXhlJp+8dmdCbKQVNgLJh2teA==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/widest-line": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", - "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "license": "MIT", - "dependencies": { - "string-width": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/yoctocolors": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.2.tgz", - "integrity": "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} +{ + + "name": "errlens", + + "version": "1.0.9", + + "lockfileVersion": 3, + + "requires": true, + + "packages": { + + + "": { + + + + "name": "errlens", + + + + "version": "1.0.9", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "boxen": "^5.1.2", + + + + + "chalk": "^4.1.2", + + + + + "commander": "^14.0.3", + + + + + "fuse.js": "^7.0.0", + + + + + "ora": "^9.3.0" + + + + }, + + + + "bin": { + + + + + "errlens": "bin/index.js" + + + + }, + + + + "engines": { + + + + + "node": ">=20.0.0" + + + + }, + + + + "funding": { + + + + + "type": "github", + + + + + "url": "https://github.com/sponsors/BeyteFlow" + + + + } + + + }, + + + "node_modules/ansi-align": { + + + + "version": "3.0.1", + + + + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + + + + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", + + + + "license": "ISC", + + + + "dependencies": { + + + + + "string-width": "^4.1.0" + + + + } + + + }, + + + "node_modules/ansi-regex": { + + + + "version": "5.0.1", + + + + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + + + + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + + + + "license": "MIT", + + + + "engines": { + + + + + "node": ">=8" + + + + } + + + }, + + + "node_modules/ansi-styles": { + + + + "version": "4.3.0", + + + + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + + + + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "color-convert": "^2.0.1" + + + + }, + + + + "engines": { + + + + + "node": ">=8" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + + + + } + + + }, + + + "node_modules/boxen": { + + + + "version": "5.1.2", + + + + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", + + + + "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "ansi-align": "^3.0.0", + + + + + "camelcase": "^6.2.0", + + + + + "chalk": "^4.1.0", + + + + + "cli-boxes": "^2.2.1", + + + + + "string-width": "^4.2.2", + + + + + "type-fest": "^0.20.2", + + + + + "widest-line": "^3.1.0", + + + + + "wrap-ansi": "^7.0.0" + + + + }, + + + + "engines": { + + + + + "node": ">=10" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/camelcase": { + + + + "version": "6.3.0", + + + + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + + + + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + + + + "license": "MIT", + + + + "engines": { + + + + + "node": ">=10" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/chalk": { + + + + "version": "4.1.2", + + + + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + + + + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "ansi-styles": "^4.1.0", + + + + + "supports-color": "^7.1.0" + + + + }, + + + + "engines": { + + + + + "node": ">=10" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/chalk/chalk?sponsor=1" + + + + } + + + }, + + + "node_modules/cli-boxes": { + + + + "version": "2.2.1", + + + + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + + + + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + + + + "license": "MIT", + + + + "engines": { + + + + + "node": ">=6" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/cli-cursor": { + + + + "version": "5.0.0", + + + + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + + + + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "restore-cursor": "^5.0.0" + + + + }, + + + + "engines": { + + + + + "node": ">=18" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/cli-spinners": { + + + + "version": "3.4.0", + + + + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-3.4.0.tgz", + + + + "integrity": "sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==", + + + + "license": "MIT", + + + + "engines": { + + + + + "node": ">=18.20" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/color-convert": { + + + + "version": "2.0.1", + + + + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + + + + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "color-name": "~1.1.4" + + + + }, + + + + "engines": { + + + + + "node": ">=7.0.0" + + + + } + + + }, + + + "node_modules/color-name": { + + + + "version": "1.1.4", + + + + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + + + + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + + + + "license": "MIT" + + + }, + + + "node_modules/commander": { + + + + "version": "14.0.3", + + + + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", + + + + "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", + + + + "license": "MIT", + + + + "engines": { + + + + + "node": ">=20" + + + + } + + + }, + + + "node_modules/emoji-regex": { + + + + "version": "8.0.0", + + + + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + + + + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + + + + "license": "MIT" + + + }, + + + "node_modules/fuse.js": { + + + + "version": "7.1.0", + + + + "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-7.1.0.tgz", + + + + "integrity": "sha512-trLf4SzuuUxfusZADLINj+dE8clK1frKdmqiJNb1Es75fmI5oY6X2mxLVUciLLjxqw/xr72Dhy+lER6dGd02FQ==", + + + + "license": "Apache-2.0", + + + + "engines": { + + + + + "node": ">=10" + + + + } + + + }, + + + "node_modules/get-east-asian-width": { + + + + "version": "1.5.0", + + + + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.5.0.tgz", + + + + "integrity": "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA==", + + + + "license": "MIT", + + + + "engines": { + + + + + "node": ">=18" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/has-flag": { + + + + "version": "4.0.0", + + + + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + + + + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + + + + "license": "MIT", + + + + "engines": { + + + + + "node": ">=8" + + + + } + + + }, + + + "node_modules/is-fullwidth-code-point": { + + + + "version": "3.0.0", + + + + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + + + + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + + + + "license": "MIT", + + + + "engines": { + + + + + "node": ">=8" + + + + } + + + }, + + + "node_modules/is-interactive": { + + + + "version": "2.0.0", + + + + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + + + + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + + + + "license": "MIT", + + + + "engines": { + + + + + "node": ">=12" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/is-unicode-supported": { + + + + "version": "2.1.0", + + + + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", + + + + "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", + + + + "license": "MIT", + + + + "engines": { + + + + + "node": ">=18" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/log-symbols": { + + + + "version": "7.0.1", + + + + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-7.0.1.tgz", + + + + "integrity": "sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "is-unicode-supported": "^2.0.0", + + + + + "yoctocolors": "^2.1.1" + + + + }, + + + + "engines": { + + + + + "node": ">=18" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/mimic-function": { + + + + "version": "5.0.1", + + + + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + + + + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + + + + "license": "MIT", + + + + "engines": { + + + + + "node": ">=18" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/onetime": { + + + + "version": "7.0.0", + + + + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + + + + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "mimic-function": "^5.0.0" + + + + }, + + + + "engines": { + + + + + "node": ">=18" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/ora": { + + + + "version": "9.3.0", + + + + "resolved": "https://registry.npmjs.org/ora/-/ora-9.3.0.tgz", + + + + "integrity": "sha512-lBX72MWFduWEf7v7uWf5DHp9Jn5BI8bNPGuFgtXMmr2uDz2Gz2749y3am3agSDdkhHPHYmmxEGSKH85ZLGzgXw==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "chalk": "^5.6.2", + + + + + "cli-cursor": "^5.0.0", + + + + + "cli-spinners": "^3.2.0", + + + + + "is-interactive": "^2.0.0", + + + + + "is-unicode-supported": "^2.1.0", + + + + + "log-symbols": "^7.0.1", + + + + + "stdin-discarder": "^0.3.1", + + + + + "string-width": "^8.1.0" + + + + }, + + + + "engines": { + + + + + "node": ">=20" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/ora/node_modules/ansi-regex": { + + + + "version": "6.2.2", + + + + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + + + + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + + + + "license": "MIT", + + + + "engines": { + + + + + "node": ">=12" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + + + + } + + + }, + + + "node_modules/ora/node_modules/chalk": { + + + + "version": "5.6.2", + + + + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + + + + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + + + + "license": "MIT", + + + + "engines": { + + + + + "node": "^12.17.0 || ^14.13 || >=16.0.0" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/chalk/chalk?sponsor=1" + + + + } + + + }, + + + "node_modules/ora/node_modules/string-width": { + + + + "version": "8.2.0", + + + + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.0.tgz", + + + + "integrity": "sha512-6hJPQ8N0V0P3SNmP6h2J99RLuzrWz2gvT7VnK5tKvrNqJoyS9W4/Fb8mo31UiPvy00z7DQXkP2hnKBVav76thw==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "get-east-asian-width": "^1.5.0", + + + + + "strip-ansi": "^7.1.2" + + + + }, + + + + "engines": { + + + + + "node": ">=20" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/ora/node_modules/strip-ansi": { + + + + "version": "7.2.0", + + + + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + + + + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "ansi-regex": "^6.2.2" + + + + }, + + + + "engines": { + + + + + "node": ">=12" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + + + + } + + + }, + + + "node_modules/restore-cursor": { + + + + "version": "5.1.0", + + + + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + + + + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "onetime": "^7.0.0", + + + + + "signal-exit": "^4.1.0" + + + + }, + + + + "engines": { + + + + + "node": ">=18" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/signal-exit": { + + + + "version": "4.1.0", + + + + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + + + + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + + + + "license": "ISC", + + + + "engines": { + + + + + "node": ">=14" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/isaacs" + + + + } + + + }, + + + "node_modules/stdin-discarder": { + + + + "version": "0.3.1", + + + + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.3.1.tgz", + + + + "integrity": "sha512-reExS1kSGoElkextOcPkel4NE99S0BWxjUHQeDFnR8S993JxpPX7KU4MNmO19NXhlJp+8dmdCbKQVNgLJh2teA==", + + + + "license": "MIT", + + + + "engines": { + + + + + "node": ">=18" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/string-width": { + + + + "version": "4.2.3", + + + + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + + + + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "emoji-regex": "^8.0.0", + + + + + "is-fullwidth-code-point": "^3.0.0", + + + + + "strip-ansi": "^6.0.1" + + + + }, + + + + "engines": { + + + + + "node": ">=8" + + + + } + + + }, + + + "node_modules/strip-ansi": { + + + + "version": "6.0.1", + + + + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + + + + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "ansi-regex": "^5.0.1" + + + + }, + + + + "engines": { + + + + + "node": ">=8" + + + + } + + + }, + + + "node_modules/supports-color": { + + + + "version": "7.2.0", + + + + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + + + + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "has-flag": "^4.0.0" + + + + }, + + + + "engines": { + + + + + "node": ">=8" + + + + } + + + }, + + + "node_modules/type-fest": { + + + + "version": "0.20.2", + + + + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + + + + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + + + + "license": "(MIT OR CC0-1.0)", + + + + "engines": { + + + + + "node": ">=10" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + }, + + + "node_modules/widest-line": { + + + + "version": "3.1.0", + + + + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + + + + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "string-width": "^4.0.0" + + + + }, + + + + "engines": { + + + + + "node": ">=8" + + + + } + + + }, + + + "node_modules/wrap-ansi": { + + + + "version": "7.0.0", + + + + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + + + + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + + + + "license": "MIT", + + + + "dependencies": { + + + + + "ansi-styles": "^4.0.0", + + + + + "string-width": "^4.1.0", + + + + + "strip-ansi": "^6.0.0" + + + + }, + + + + "engines": { + + + + + "node": ">=10" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + + + + } + + + }, + + + "node_modules/yoctocolors": { + + + + "version": "2.1.2", + + + + "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.2.tgz", + + + + "integrity": "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==", + + + + "license": "MIT", + + + + "engines": { + + + + + "node": ">=18" + + + + }, + + + + "funding": { + + + + + "url": "https://github.com/sponsors/sindresorhus" + + + + } + + + } + + } +} diff --git a/package.json b/package.json index fe76da7..dac9257 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,5 @@ { + "name": "errlens", "version": "1.0.9", "description": "Professional CLI tool that explains JavaScript and Node.js errors in plain English with actionable fixes directly in your terminal.", @@ -32,7 +33,9 @@ "LICENSE" ], "scripts": { - "test": "node --test test/**/*.test.js" + "test": "node --test test/**/*.test-lang.js" + + }, "repository": { "type": "git", @@ -52,5 +55,8 @@ "commander": "^14.0.3", "fuse.js": "^7.0.0", "ora": "^9.3.0" + }, + "directories": { + "lib": "lib" } -} +} \ No newline at end of file diff --git a/scripts/extractlocals.js b/scripts/extractlocals.js new file mode 100644 index 0000000..5f32284 --- /dev/null +++ b/scripts/extractlocals.js @@ -0,0 +1,28 @@ +const fs = require('fs') +const path = require('path') + +const db = JSON.parse( + fs.readFileSync(path.join(__dirname, '../lib/database.json'), 'utf8') +) + +const en = {} + +for (const entry of db){ + const key = entry.match + + en[`${key}__explanation`] = entry.explanation + en[`${key}__why`] = entry.why + + entry.fixes.forEach((fix,i) => { + en[`${key}__fix_${i}`] = fix + }) +} + +fs.mkdirSync(path.join(__dirname,'../locales'),{recursive:true}) +fs.writeFileSync( + path.join(__dirname,'../locales/en.json'), + JSON.stringify(en,null,2), + 'utf8' +) + +console.log(` Extracted ${Object.keys(en).length} strings to locales/en.json`) \ No newline at end of file diff --git a/test/test-lang.js b/test/test-lang.js new file mode 100644 index 0000000..0fd9419 --- /dev/null +++ b/test/test-lang.js @@ -0,0 +1,15 @@ +const { findError } = require('../lib/matcher') + +const languages = ['en', 'hi', 'es', 'fr', 'de', 'zh', 'ja', 'pt'] +const testError = "Cannot read properties of undefined" + +for (const lang of languages) { + console.log(`\n--- ${lang.toUpperCase()} ---`) + const result = findError(testError, lang) + if (result.matches.length > 0) { + const match = result.matches[0] + console.log('explanation:', match.explanation) + console.log('why: ', match.why) + console.log('fixes: ', match.fixes) + } +} \ No newline at end of file