@abaplint/runtime 2.0.20 → 2.0.21

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,3 +1,3 @@
1
- # @abaplint/runtime
2
-
1
+ # @abaplint/runtime
2
+
3
3
  Runtime
@@ -8,10 +8,12 @@ function translate(input) {
8
8
  const to = typeof input.to === "string" ? input.to : input.to.get();
9
9
  const fromSplit = from.split("");
10
10
  const toSplit = to.split("");
11
+ const chars = {};
11
12
  for (let i = 0; i < fromSplit.length; i++) {
12
- const reg = new RegExp(fromSplit[i], "g");
13
- val = val.replace(reg, toSplit[i] || "");
13
+ chars[fromSplit[i]] = toSplit[i] || "";
14
14
  }
15
+ const reg = new RegExp("[" + from + "]", "g");
16
+ val = val.replace(reg, m => chars[m] || "");
15
17
  return new string_1.String().set(val);
16
18
  }
17
19
  exports.translate = translate;
package/package.json CHANGED
@@ -1,39 +1,39 @@
1
- {
2
- "name": "@abaplint/runtime",
3
- "version": "2.0.20",
4
- "description": "Transpiler - Runtime",
5
- "main": "build/src/index.js",
6
- "typings": "build/src/index.d.ts",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://github.com/abaplint/transpiler.git"
10
- },
11
- "scripts": {
12
- "compile": "tsc",
13
- "publish:major": "npm --no-git-tag-version version major && rm -rf build && npm install && npm run test && npm publish --access public",
14
- "publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
15
- "publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public",
16
- "test": "npm run compile && mocha"
17
- },
18
- "mocha": {
19
- "recursive": true,
20
- "reporter": "progress",
21
- "spec": "build/test/**/*.js",
22
- "require": "source-map-support/register"
23
- },
24
- "keywords": [
25
- "ABAP",
26
- "abaplint"
27
- ],
28
- "author": "abaplint",
29
- "license": "MIT",
30
- "devDependencies": {
31
- "@types/chai": "^4.3.1",
32
- "@types/mocha": "^9.1.1",
33
- "@types/sql.js": "^1.4.3",
34
- "chai": "^4.3.6",
35
- "mocha": "^10.0.0",
36
- "source-map-support": "^0.5.21",
37
- "typescript": "^4.6.4"
38
- }
39
- }
1
+ {
2
+ "name": "@abaplint/runtime",
3
+ "version": "2.0.21",
4
+ "description": "Transpiler - Runtime",
5
+ "main": "build/src/index.js",
6
+ "typings": "build/src/index.d.ts",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/abaplint/transpiler.git"
10
+ },
11
+ "scripts": {
12
+ "compile": "tsc",
13
+ "publish:major": "npm --no-git-tag-version version major && rm -rf build && npm install && npm run test && npm publish --access public",
14
+ "publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
15
+ "publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public",
16
+ "test": "npm run compile && mocha"
17
+ },
18
+ "mocha": {
19
+ "recursive": true,
20
+ "reporter": "progress",
21
+ "spec": "build/test/**/*.js",
22
+ "require": "source-map-support/register"
23
+ },
24
+ "keywords": [
25
+ "ABAP",
26
+ "abaplint"
27
+ ],
28
+ "author": "abaplint",
29
+ "license": "MIT",
30
+ "devDependencies": {
31
+ "@types/chai": "^4.3.1",
32
+ "@types/mocha": "^9.1.1",
33
+ "@types/sql.js": "^1.4.3",
34
+ "chai": "^4.3.6",
35
+ "mocha": "^10.0.0",
36
+ "source-map-support": "^0.5.21",
37
+ "typescript": "^4.6.4"
38
+ }
39
+ }