@vlydev/cs2-masked-inspect 1.0.0 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vlydev/cs2-masked-inspect",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Offline decoder/encoder for CS2 masked inspect URLs — pure JavaScript, no dependencies",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -102,11 +102,14 @@ function extractHex(input) {
102
102
  const mh = stripped.match(HYBRID_URL_RE);
103
103
  if (mh && /[A-Fa-f]/.test(mh[1])) return mh[1];
104
104
 
105
- // Classic/market URL: A<hex> preceded by %20, space, or + (A is a prefix marker, not hex)
105
+ // Classic/market URL: A<hex> preceded by %20, space, or + (A is a prefix marker, not hex).
106
+ // If stripping A yields odd-length hex, A is actually the first byte of the payload —
107
+ // fall through to the pure-masked check below which captures it with A included.
106
108
  const m = stripped.match(INSPECT_URL_RE);
107
- if (m) return m[1];
109
+ if (m && m[1].length % 2 === 0) return m[1];
108
110
 
109
- // Pure masked format: csgo_econ_action_preview%20<hexblob> (no S/A/M prefix)
111
+ // Pure masked format: csgo_econ_action_preview%20<hexblob> (no S/A/M prefix).
112
+ // Also handles payloads whose first hex character happens to be A.
110
113
  const mm = stripped.match(/csgo_econ_action_preview(?:%20|\s|\+)([0-9A-Fa-f]{10,})$/i);
111
114
  if (mm) return mm[1];
112
115