pareto-core-shorthands 0.1.14 → 0.2.1

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.
@@ -31,9 +31,10 @@ export declare namespace optional {
31
31
  }
32
32
  export declare const wrap_dictionary: <T>($: Raw_Or_Normal_Dictionary<T>) => Dictionary<_pi.Deprecated_Source_Location, T>;
33
33
  export declare const wrap_list: <T>($: Raw_Or_Normal_List<T>) => List<_pi.Deprecated_Source_Location, T>;
34
- export declare const wrap_state_group: <T>($: T) => {
34
+ export declare const wrap_state_group: <T extends readonly [string, any]>($: T) => {
35
35
  location: _pi.Deprecated_Source_Location;
36
36
  'state group': T;
37
37
  };
38
+ export declare const wrap_optional: <T>($: T | null | undefined) => _pi.Optional_Value<T>;
38
39
  export declare const wrap_reference: <T>($: string) => Reference_To_Normal_Dictionary_Entry<_pi.Deprecated_Source_Location, T>;
39
40
  export declare const wrap_stack_reference: <T>(name: string) => Reference_To_Stacked_Dictionary_Entry<_pi.Deprecated_Source_Location, T>;
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
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.optional = void 0;
26
+ exports.wrap_stack_reference = exports.wrap_reference = exports.wrap_optional = exports.wrap_state_group = exports.wrap_list = exports.wrap_dictionary = exports.optional = void 0;
27
27
  const _pinternals = __importStar(require("pareto-core-internals/dist/sync/expression/initialize"));
28
28
  const get_location_info_1 = require("pareto-core-internals/dist/sync/get_location_info");
29
29
  //implementations
@@ -82,6 +82,15 @@ const wrap_state_group = ($) => {
82
82
  };
83
83
  };
84
84
  exports.wrap_state_group = wrap_state_group;
85
+ const wrap_optional = ($) => {
86
+ if ($ === null || $ === undefined) {
87
+ return _pinternals.optional.not_set();
88
+ }
89
+ else {
90
+ return _pinternals.optional.set($);
91
+ }
92
+ };
93
+ exports.wrap_optional = wrap_optional;
85
94
  const wrap_reference = ($) => {
86
95
  return {
87
96
  'location': (0, get_location_info_1.$$)(depth + 1),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pareto-core-shorthands",
3
- "version": "0.1.14",
3
+ "version": "0.2.1",
4
4
  "license": "ISC",
5
5
  "description": "the pareto package used for building datasets",
6
6
  "author": "Corno",
@@ -23,6 +23,6 @@
23
23
  "url": "git+https://github.com/corno/pareto-core-shorthands.git"
24
24
  },
25
25
  "dependencies": {
26
- "pareto-core-internals": "^0.24.45"
26
+ "pareto-core-internals": "^0.25.0"
27
27
  }
28
28
  }