@abaplint/runtime 2.0.16 → 2.0.17

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
@@ -6,5 +6,6 @@ export declare type replaceInput = {
6
6
  all: boolean;
7
7
  with: ICharacter;
8
8
  of: ICharacter;
9
+ ignoringCase?: boolean;
9
10
  };
10
11
  export declare function replace(input: replaceInput): void;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.replace = void 0;
4
4
  function replace(input) {
5
5
  let temp = input.target.get();
6
+ const ignoreCase = input.ignoringCase === true ? "i" : "";
6
7
  let search = "";
7
8
  let found = false;
8
9
  if (input.of) {
@@ -11,13 +12,16 @@ function replace(input) {
11
12
  throw "REPLACE, zero length input";
12
13
  }
13
14
  found = temp.indexOf(search) >= 0;
15
+ if (ignoreCase.length > 0) {
16
+ search = new RegExp(search, ignoreCase);
17
+ }
14
18
  }
15
19
  else if (input.regex) {
16
20
  if (input.regex.get().length === 0 && input.all === true) {
17
21
  throw "REPLACE, zero length input";
18
22
  }
19
23
  found = temp.match(search) !== null;
20
- search = new RegExp(input.regex.get());
24
+ search = new RegExp(input.regex.get(), ignoreCase);
21
25
  }
22
26
  let replace = "";
23
27
  if (typeof input.with === "string") {
@@ -28,7 +32,7 @@ function replace(input) {
28
32
  }
29
33
  if (input.all === true) {
30
34
  if (input.regex) {
31
- temp = temp.replace(new RegExp(input.regex.get(), "g"), replace);
35
+ temp = temp.replace(new RegExp(input.regex.get(), "g" + ignoreCase), replace);
32
36
  }
33
37
  else {
34
38
  while (temp.replace(search, replace) !== temp) {
package/package.json CHANGED
@@ -1,39 +1,39 @@
1
- {
2
- "name": "@abaplint/runtime",
3
- "version": "2.0.16",
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": "^9.2.2",
36
- "source-map-support": "^0.5.21",
37
- "typescript": "^4.6.4"
38
- }
39
- }
1
+ {
2
+ "name": "@abaplint/runtime",
3
+ "version": "2.0.17",
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
+ }