@sie-js/vkp 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sie-js/vkp",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Parser and utils for the .VKP files format which is used in the V-Klay.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/index.js CHANGED
@@ -59,7 +59,7 @@ function vkpParse(text, options) {
59
59
  if (pragmas.old_equal_ff && !oldData)
60
60
  oldData = Buffer.alloc(newData.length).fill(0xFF);
61
61
 
62
- if (oldData&& oldData.length < newData.length)
62
+ if (oldData && oldData.length < newData.length)
63
63
  vkp.errors.push(new VkpParseError(`Old data (${oldData.length} bytes) is less than new data (${newData.length} bytes)`, data.old.loc));
64
64
 
65
65
  if (pragmas.warn_no_old_on_apply && !oldData) {
@@ -107,10 +107,10 @@ function vkpDetectContent(text) {
107
107
  let trimmedText = text.replace(/\/\*.*?\*\//gs, '').replace(/(\/\/|;|#).*?$/mg, '');
108
108
  if (trimmedText.match(/^\s*(0x[a-f0-9]+|[a-f0-9]+)\s*:[^\\/]/mi))
109
109
  return "PATCH";
110
+ if (text.match(/;!(к патчу прикреплён файл|There is a file attached to this patch), https?:\/\//i))
111
+ return "DOWNLOAD_STUB";
110
112
  if (!trimmedText.trim().length)
111
113
  return "EMPTY";
112
- if (text.match(/;!к патчу прикреплён файл, https?:\/\//i))
113
- return "DOWNLOAD_STUB";
114
114
  return "UNKNOWN";
115
115
  }
116
116