@abaplint/runtime 2.0.1 → 2.0.2

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
@@ -10,6 +10,7 @@ export * from "./escape";
10
10
  export * from "./find";
11
11
  export * from "./floor";
12
12
  export * from "./frac";
13
+ export * from "./insert";
13
14
  export * from "./lines";
14
15
  export * from "./nmax";
15
16
  export * from "./nmin";
@@ -27,6 +27,7 @@ __exportStar(require("./escape"), exports);
27
27
  __exportStar(require("./find"), exports);
28
28
  __exportStar(require("./floor"), exports);
29
29
  __exportStar(require("./frac"), exports);
30
+ __exportStar(require("./insert"), exports);
30
31
  __exportStar(require("./lines"), exports);
31
32
  __exportStar(require("./nmax"), exports);
32
33
  __exportStar(require("./nmin"), exports);
@@ -0,0 +1,9 @@
1
+ import { String } from "../types";
2
+ import { ICharacter } from "../types/_character";
3
+ import { INumeric } from "../types/_numeric";
4
+ export interface IInsertInput {
5
+ val: ICharacter;
6
+ sub: ICharacter;
7
+ off?: INumeric;
8
+ }
9
+ export declare function insert(input: IInsertInput): String;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.insert = void 0;
4
+ const types_1 = require("../types");
5
+ function insert(input) {
6
+ let value = input.val.get();
7
+ let offset = 0;
8
+ if (input.off) {
9
+ offset = input.off.get();
10
+ }
11
+ value = value.substring(0, offset) + input.sub.get() + value.substring(offset);
12
+ return new types_1.String().set(value);
13
+ }
14
+ exports.insert = insert;
15
+ //# sourceMappingURL=insert.js.map
package/package.json CHANGED
@@ -1,39 +1,39 @@
1
- {
2
- "name": "@abaplint/runtime",
3
- "version": "2.0.1",
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.0",
32
- "@types/mocha": "^9.1.0",
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.3"
38
- }
39
- }
1
+ {
2
+ "name": "@abaplint/runtime",
3
+ "version": "2.0.2",
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.0",
32
+ "@types/mocha": "^9.1.0",
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.3"
38
+ }
39
+ }