hindicode 1.2.0 → 1.3.0

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/index.js +8 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -115,6 +115,7 @@ const hindiToJS = {
115
115
  "रखो": "set",
116
116
  "साफ़": "clear",
117
117
  "आकार": "size",
118
+ "डालो": "add",
118
119
 
119
120
  // ── Promise ───────────────────────────────────────
120
121
  "फिर": "then",
@@ -149,14 +150,19 @@ const hindiToJS = {
149
150
  // ── Built-ins ─────────────────────────────────────
150
151
  "ऑब्जेक्ट": "Object",
151
152
  "ऐरे": "Array",
153
+ "सेट": "Set",
154
+ "स्ट्रिंग": "String",
152
155
  "टेक्स्ट": "String",
153
156
  "नंबर": "Number",
154
157
  "बूलियन": "Boolean",
158
+ "डेट": "Date",
155
159
  "तारीख": "Date",
156
160
  "गणित": "Math",
157
161
  "जेसन": "JSON",
158
162
  "रेगएक्स": "RegExp",
159
163
  "अनंत": "Infinity",
164
+ "त्रुटि": "Error",
165
+ "प्रॉमिस": "Promise",
160
166
 
161
167
  // ── Math Shortcuts ────────────────────────────────
162
168
  "गोलाई": "Math.round",
@@ -195,7 +201,7 @@ function translateHindiJS(code) {
195
201
  /(?<STRING_SGL>'(?:[^'\\]|\\.)*')/.source,
196
202
  /(?<BACKTICK>`[\s\S]*?`)/.source,
197
203
  /(?<REGEX>\/(?![*\/])(?:[^\/\\\n]|\\.)*?\/[gimuy]*)/.source,
198
- `(?<KEYWORD>(?<![\\u0900-\\u097F])(?:${sortedKeywords.join("|")})(?![\\u0900-\\u097F]))`
204
+ `(?<KEYWORD>(?<![\\u0900-\\u097F\\w$])(?:${sortedKeywords.join("|")})(?![\\u0900-\\u097F\\w$]))`
199
205
  ];
200
206
 
201
207
  const masterRegex = new RegExp(parts.join("|"), "g");
@@ -226,6 +232,7 @@ require.extensions[".hindi.js"] = function (module, filename) {
226
232
  module._compile(content, filename);
227
233
  } catch (error) {
228
234
  console.error("❌ Hindi Transpiler Error:", error);
235
+ throw error; // Re-throw to allow runners to detect failure
229
236
  }
230
237
  };
231
238
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hindicode",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Run JavaScript with Hindi keywords",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",