@abaplint/runtime 1.7.17 → 1.7.18

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.
@@ -1,2 +1,6 @@
1
1
  import { DataReference } from "../types";
2
- export declare function createData(target: DataReference): void;
2
+ export interface ICreateDataOptions {
3
+ table?: boolean;
4
+ name?: string;
5
+ }
6
+ export declare function createData(target: DataReference, options?: ICreateDataOptions): void;
@@ -2,8 +2,28 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createData = void 0;
4
4
  const clone_1 = require("../clone");
5
- function createData(target) {
6
- target.assign((0, clone_1.clone)(target.getType()));
5
+ function createData(target, options) {
6
+ if ((options === null || options === void 0 ? void 0 : options.name) && (options === null || options === void 0 ? void 0 : options.table)) {
7
+ // @ts-ignore
8
+ if (abap.DDIC[options.name] === undefined) {
9
+ // todo, throw exception
10
+ return;
11
+ }
12
+ // @ts-ignore
13
+ target.assign(new abap.types.Table(abap.DDIC[options.name].type));
14
+ }
15
+ else if (options === null || options === void 0 ? void 0 : options.name) {
16
+ // @ts-ignore
17
+ if (abap.DDIC[options.name] === undefined) {
18
+ // todo, throw exception
19
+ return;
20
+ }
21
+ // @ts-ignore
22
+ target.assign((0, clone_1.clone)(abap.DDIC[options.name].type));
23
+ }
24
+ else {
25
+ target.assign((0, clone_1.clone)(target.getType()));
26
+ }
7
27
  }
8
28
  exports.createData = createData;
9
29
  //# sourceMappingURL=create_data.js.map
package/package.json CHANGED
@@ -1,42 +1,42 @@
1
- {
2
- "name": "@abaplint/runtime",
3
- "version": "1.7.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:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
14
- "publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public",
15
- "test": "npm run compile && mocha"
16
- },
17
- "mocha": {
18
- "recursive": true,
19
- "reporter": "progress",
20
- "spec": "build/test/**/*.js",
21
- "require": "source-map-support/register"
22
- },
23
- "keywords": [
24
- "ABAP",
25
- "abaplint"
26
- ],
27
- "author": "abaplint",
28
- "license": "MIT",
29
- "dependencies": {
30
- "hdb": "^0.19.1",
31
- "sql.js": "^1.6.2"
32
- },
33
- "devDependencies": {
34
- "@types/chai": "^4.3.0",
35
- "@types/mocha": "^9.0.0",
36
- "@types/sql.js": "^1.4.3",
37
- "chai": "^4.3.4",
38
- "mocha": "^9.1.4",
39
- "source-map-support": "^0.5.21",
40
- "typescript": "^4.5.4"
41
- }
42
- }
1
+ {
2
+ "name": "@abaplint/runtime",
3
+ "version": "1.7.18",
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:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
14
+ "publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public",
15
+ "test": "npm run compile && mocha"
16
+ },
17
+ "mocha": {
18
+ "recursive": true,
19
+ "reporter": "progress",
20
+ "spec": "build/test/**/*.js",
21
+ "require": "source-map-support/register"
22
+ },
23
+ "keywords": [
24
+ "ABAP",
25
+ "abaplint"
26
+ ],
27
+ "author": "abaplint",
28
+ "license": "MIT",
29
+ "dependencies": {
30
+ "hdb": "^0.19.1",
31
+ "sql.js": "^1.6.2"
32
+ },
33
+ "devDependencies": {
34
+ "@types/chai": "^4.3.0",
35
+ "@types/mocha": "^9.0.0",
36
+ "@types/sql.js": "^1.4.3",
37
+ "chai": "^4.3.4",
38
+ "mocha": "^9.1.4",
39
+ "source-map-support": "^0.5.21",
40
+ "typescript": "^4.5.4"
41
+ }
42
+ }