lineputscript 1.0.0

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/dist/core.js ADDED
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var chunk4SJFIYYU_js = require('./chunk-4SJFIYYU.js');
4
+ require('./chunk-MMWDSPQ5.js');
5
+ require('./chunk-5Q637EJJ.js');
6
+ require('./chunk-WZIZGAEG.js');
7
+
8
+
9
+
10
+ Object.defineProperty(exports, "LPS", {
11
+ enumerable: true,
12
+ get: function () { return chunk4SJFIYYU_js.LPS; }
13
+ });
14
+ Object.defineProperty(exports, "Line", {
15
+ enumerable: true,
16
+ get: function () { return chunk4SJFIYYU_js.Line; }
17
+ });
18
+ Object.defineProperty(exports, "LineDict", {
19
+ enumerable: true,
20
+ get: function () { return chunk4SJFIYYU_js.LineDict; }
21
+ });
22
+ Object.defineProperty(exports, "LpsDocument", {
23
+ enumerable: true,
24
+ get: function () { return chunk4SJFIYYU_js.LpsDocument; }
25
+ });
26
+ Object.defineProperty(exports, "Sub", {
27
+ enumerable: true,
28
+ get: function () { return chunk4SJFIYYU_js.Sub; }
29
+ });
package/dist/core.mjs ADDED
@@ -0,0 +1,4 @@
1
+ export { LPS, Line, LineDict, LpsDocument, Sub } from './chunk-JI4LI6KU.mjs';
2
+ import './chunk-X2OHQJFP.mjs';
3
+ import './chunk-OV7CLVHP.mjs';
4
+ import './chunk-4RRNVMEO.mjs';
@@ -0,0 +1,63 @@
1
+ declare class FInt64 {
2
+ readonly m_value: bigint;
3
+ private constructor();
4
+ static fromLong(value: bigint): FInt64;
5
+ static fromDouble(value: number): FInt64;
6
+ static fromNumber(value: number): FInt64;
7
+ static fromInt(value: number): FInt64;
8
+ static fromObject(value: unknown): FInt64;
9
+ toDouble(): number;
10
+ toStoreString(): string;
11
+ toString(): string;
12
+ isNaN(): boolean;
13
+ isNegativeInfinity(): boolean;
14
+ isPositiveInfinity(): boolean;
15
+ isFinite(): boolean;
16
+ isInfinity(): boolean;
17
+ isNegative(): boolean;
18
+ isNormal(): boolean;
19
+ toBoolean(): boolean;
20
+ toInt32(): number;
21
+ toInt64(): bigint;
22
+ add(other: FInt64): FInt64;
23
+ sub(other: FInt64): FInt64;
24
+ mul(other: FInt64): FInt64;
25
+ div(other: FInt64): FInt64;
26
+ addDouble(other: number): FInt64;
27
+ subDouble(other: number): FInt64;
28
+ mulDouble(other: number): FInt64;
29
+ divDouble(other: number): FInt64;
30
+ negate(): FInt64;
31
+ increment(): FInt64;
32
+ decrement(): FInt64;
33
+ and(other: FInt64): FInt64;
34
+ or(other: FInt64): FInt64;
35
+ xor(other: FInt64): FInt64;
36
+ not(): FInt64;
37
+ compareTo(other: FInt64): number;
38
+ equals(other: FInt64): boolean;
39
+ static parse(s: string): FInt64;
40
+ static tryParse(s: string | null | undefined): {
41
+ result: FInt64;
42
+ success: boolean;
43
+ };
44
+ static readonly Anchor = 1000000000n;
45
+ static readonly Anchord = 1000000000;
46
+ static readonly MinValue: FInt64;
47
+ static readonly MaxValue: FInt64;
48
+ static readonly NaN: FInt64;
49
+ static readonly NegativeInfinity: FInt64;
50
+ static readonly PositiveInfinity: FInt64;
51
+ static readonly Zero: FInt64;
52
+ static readonly One: FInt64;
53
+ static readonly NegativeOne: FInt64;
54
+ static readonly AdditiveIdentity: FInt64;
55
+ static readonly MultiplicativeIdentity: FInt64;
56
+ static isFinite(d: FInt64): boolean;
57
+ static isInfinity(d: FInt64): boolean;
58
+ static isNaNStatic(d: FInt64): boolean;
59
+ static isNegative(d: FInt64): boolean;
60
+ static isNormal(d: FInt64): boolean;
61
+ }
62
+
63
+ export { FInt64 as F };
@@ -0,0 +1,5 @@
1
+ export { LPS, Line, LineDict, LpsDocument, Sub } from './core.js';
2
+ export { ILine, ILpsDocument, ISetObject, ISub } from './types.js';
3
+ export { F as FInt64 } from './fint64-C-6kmcgU.js';
4
+ export { getHashCode, getHashCode32, splitLimited, textDeReplace, textReplace } from './utils.js';
5
+ export { StringStructure } from './structure.js';
package/dist/index.js ADDED
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ var chunk4SJFIYYU_js = require('./chunk-4SJFIYYU.js');
4
+ require('./chunk-AER7UDD4.js');
5
+ var chunkMMWDSPQ5_js = require('./chunk-MMWDSPQ5.js');
6
+ require('./chunk-4R46Q3P5.js');
7
+ var chunk5Q637EJJ_js = require('./chunk-5Q637EJJ.js');
8
+ var chunkWZIZGAEG_js = require('./chunk-WZIZGAEG.js');
9
+
10
+
11
+
12
+ Object.defineProperty(exports, "LPS", {
13
+ enumerable: true,
14
+ get: function () { return chunk4SJFIYYU_js.LPS; }
15
+ });
16
+ Object.defineProperty(exports, "Line", {
17
+ enumerable: true,
18
+ get: function () { return chunk4SJFIYYU_js.Line; }
19
+ });
20
+ Object.defineProperty(exports, "LineDict", {
21
+ enumerable: true,
22
+ get: function () { return chunk4SJFIYYU_js.LineDict; }
23
+ });
24
+ Object.defineProperty(exports, "LpsDocument", {
25
+ enumerable: true,
26
+ get: function () { return chunk4SJFIYYU_js.LpsDocument; }
27
+ });
28
+ Object.defineProperty(exports, "Sub", {
29
+ enumerable: true,
30
+ get: function () { return chunk4SJFIYYU_js.Sub; }
31
+ });
32
+ Object.defineProperty(exports, "getHashCode", {
33
+ enumerable: true,
34
+ get: function () { return chunkMMWDSPQ5_js.getHashCode; }
35
+ });
36
+ Object.defineProperty(exports, "getHashCode32", {
37
+ enumerable: true,
38
+ get: function () { return chunkMMWDSPQ5_js.getHashCode32; }
39
+ });
40
+ Object.defineProperty(exports, "StringStructure", {
41
+ enumerable: true,
42
+ get: function () { return chunk5Q637EJJ_js.StringStructure; }
43
+ });
44
+ Object.defineProperty(exports, "FInt64", {
45
+ enumerable: true,
46
+ get: function () { return chunkWZIZGAEG_js.FInt64; }
47
+ });
48
+ Object.defineProperty(exports, "splitLimited", {
49
+ enumerable: true,
50
+ get: function () { return chunkWZIZGAEG_js.splitLimited; }
51
+ });
52
+ Object.defineProperty(exports, "textDeReplace", {
53
+ enumerable: true,
54
+ get: function () { return chunkWZIZGAEG_js.textDeReplace; }
55
+ });
56
+ Object.defineProperty(exports, "textReplace", {
57
+ enumerable: true,
58
+ get: function () { return chunkWZIZGAEG_js.textReplace; }
59
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,6 @@
1
+ export { LPS, Line, LineDict, LpsDocument, Sub } from './chunk-JI4LI6KU.mjs';
2
+ import './chunk-IV3K5WDK.mjs';
3
+ export { getHashCode, getHashCode32 } from './chunk-X2OHQJFP.mjs';
4
+ import './chunk-7GX2NBJV.mjs';
5
+ export { StringStructure } from './chunk-OV7CLVHP.mjs';
6
+ export { FInt64, splitLimited, textDeReplace, textReplace } from './chunk-4RRNVMEO.mjs';
@@ -0,0 +1,36 @@
1
+ import { F as FInt64 } from './fint64-C-6kmcgU.js';
2
+
3
+ declare class StringStructure {
4
+ private setstr;
5
+ private getstr;
6
+ single: boolean;
7
+ private _cache;
8
+ constructor(setstr: (value: string) => void, getstr: () => string, single?: boolean);
9
+ private get cache();
10
+ private set cache(value);
11
+ getString(key: string, defaultValue?: string | null): string | null;
12
+ setString(key: string, value: string | null): void;
13
+ get(key: string): string;
14
+ set(key: string, value: string): void;
15
+ getBool(key: string, defaultValue?: boolean): boolean;
16
+ setBool(key: string, value: boolean): void;
17
+ getInt(key: string, defaultValue?: number): number;
18
+ setInt(key: string, value: number): void;
19
+ getInt64(key: string, defaultValue?: bigint): bigint;
20
+ setInt64(key: string, value: bigint): void;
21
+ getFloat(key: string, defaultValue?: FInt64): FInt64;
22
+ setFloat(key: string, value: FInt64): void;
23
+ getDateTime(key: string, defaultValue?: Date): Date | null;
24
+ setDateTime(key: string, value: Date): void;
25
+ getDouble(key: string, defaultValue?: number): number;
26
+ setDouble(key: string, value: number): void;
27
+ containsKey(key: string): boolean;
28
+ get keys(): string[];
29
+ get values(): string[];
30
+ get count(): number;
31
+ clear(): void;
32
+ remove(key: string): boolean;
33
+ [Symbol.iterator](): Iterator<[string, string]>;
34
+ }
35
+
36
+ export { StringStructure };
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ require('./chunk-4R46Q3P5.js');
4
+ var chunk5Q637EJJ_js = require('./chunk-5Q637EJJ.js');
5
+ require('./chunk-WZIZGAEG.js');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, "StringStructure", {
10
+ enumerable: true,
11
+ get: function () { return chunk5Q637EJJ_js.StringStructure; }
12
+ });
@@ -0,0 +1,3 @@
1
+ import './chunk-7GX2NBJV.mjs';
2
+ export { StringStructure } from './chunk-OV7CLVHP.mjs';
3
+ import './chunk-4RRNVMEO.mjs';
@@ -0,0 +1,147 @@
1
+ import { F as FInt64 } from './fint64-C-6kmcgU.js';
2
+ import { StringStructure } from './structure.js';
3
+
4
+ interface ISetObject {
5
+ getStoreString(): string;
6
+ getString(): string;
7
+ getInteger64(): bigint;
8
+ getInteger(): number;
9
+ getDouble(): number;
10
+ getFloat(): FInt64;
11
+ getDateTime(): Date;
12
+ getBoolean(): boolean;
13
+ setString(value: string): void;
14
+ setInteger(value: number): void;
15
+ setInteger64(value: bigint): void;
16
+ setDouble(value: number): void;
17
+ setFloat(value: FInt64): void;
18
+ setDateTime(value: Date): void;
19
+ setBoolean(value: boolean): void;
20
+ }
21
+ interface ISub extends ISetObject {
22
+ name: string;
23
+ info: string;
24
+ infoDisplay: string;
25
+ infoToInt: number;
26
+ infoToInt64: bigint;
27
+ infoToDouble: number;
28
+ infoToBoolean: boolean;
29
+ infos: StringStructure;
30
+ load(lps: string): void;
31
+ load(name: string, info: string): void;
32
+ set(other: ISub): void;
33
+ getInfo(): string;
34
+ getInfos(): string[];
35
+ first(): string | null;
36
+ last(): string | null;
37
+ getLongHashCode(): bigint;
38
+ }
39
+ interface ILine extends ISub {
40
+ text: string;
41
+ textDisplay: string;
42
+ textToInt: number;
43
+ textToInt64: bigint;
44
+ textToDouble: number;
45
+ comments: string;
46
+ texts: StringStructure;
47
+ getText(): string;
48
+ load(lps: string): void;
49
+ load(name: string, info: string, text?: string, subs?: ISub[]): void;
50
+ load(line: ILine): void;
51
+ subs: ISub[];
52
+ addSub(newSub: ISub): void;
53
+ addorReplaceSub(newSub: ISub): void;
54
+ addRange(newSubs: ISub[]): void;
55
+ insertSub(index: number, newSub: ISub): void;
56
+ insertRange(index: number, newSubs: ISub[]): void;
57
+ remove(sub: ISub): boolean;
58
+ removeByName(subName: string): boolean;
59
+ removeAll(subName: string): void;
60
+ removeAt(index: number): void;
61
+ contains(sub: ISub): boolean;
62
+ containsByName(value: string): boolean;
63
+ find(subName: string): ISub | null;
64
+ find(subName: string, subinfo: string): ISub | null;
65
+ findInfo(subinfo: string): ISub | null;
66
+ findAll(subName: string): ISub[];
67
+ findAll(subName: string, subinfo: string): ISub[];
68
+ findAllInfo(subinfo: string): ISub[];
69
+ findorAdd(subName: string): ISub;
70
+ searchAll(value: string): ISub[];
71
+ search(value: string): ISub | null;
72
+ indexOf(subName: string): number;
73
+ indexsOf(subName: string): number[];
74
+ getSubBool(subName: string): boolean;
75
+ setSubBool(subName: string, value: boolean): void;
76
+ getSubInt(subName: string, defaultValue?: number): number;
77
+ setSubInt(subName: string, value: number): void;
78
+ getSubInt64(subName: string, defaultValue?: bigint): bigint;
79
+ setSubInt64(subName: string, value: bigint): void;
80
+ getSubFloat(subName: string, defaultValue?: FInt64): FInt64;
81
+ setSubFloat(subName: string, value: FInt64): void;
82
+ getSubDateTime(subName: string, defaultValue?: Date): Date | null;
83
+ setSubDateTime(subName: string, value: Date): void;
84
+ getSubString(subName: string, defaultValue?: string | null): string | null;
85
+ setSubString(subName: string, value: string | null): void;
86
+ getSubDouble(subName: string, defaultValue?: number): number;
87
+ setSubDouble(subName: string, value: number): void;
88
+ toList(): ISub[];
89
+ toString(sb?: string[]): string;
90
+ }
91
+ interface ILpsDocument {
92
+ assemblage: ILine[];
93
+ addLine(newLine: ILine): void;
94
+ addorReplaceLine(newLine: ILine): void;
95
+ addRange(newLines: ILine[]): void;
96
+ insertLine(index: number, newLine: ILine): void;
97
+ insertRange(index: number, newLines: ILine[]): void;
98
+ remove(target: ILine | string): boolean;
99
+ removeAll(target: ILine | string): void;
100
+ removeAt(index: number): void;
101
+ contains(target: ILine | ISub): boolean;
102
+ containsLine(value: string): boolean;
103
+ containsSub(value: string): boolean;
104
+ findLine(lineName: string): ILine | null;
105
+ findLine(lineName: string, lineinfo: string): ILine | null;
106
+ findLineInfo(lineinfo: string): ILine | null;
107
+ findorAddLine(lineName: string): ILine;
108
+ findAllLine(lineName: string): ILine[];
109
+ findAllLine(lineName: string, lineinfo: string): ILine[];
110
+ findAllLineInfo(lineinfo: string): ILine[];
111
+ findSub(subName: string): ISub | null;
112
+ findSub(subName: string, subinfo: string): ISub | null;
113
+ findSubInfo(subinfo: string): ISub | null;
114
+ findAllSub(subName: string): ISub[];
115
+ findAllSub(subName: string, subinfo: string): ISub[];
116
+ findAllSubInfo(subinfo: string): ISub[];
117
+ searchAllLine(value: string): ILine[];
118
+ searchLine(value: string): ILine | null;
119
+ searchAllSub(value: string): ISub[];
120
+ searchSub(value: string): ISub | null;
121
+ indexOf(lineName: string): number;
122
+ indexsOf(lineName: string): number[];
123
+ load(lps: string): void;
124
+ load(lines: ILine[]): void;
125
+ first(): ILine | null;
126
+ last(): ILine | null;
127
+ getLongHashCode(): bigint;
128
+ toString(): string;
129
+ getLineBool(lineName: string): boolean;
130
+ setLineBool(lineName: string, value: boolean): void;
131
+ getLineInt(lineName: string, defaultValue?: number): number;
132
+ setLineInt(lineName: string, value: number): void;
133
+ getLineInt64(lineName: string, defaultValue?: bigint): bigint;
134
+ setLineInt64(lineName: string, value: bigint): void;
135
+ getLineString(lineName: string, defaultValue?: string | null): string | null;
136
+ setLineString(lineName: string, value: string | null): void;
137
+ getLineDouble(lineName: string, defaultValue?: number): number;
138
+ setLineDouble(lineName: string, value: number): void;
139
+ getLineFloat(lineName: string, defaultValue?: FInt64): FInt64;
140
+ setLineFloat(lineName: string, value: FInt64): void;
141
+ getLineDateTime(lineName: string, defaultValue?: Date): Date | null;
142
+ setLineDateTime(lineName: string, value: Date): void;
143
+ readonly length: number;
144
+ readonly count: number;
145
+ }
146
+
147
+ export type { ILine, ILpsDocument, ISetObject, ISub };
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
package/dist/types.mjs ADDED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,11 @@
1
+ export { F as FInt64 } from './fint64-C-6kmcgU.js';
2
+
3
+ declare function textReplace(text: string | null | undefined): string;
4
+ declare function textDeReplace(text: string | null | undefined): string;
5
+
6
+ declare function getHashCode(text: string): bigint;
7
+ declare function getHashCode32(text: string): number;
8
+
9
+ declare function splitLimited(text: string, separator: string, count?: number): string[];
10
+
11
+ export { getHashCode, getHashCode32, splitLimited, textDeReplace, textReplace };
package/dist/utils.js ADDED
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ require('./chunk-AER7UDD4.js');
4
+ var chunkMMWDSPQ5_js = require('./chunk-MMWDSPQ5.js');
5
+ var chunkWZIZGAEG_js = require('./chunk-WZIZGAEG.js');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, "getHashCode", {
10
+ enumerable: true,
11
+ get: function () { return chunkMMWDSPQ5_js.getHashCode; }
12
+ });
13
+ Object.defineProperty(exports, "getHashCode32", {
14
+ enumerable: true,
15
+ get: function () { return chunkMMWDSPQ5_js.getHashCode32; }
16
+ });
17
+ Object.defineProperty(exports, "FInt64", {
18
+ enumerable: true,
19
+ get: function () { return chunkWZIZGAEG_js.FInt64; }
20
+ });
21
+ Object.defineProperty(exports, "splitLimited", {
22
+ enumerable: true,
23
+ get: function () { return chunkWZIZGAEG_js.splitLimited; }
24
+ });
25
+ Object.defineProperty(exports, "textDeReplace", {
26
+ enumerable: true,
27
+ get: function () { return chunkWZIZGAEG_js.textDeReplace; }
28
+ });
29
+ Object.defineProperty(exports, "textReplace", {
30
+ enumerable: true,
31
+ get: function () { return chunkWZIZGAEG_js.textReplace; }
32
+ });
package/dist/utils.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import './chunk-IV3K5WDK.mjs';
2
+ export { getHashCode, getHashCode32 } from './chunk-X2OHQJFP.mjs';
3
+ export { FInt64, splitLimited, textDeReplace, textReplace } from './chunk-4RRNVMEO.mjs';
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "lineputscript",
3
+ "version": "1.0.0",
4
+ "description": "JavaScript/TypeScript SDK for the LinePutScript (LPS) data format",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ },
14
+ "./core": {
15
+ "types": "./dist/core.d.ts",
16
+ "import": "./dist/core.mjs",
17
+ "require": "./dist/core.js"
18
+ },
19
+ "./utils": {
20
+ "types": "./dist/utils.d.ts",
21
+ "import": "./dist/utils.mjs",
22
+ "require": "./dist/utils.js"
23
+ },
24
+ "./types": {
25
+ "types": "./dist/types.d.ts",
26
+ "import": "./dist/types.mjs",
27
+ "require": "./dist/types.js"
28
+ },
29
+ "./structure": {
30
+ "types": "./dist/structure.d.ts",
31
+ "import": "./dist/structure.mjs",
32
+ "require": "./dist/structure.js"
33
+ }
34
+ },
35
+ "typesVersions": {
36
+ "*": {
37
+ "core": ["./dist/core.d.ts"],
38
+ "utils": ["./dist/utils.d.ts"],
39
+ "types": ["./dist/types.d.ts"],
40
+ "structure": ["./dist/structure.d.ts"]
41
+ }
42
+ },
43
+ "sideEffects": false,
44
+ "files": [
45
+ "dist"
46
+ ],
47
+ "scripts": {
48
+ "build": "tsup && node scripts/clean-dist.mjs",
49
+ "test": "vitest run",
50
+ "test:watch": "vitest",
51
+ "lint": "tsc --noEmit",
52
+ "prepublishOnly": "npm run lint && npm run test && npm run build"
53
+ },
54
+ "devDependencies": {
55
+ "@types/node": "^25.6.0",
56
+ "tsup": "^8.0.0",
57
+ "typescript": "^5.4.0",
58
+ "vitest": "^1.6.0"
59
+ },
60
+ "engines": {
61
+ "node": ">=18"
62
+ },
63
+ "license": "MIT",
64
+ "repository": {
65
+ "type": "git",
66
+ "url": "git+https://github.com/YIYuNCU/LinePutScript.git",
67
+ "directory": "packages/lineputscript-js"
68
+ },
69
+ "keywords": [
70
+ "lps",
71
+ "lineputscript",
72
+ "vpet",
73
+ "parser",
74
+ "data-format",
75
+ "hierarchical",
76
+ "key-value",
77
+ "structured-text"
78
+ ],
79
+ "author": "YIYuNCU",
80
+ "bugs": {
81
+ "url": "https://github.com/YIYuNCU/LinePutScript/issues"
82
+ },
83
+ "homepage": "https://github.com/YIYuNCU/LinePutScript/tree/JS#readme"
84
+ }