@abaplint/runtime 1.7.36 → 1.7.40
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/build/src/statements/create_data.d.ts +3 -2
- package/build/src/statements/create_data.js +8 -0
- package/build/src/statements/get_run_time.d.ts +1 -2
- package/build/src/statements/get_run_time.js +10 -2
- package/build/src/statements/insert_internal.d.ts +1 -1
- package/build/src/statements/insert_internal.js +3 -0
- package/package.json +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { ABAPObject, DataReference, Structure, Table } from "../types";
|
|
1
|
+
import { ABAPObject, DataReference, FieldSymbol, Structure, Table } from "../types";
|
|
2
2
|
import { ICharacter } from "../types/_character";
|
|
3
3
|
import { INumeric } from "../types/_numeric";
|
|
4
|
-
declare type PointerType = INumeric | Table | ICharacter | ABAPObject | undefined | Structure;
|
|
4
|
+
declare type PointerType = INumeric | Table | ICharacter | ABAPObject | undefined | Structure | FieldSymbol;
|
|
5
5
|
export interface ICreateDataOptions {
|
|
6
6
|
table?: boolean;
|
|
7
7
|
name?: string;
|
|
8
8
|
type?: PointerType;
|
|
9
|
+
likeLineOf?: FieldSymbol | Table;
|
|
9
10
|
}
|
|
10
11
|
export declare function createData(target: DataReference, options?: ICreateDataOptions): void;
|
|
11
12
|
export {};
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createData = void 0;
|
|
4
4
|
const clone_1 = require("../clone");
|
|
5
|
+
const types_1 = require("../types");
|
|
5
6
|
function createData(target, options) {
|
|
7
|
+
// console.dir(options);
|
|
6
8
|
if ((options === null || options === void 0 ? void 0 : options.name) && (options === null || options === void 0 ? void 0 : options.table)) {
|
|
7
9
|
// @ts-ignore
|
|
8
10
|
if (abap.DDIC[options.name] === undefined) {
|
|
@@ -30,6 +32,12 @@ function createData(target, options) {
|
|
|
30
32
|
else if (options === null || options === void 0 ? void 0 : options.type) {
|
|
31
33
|
target.assign((0, clone_1.clone)(options.type));
|
|
32
34
|
}
|
|
35
|
+
else if (options === null || options === void 0 ? void 0 : options.likeLineOf) {
|
|
36
|
+
if (options.likeLineOf instanceof types_1.FieldSymbol) {
|
|
37
|
+
options.likeLineOf = options.likeLineOf.getPointer();
|
|
38
|
+
}
|
|
39
|
+
target.assign((0, clone_1.clone)(options.likeLineOf.getRowType()));
|
|
40
|
+
}
|
|
33
41
|
else {
|
|
34
42
|
target.assign((0, clone_1.clone)(target.getType()));
|
|
35
43
|
}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRunTime = void 0;
|
|
4
|
+
let prev = undefined;
|
|
4
5
|
function getRunTime(value) {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
if (prev === undefined) {
|
|
7
|
+
value.set(0);
|
|
8
|
+
prev = new Date().getTime();
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
const now = new Date().getTime();
|
|
12
|
+
value.set(now - prev);
|
|
13
|
+
prev = now;
|
|
14
|
+
}
|
|
7
15
|
}
|
|
8
16
|
exports.getRunTime = getRunTime;
|
|
9
17
|
//# sourceMappingURL=get_run_time.js.map
|
|
@@ -5,7 +5,7 @@ export interface IInsertInternalOptions {
|
|
|
5
5
|
index?: INumeric;
|
|
6
6
|
initial?: boolean;
|
|
7
7
|
data?: INumeric | ICharacter | Structure | ABAPObject | Table | string;
|
|
8
|
-
table: Table;
|
|
8
|
+
table: Table | FieldSymbol;
|
|
9
9
|
referenceInto?: DataReference;
|
|
10
10
|
assigning?: FieldSymbol;
|
|
11
11
|
lines?: boolean;
|
|
@@ -8,6 +8,9 @@ const read_table_1 = require("./read_table");
|
|
|
8
8
|
const sort_1 = require("./sort");
|
|
9
9
|
function insertInternal(options) {
|
|
10
10
|
var _a;
|
|
11
|
+
if (options.table instanceof types_1.FieldSymbol) {
|
|
12
|
+
options.table = options.table.getPointer();
|
|
13
|
+
}
|
|
11
14
|
const tableOptions = options.table.getOptions();
|
|
12
15
|
const isSorted = (tableOptions === null || tableOptions === void 0 ? void 0 : tableOptions.type) === types_1.TableAccessType.sorted || (tableOptions === null || tableOptions === void 0 ? void 0 : tableOptions.type) === types_1.TableAccessType.hashed;
|
|
13
16
|
if (isSorted) {
|