@kevlid/discordmenus 0.1.5 → 0.1.6

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/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @kevlid/discordmenus
2
2
 
3
+ > ⚠️ Usage is __**NOT**__ recommended
4
+
3
5
  ```js
4
6
  const fs = require("fs");
5
7
  const path = require("path");
package/index.d.ts CHANGED
@@ -265,5 +265,5 @@ export declare function fromDiscordJS(interaction: DiscordInteraction): DiscordI
265
265
 
266
266
  /** Encode option/menu keys for custom IDs (uppercase → _lowercase, spaces → _). */
267
267
  export declare function formatKey(key: string): string;
268
- /** Restore original key before get/save callbacks (inverse of formatKey). */
268
+ /** No-op: casing is not reconstructed anywhere. */
269
269
  export declare function decodeKey(encoded: string): string;
package/package.json CHANGED
@@ -1,18 +1,11 @@
1
1
  {
2
2
  "name": "@kevlid/discordmenus",
3
- "version": "0.1.5",
4
- "description": "Components v2 settings menus for Discord bots",
3
+ "version": "0.1.6",
4
+ "description": "some menu stuff for discord stuff",
5
5
  "main": "src/index.js",
6
6
  "types": "index.d.ts",
7
7
  "author": "kevlid",
8
8
  "license": "ISC",
9
- "keywords": [
10
- "discord",
11
- "discord.js",
12
- "menu",
13
- "typescript",
14
- "builder"
15
- ],
16
9
  "files": [
17
10
  "src",
18
11
  "index.d.ts",
@@ -19,25 +19,13 @@ function formatKey(key) {
19
19
  }
20
20
 
21
21
  /**
22
- * Reverses formatKey: "_" followed by a-z becomes A–Z. Literal "_" + letter in keys that were
23
- * not produced by an uppercase letter may decode incorrectly; prefer camelCase/PascalCase keys.
22
+ * NOTE: decodeKey is intentionally a no-op.
23
+ * Keys are encoded with `formatKey()` for stability in custom IDs, and we do not attempt to
24
+ * reconstruct original casing anywhere (including get/save contexts).
24
25
  */
25
26
  function decodeKey(encoded) {
26
27
  if (typeof encoded !== "string") throw new TypeError("Key must be a string");
27
- let out = "";
28
- for (let i = 0; i < encoded.length; i++) {
29
- const c = encoded[i];
30
- if (c === "_" && i + 1 < encoded.length) {
31
- const next = encoded[i + 1];
32
- if (next >= "a" && next <= "z") {
33
- out += next.toUpperCase();
34
- i++;
35
- continue;
36
- }
37
- }
38
- out += c;
39
- }
40
- return out;
28
+ return String(encoded);
41
29
  }
42
30
 
43
31
  module.exports = {