renovate 43.36.0 → 43.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/util/unicode.js +14 -1
- package/dist/util/unicode.js.map +1 -1
- package/package.json +1 -1
- package/renovate-schema.json +2 -2
package/dist/util/unicode.js
CHANGED
|
@@ -2,8 +2,21 @@ import { hiddenUnicodeCharactersRegex, toUnicodeEscape } from "./regex.js";
|
|
|
2
2
|
import { logger } from "../logger/index.js";
|
|
3
3
|
|
|
4
4
|
//#region lib/util/unicode.ts
|
|
5
|
+
function isBinaryContent(content) {
|
|
6
|
+
const sampleSize = Math.min(content.length, 8192);
|
|
7
|
+
for (let i = 0; i < sampleSize; i++) if (content[i] === 0) return true;
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
5
10
|
function logWarningIfUnicodeHiddenCharactersInPackageFile(file, content) {
|
|
6
|
-
const
|
|
11
|
+
const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content);
|
|
12
|
+
const hiddenCharacters = buffer.toString("utf8").match(hiddenUnicodeCharactersRegex);
|
|
13
|
+
if (isBinaryContent(buffer) && hiddenCharacters) {
|
|
14
|
+
logger.trace({
|
|
15
|
+
file,
|
|
16
|
+
hiddenCharacters: toUnicodeEscape(hiddenCharacters.join(""))
|
|
17
|
+
}, `Hidden Unicode characters discovered in file \`${file}\`, but not logging higher than TRACE as it appears to be a binary file`);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
7
20
|
if (hiddenCharacters) if (hiddenCharacters.length === 1 && hiddenCharacters[0] === "") logger.once.trace({
|
|
8
21
|
file,
|
|
9
22
|
hiddenCharacters: toUnicodeEscape(hiddenCharacters.join(""))
|
package/dist/util/unicode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unicode.js","names":[],"sources":["../../lib/util/unicode.ts"],"sourcesContent":["import { logger } from '../logger/index.ts';\nimport { hiddenUnicodeCharactersRegex, toUnicodeEscape } from './regex.ts';\n\nexport function logWarningIfUnicodeHiddenCharactersInPackageFile(\n file: string,\n content: string | Buffer,\n): void {\n const hiddenCharacters =
|
|
1
|
+
{"version":3,"file":"unicode.js","names":[],"sources":["../../lib/util/unicode.ts"],"sourcesContent":["import { logger } from '../logger/index.ts';\nimport { hiddenUnicodeCharactersRegex, toUnicodeEscape } from './regex.ts';\n\nfunction isBinaryContent(content: Buffer): boolean {\n // Check for null bytes in the first 8KB - a common indicator of binary content\n const sampleSize = Math.min(content.length, 8192);\n for (let i = 0; i < sampleSize; i++) {\n if (content[i] === 0) {\n return true;\n }\n }\n return false;\n}\n\nexport function logWarningIfUnicodeHiddenCharactersInPackageFile(\n file: string,\n content: string | Buffer,\n): void {\n const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content);\n const hiddenCharacters = buffer\n .toString('utf8')\n .match(hiddenUnicodeCharactersRegex);\n\n if (isBinaryContent(buffer) && hiddenCharacters) {\n logger.trace(\n {\n file,\n hiddenCharacters: toUnicodeEscape(hiddenCharacters.join('')),\n },\n\n `Hidden Unicode characters discovered in file \\`${file}\\`, but not logging higher than TRACE as it appears to be a binary file`,\n );\n return;\n }\n\n if (hiddenCharacters) {\n if (hiddenCharacters.length === 1 && hiddenCharacters[0] === '\\uFEFF') {\n logger.once.trace(\n {\n file,\n hiddenCharacters: toUnicodeEscape(hiddenCharacters.join('')),\n },\n `Hidden Byte Order Mark (BOM) Unicode characters has been discovered in the file \\`${file}\\`. This is likely safe, if you are using Microsoft Windows, but please confirm that they are intended to be there, as they could be an attempt to \"smuggle\" text into your codebase, or used to confuse tools like Renovate or Large Language Models (LLMs)`,\n );\n } else {\n logger.once.warn(\n {\n file,\n hiddenCharacters: toUnicodeEscape(hiddenCharacters.join('')),\n },\n `Hidden Unicode characters have been discovered in file(s) in your repository. See your Renovate logs for more details. Please confirm that they are intended to be there, as they could be an attempt to \"smuggle\" text into your codebase, or used to confuse tools like Renovate or Large Language Models (LLMs)`,\n );\n }\n }\n}\n"],"mappings":";;;;AAGA,SAAS,gBAAgB,SAA0B;CAEjD,MAAM,aAAa,KAAK,IAAI,QAAQ,QAAQ,KAAK;AACjD,MAAK,IAAI,IAAI,GAAG,IAAI,YAAY,IAC9B,KAAI,QAAQ,OAAO,EACjB,QAAO;AAGX,QAAO;;AAGT,SAAgB,iDACd,MACA,SACM;CACN,MAAM,SAAS,OAAO,SAAS,QAAQ,GAAG,UAAU,OAAO,KAAK,QAAQ;CACxE,MAAM,mBAAmB,OACtB,SAAS,OAAO,CAChB,MAAM,6BAA6B;AAEtC,KAAI,gBAAgB,OAAO,IAAI,kBAAkB;AAC/C,SAAO,MACL;GACE;GACA,kBAAkB,gBAAgB,iBAAiB,KAAK,GAAG,CAAC;GAC7D,EAED,kDAAkD,KAAK,yEACxD;AACD;;AAGF,KAAI,iBACF,KAAI,iBAAiB,WAAW,KAAK,iBAAiB,OAAO,IAC3D,QAAO,KAAK,MACV;EACE;EACA,kBAAkB,gBAAgB,iBAAiB,KAAK,GAAG,CAAC;EAC7D,EACD,qFAAqF,KAAK,8PAC3F;KAED,QAAO,KAAK,KACV;EACE;EACA,kBAAkB,gBAAgB,iBAAiB,KAAK,GAAG,CAAC;EAC7D,EACD,qTACD"}
|
package/package.json
CHANGED
package/renovate-schema.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"title": "JSON schema for Renovate 43.36.
|
|
2
|
+
"title": "JSON schema for Renovate 43.36.1 config files (https://renovatebot.com/)",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"x-renovate-version": "43.36.
|
|
4
|
+
"x-renovate-version": "43.36.1",
|
|
5
5
|
"allowComments": true,
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|