exupery-core-data 0.1.0 → 0.1.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.
@@ -0,0 +1,18 @@
1
+ import * as _ei from 'exupery-core-internals';
2
+ import * as _et from 'exupery-core-types';
3
+ import * as pt from 'exupery-core-types';
4
+ export type Raw_Or_Normal_Dictionary<T> = {
5
+ [key: string]: T;
6
+ } | pt.Dictionary<T>;
7
+ export type Raw_Dictionary<T> = {
8
+ [key: string]: T;
9
+ };
10
+ export declare const to_raw_array: <T>($: pt.Array<T>) => readonly T[];
11
+ export type Dictionary<T_D> = _et.Dictionary<T_D>;
12
+ export type List<T_L> = _et.Array<T_L>;
13
+ export declare const wrap_dictionary: <T>($: Raw_Or_Normal_Dictionary<T>) => Dictionary<T>;
14
+ export declare const wrap_list: <T>($: T[]) => List<T>;
15
+ export declare const wrap_state_group: <T>($: T) => {
16
+ location: _ei.Source_Location;
17
+ 'state group': T;
18
+ };
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.wrap_state_group = exports.wrap_list = exports.wrap_dictionary = exports.to_raw_array = void 0;
27
+ const _ei = __importStar(require("exupery-core-internals"));
28
+ const to_raw_array = ($) => $.__get_raw_copy();
29
+ exports.to_raw_array = to_raw_array;
30
+ const wrap_dictionary = ($) => {
31
+ function is_normal($) {
32
+ return $.to_array !== undefined && typeof $.to_array === "function";
33
+ }
34
+ if (is_normal($)) {
35
+ return $;
36
+ }
37
+ else {
38
+ return _ei.dictionary_literal($);
39
+ }
40
+ };
41
+ exports.wrap_dictionary = wrap_dictionary;
42
+ const wrap_list = ($) => {
43
+ return _ei.array_literal($);
44
+ };
45
+ exports.wrap_list = wrap_list;
46
+ const wrap_state_group = ($) => {
47
+ return {
48
+ 'location': _ei.get_location_info(2),
49
+ 'state group': $,
50
+ };
51
+ };
52
+ exports.wrap_state_group = wrap_state_group;
@@ -0,0 +1,41 @@
1
+ import * as _ei from 'exupery-core-internals';
2
+ import * as _et from 'exupery-core-types';
3
+ import * as pt from 'exupery-core-types';
4
+ export type Raw_Or_Normal_Dictionary<T> = {
5
+ [key: string]: T;
6
+ } | pt.Dictionary<T>;
7
+ export type Raw_Dictionary<T> = {
8
+ [key: string]: T;
9
+ };
10
+ export type Reference_To_Normal_Dictionary_Entry<G_Source, T_Dictionary_Entry> = {
11
+ readonly 'key': string;
12
+ readonly 'location': G_Source;
13
+ };
14
+ export type Reference_To_Stacked_Dictionary_Entry<G_Source, T_Dictionary_Entry> = {
15
+ readonly 'key': string;
16
+ readonly 'location': G_Source;
17
+ readonly 'up steps': number;
18
+ };
19
+ export declare const to_raw_array: <T>($: pt.Array<T>) => readonly T[];
20
+ export type Dictionary<G_Source, T_D> = {
21
+ readonly 'dictionary': _et.Dictionary<{
22
+ readonly 'entry': T_D;
23
+ readonly 'location': G_Source;
24
+ }>;
25
+ readonly 'location': G_Source;
26
+ };
27
+ export type List<G_Source, T_L> = {
28
+ readonly 'list': _et.Array<{
29
+ readonly 'element': T_L;
30
+ readonly 'location': G_Source;
31
+ }>;
32
+ readonly 'location': G_Source;
33
+ };
34
+ export declare const wrap_dictionary: <T>($: Raw_Or_Normal_Dictionary<T>) => Dictionary<_ei.Source_Location, T>;
35
+ export declare const wrap_list: <T>($: T[]) => List<_ei.Source_Location, T>;
36
+ export declare const wrap_state_group: <T>($: T) => {
37
+ location: _ei.Source_Location;
38
+ 'state group': T;
39
+ };
40
+ export declare const wrap_reference: <T>($: string) => Reference_To_Normal_Dictionary_Entry<_ei.Source_Location, T>;
41
+ export declare const wrap_stack_reference: <T>(up_steps: number, name: string) => Reference_To_Stacked_Dictionary_Entry<_ei.Source_Location, T>;
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.wrap_stack_reference = exports.wrap_reference = exports.wrap_state_group = exports.wrap_list = exports.wrap_dictionary = exports.to_raw_array = void 0;
27
+ const _ei = __importStar(require("exupery-core-internals"));
28
+ const to_raw_array = ($) => $.__get_raw_copy();
29
+ exports.to_raw_array = to_raw_array;
30
+ const wrap_dictionary = ($) => {
31
+ const location = _ei.get_location_info(2);
32
+ function is_normal($) {
33
+ return $.to_array !== undefined && typeof $.to_array === "function";
34
+ }
35
+ if (is_normal($)) {
36
+ return {
37
+ 'location': location,
38
+ 'dictionary': $.map(($) => ({
39
+ 'location': location,
40
+ 'entry': $,
41
+ }))
42
+ };
43
+ }
44
+ else {
45
+ return {
46
+ 'location': location,
47
+ 'dictionary': _ei.dictionary_literal($).map(($) => ({
48
+ 'location': location,
49
+ 'entry': $,
50
+ }))
51
+ };
52
+ }
53
+ };
54
+ exports.wrap_dictionary = wrap_dictionary;
55
+ const wrap_list = ($) => {
56
+ const location = _ei.get_location_info(2);
57
+ return {
58
+ 'location': location,
59
+ 'list': _ei.array_literal($).map(($) => ({
60
+ 'location': location,
61
+ 'element': $,
62
+ }))
63
+ };
64
+ };
65
+ exports.wrap_list = wrap_list;
66
+ const wrap_state_group = ($) => {
67
+ return {
68
+ 'location': _ei.get_location_info(2),
69
+ 'state group': $,
70
+ };
71
+ };
72
+ exports.wrap_state_group = wrap_state_group;
73
+ const wrap_reference = ($) => {
74
+ return {
75
+ 'location': _ei.get_location_info(2),
76
+ 'key': $,
77
+ };
78
+ };
79
+ exports.wrap_reference = wrap_reference;
80
+ const wrap_stack_reference = (up_steps, name) => {
81
+ return {
82
+ 'location': _ei.get_location_info(2),
83
+ 'up steps': up_steps,
84
+ 'key': name,
85
+ };
86
+ };
87
+ exports.wrap_stack_reference = wrap_stack_reference;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exupery-core-data",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "license": "ISC",
5
5
  "description": "the Exupery package used for building datasets",
6
6
  "author": "Corno",