satoridb 1.1.11 → 1.1.12
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/cli.js +11 -0
- package/package.json +1 -1
- package/db/rating.json +0 -1
package/cli.js
CHANGED
|
@@ -52,6 +52,17 @@ async function executeCommand(command, args) {
|
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
let [key, data] = args;
|
|
55
|
+
|
|
56
|
+
// Intentar parsear como JSON si es un string que parece JSON
|
|
57
|
+
if (typeof data === 'string' && (data.startsWith('{') || data.startsWith('['))) {
|
|
58
|
+
try {
|
|
59
|
+
data = JSON.parse(data);
|
|
60
|
+
} catch (e) {
|
|
61
|
+
// Si no se puede parsear como JSON, mantener como string
|
|
62
|
+
console.log("⚠️ No se pudo parsear como JSON, guardando como string");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
55
66
|
await satoriInstance.set({key, data});
|
|
56
67
|
console.log(`✅ Datos guardados en clave: ${key}`);
|
|
57
68
|
break;
|
package/package.json
CHANGED
package/db/rating.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[]
|