pareto-core-shorthands 0.2.14 → 0.2.15
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/unresolved_data.d.ts +43 -18
- package/dist/unresolved_data.js +56 -28
- package/package.json +1 -1
|
@@ -4,40 +4,65 @@ export type Raw_Or_Normal_Dictionary<T> = {
|
|
|
4
4
|
} | _pi.Dictionary<T>;
|
|
5
5
|
export type Raw_Or_Normal_List<T> = T[] | _pi.List<T>;
|
|
6
6
|
export type Raw_Optional<T> = null | undefined | T;
|
|
7
|
-
export type
|
|
8
|
-
readonly 'l
|
|
9
|
-
readonly 'l
|
|
10
|
-
};
|
|
11
|
-
export type Stack_Reference<G_Source> = {
|
|
12
|
-
readonly 'l value': string;
|
|
13
|
-
readonly 'l location': G_Source;
|
|
7
|
+
export type Component<T> = {
|
|
8
|
+
readonly 'l location': _pi.Deprecated_Source_Location;
|
|
9
|
+
readonly 'l component': T;
|
|
14
10
|
};
|
|
15
11
|
export type Dictionary<G_Source, T_D> = {
|
|
16
|
-
readonly 'l
|
|
12
|
+
readonly 'l location': G_Source;
|
|
13
|
+
readonly 'l dictionary': _pi.Dictionary<{
|
|
17
14
|
readonly 'l entry': T_D;
|
|
18
15
|
readonly 'l location': G_Source;
|
|
19
16
|
}>;
|
|
20
|
-
|
|
17
|
+
};
|
|
18
|
+
export type Group<T extends {
|
|
19
|
+
[id: string]: any;
|
|
20
|
+
}> = {
|
|
21
|
+
readonly 'l location': _pi.Deprecated_Source_Location;
|
|
22
|
+
readonly 'l group': T;
|
|
21
23
|
};
|
|
22
24
|
export type List<G_Source, T_L> = {
|
|
23
|
-
readonly 'l
|
|
25
|
+
readonly 'l list': _pi.List<{
|
|
24
26
|
readonly 'l item': T_L;
|
|
25
27
|
readonly 'l location': G_Source;
|
|
26
28
|
}>;
|
|
27
29
|
readonly 'l location': G_Source;
|
|
28
30
|
};
|
|
31
|
+
export type Nothing<G_Source> = {
|
|
32
|
+
readonly 'l location': G_Source;
|
|
33
|
+
readonly 'l nothing': null;
|
|
34
|
+
};
|
|
35
|
+
export type Number<G_Source> = {
|
|
36
|
+
readonly 'l location': G_Source;
|
|
37
|
+
readonly 'l number': number;
|
|
38
|
+
};
|
|
39
|
+
export type Reference<G_Source> = {
|
|
40
|
+
readonly 'l location': G_Source;
|
|
41
|
+
readonly 'l reference': string;
|
|
42
|
+
};
|
|
29
43
|
export type State<X> = {
|
|
30
44
|
readonly 'l location': _pi.Deprecated_Source_Location;
|
|
31
|
-
readonly 'l
|
|
45
|
+
readonly 'l state': X;
|
|
46
|
+
};
|
|
47
|
+
export type Text<G_Source> = {
|
|
48
|
+
readonly 'l location': G_Source;
|
|
49
|
+
readonly 'l text': string;
|
|
32
50
|
};
|
|
33
|
-
export declare namespace
|
|
51
|
+
export declare namespace optionalx {
|
|
34
52
|
const set: typeof import("pareto-core/dist/__internals/sync/expression/literals/optional").set;
|
|
35
53
|
const not_set: typeof import("pareto-core/dist/__internals/sync/expression/literals/optional").not_set;
|
|
36
54
|
const literal: <T>($: Raw_Optional<T>) => _pi.Optional_Value<T>;
|
|
37
55
|
}
|
|
38
|
-
export declare const
|
|
39
|
-
export declare const
|
|
40
|
-
export declare const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
export declare const component: <T>($: T) => Component<T>;
|
|
57
|
+
export declare const dictionary: <T>($: Raw_Or_Normal_Dictionary<T>) => Dictionary<_pi.Deprecated_Source_Location, T>;
|
|
58
|
+
export declare const group: <T>($: T) => {
|
|
59
|
+
readonly "l location": _pi.Deprecated_Source_Location;
|
|
60
|
+
readonly "l value": T;
|
|
61
|
+
};
|
|
62
|
+
export declare const list: <T>($: Raw_Or_Normal_List<T>) => List<_pi.Deprecated_Source_Location, T>;
|
|
63
|
+
export declare const nothing: () => Nothing<_pi.Deprecated_Source_Location>;
|
|
64
|
+
export declare const number: ($: number) => Number<_pi.Deprecated_Source_Location>;
|
|
65
|
+
export declare const optional: <T>($: T | null | undefined) => _pi.Optional_Value<T>;
|
|
66
|
+
export declare const reference: <T>($: string) => Reference<_pi.Deprecated_Source_Location>;
|
|
67
|
+
export declare const state: <T extends readonly [string, any]>($: T) => State<T>;
|
|
68
|
+
export declare const text: ($: string) => Text<_pi.Deprecated_Source_Location>;
|
package/dist/unresolved_data.js
CHANGED
|
@@ -33,25 +33,32 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
36
|
+
exports.text = exports.state = exports.reference = exports.optional = exports.number = exports.nothing = exports.list = exports.group = exports.dictionary = exports.component = exports.optionalx = void 0;
|
|
37
37
|
const _pinternals = __importStar(require("pareto-core/dist/__internals/sync/expression/initialize"));
|
|
38
38
|
const get_location_info_1 = require("pareto-core/dist/__internals/sync/get_location_info");
|
|
39
39
|
//implementations
|
|
40
40
|
const depth = 1;
|
|
41
|
-
var
|
|
42
|
-
(function (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
var optionalx;
|
|
42
|
+
(function (optionalx) {
|
|
43
|
+
optionalx.set = _pinternals.optional.set;
|
|
44
|
+
optionalx.not_set = _pinternals.optional.not_set;
|
|
45
|
+
optionalx.literal = ($) => {
|
|
46
46
|
if ($ === null || $ === undefined) {
|
|
47
|
-
return
|
|
47
|
+
return optionalx.not_set();
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
|
-
return
|
|
50
|
+
return optionalx.set($);
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
-
})(
|
|
54
|
-
const
|
|
53
|
+
})(optionalx || (exports.optionalx = optionalx = {}));
|
|
54
|
+
const component = ($) => {
|
|
55
|
+
return {
|
|
56
|
+
'l location': (0, get_location_info_1.$$)(depth + 1),
|
|
57
|
+
'l component': $,
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
exports.component = component;
|
|
61
|
+
const dictionary = ($) => {
|
|
55
62
|
const location = (0, get_location_info_1.$$)(depth + 1);
|
|
56
63
|
function is_normal($) {
|
|
57
64
|
return $.__get_number_of_entries !== undefined && typeof $.__get_number_of_entries === "function";
|
|
@@ -59,7 +66,7 @@ const wrap_dictionary = ($) => {
|
|
|
59
66
|
if (is_normal($)) {
|
|
60
67
|
return {
|
|
61
68
|
'l location': location,
|
|
62
|
-
'l
|
|
69
|
+
'l dictionary': $.__d_map(($) => ({
|
|
63
70
|
'l location': location,
|
|
64
71
|
'l entry': $,
|
|
65
72
|
}))
|
|
@@ -68,39 +75,53 @@ const wrap_dictionary = ($) => {
|
|
|
68
75
|
else {
|
|
69
76
|
return {
|
|
70
77
|
'l location': location,
|
|
71
|
-
'l
|
|
78
|
+
'l dictionary': _pinternals.dictionary.literal($).__d_map(($) => ({
|
|
72
79
|
'l location': location,
|
|
73
80
|
'l entry': $,
|
|
74
81
|
}))
|
|
75
82
|
};
|
|
76
83
|
}
|
|
77
84
|
};
|
|
78
|
-
exports.
|
|
79
|
-
const
|
|
85
|
+
exports.dictionary = dictionary;
|
|
86
|
+
const group = ($) => {
|
|
87
|
+
return {
|
|
88
|
+
'l location': (0, get_location_info_1.$$)(depth + 1),
|
|
89
|
+
'l value': $,
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
exports.group = group;
|
|
93
|
+
const list = ($) => {
|
|
80
94
|
const location = (0, get_location_info_1.$$)(depth + 1);
|
|
81
95
|
const decorated = $ instanceof Array
|
|
82
96
|
? _pinternals.list.literal($)
|
|
83
97
|
: $;
|
|
84
98
|
if (!(decorated.__for_each instanceof Function)) {
|
|
85
|
-
throw new Error("invalid input in '
|
|
99
|
+
throw new Error("invalid input in 'list'");
|
|
86
100
|
}
|
|
87
101
|
return {
|
|
88
102
|
'l location': location,
|
|
89
|
-
'l
|
|
103
|
+
'l list': decorated.__l_map(($) => ({
|
|
90
104
|
'l location': location,
|
|
91
105
|
'l item': $,
|
|
92
106
|
}))
|
|
93
107
|
};
|
|
94
108
|
};
|
|
95
|
-
exports.
|
|
96
|
-
const
|
|
109
|
+
exports.list = list;
|
|
110
|
+
const nothing = () => {
|
|
97
111
|
return {
|
|
98
112
|
'l location': (0, get_location_info_1.$$)(depth + 1),
|
|
99
|
-
'l
|
|
113
|
+
'l nothing': null,
|
|
100
114
|
};
|
|
101
115
|
};
|
|
102
|
-
exports.
|
|
103
|
-
const
|
|
116
|
+
exports.nothing = nothing;
|
|
117
|
+
const number = ($) => {
|
|
118
|
+
return {
|
|
119
|
+
'l location': (0, get_location_info_1.$$)(depth + 1),
|
|
120
|
+
'l number': $,
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
exports.number = number;
|
|
124
|
+
const optional = ($) => {
|
|
104
125
|
if ($ === null || $ === undefined) {
|
|
105
126
|
return _pinternals.optional.not_set();
|
|
106
127
|
}
|
|
@@ -108,18 +129,25 @@ const wrap_optional = ($) => {
|
|
|
108
129
|
return _pinternals.optional.set($);
|
|
109
130
|
}
|
|
110
131
|
};
|
|
111
|
-
exports.
|
|
112
|
-
const
|
|
132
|
+
exports.optional = optional;
|
|
133
|
+
const reference = ($) => {
|
|
113
134
|
return {
|
|
114
135
|
'l location': (0, get_location_info_1.$$)(depth + 1),
|
|
115
|
-
'l
|
|
136
|
+
'l reference': $,
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
exports.reference = reference;
|
|
140
|
+
const state = ($) => {
|
|
141
|
+
return {
|
|
142
|
+
'l location': (0, get_location_info_1.$$)(depth + 1),
|
|
143
|
+
'l state': $,
|
|
116
144
|
};
|
|
117
145
|
};
|
|
118
|
-
exports.
|
|
119
|
-
const
|
|
146
|
+
exports.state = state;
|
|
147
|
+
const text = ($) => {
|
|
120
148
|
return {
|
|
121
149
|
'l location': (0, get_location_info_1.$$)(depth + 1),
|
|
122
|
-
'l
|
|
150
|
+
'l text': $,
|
|
123
151
|
};
|
|
124
152
|
};
|
|
125
|
-
exports.
|
|
153
|
+
exports.text = text;
|