exupery-core-internals 0.2.0 → 0.3.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.
@@ -23,7 +23,7 @@ class Array_Class {
23
23
  $i($);
24
24
  });
25
25
  }
26
- __get_length() {
26
+ __get_number_of_elements() {
27
27
  return this.data.length;
28
28
  }
29
29
  __get_element_at(index) {
@@ -19,15 +19,7 @@ class Dictionary {
19
19
  };
20
20
  }));
21
21
  }
22
- __map_with_key($v) {
23
- return new Dictionary(this.source.map(($) => {
24
- return {
25
- key: $.key,
26
- value: $v($.value, $.key),
27
- };
28
- }));
29
- }
30
- to_array(compare) {
22
+ deprecated_to_array(compare) {
31
23
  const sorted_keys = this.source.slice().sort(compare);
32
24
  return (0, array_literal_1.array_literal)(sorted_keys);
33
25
  }
@@ -40,29 +32,8 @@ class Dictionary {
40
32
  }
41
33
  return (0, not_set_1.not_set)();
42
34
  }
43
- __add_entry_if_not_exists(key, value) {
44
- for (let i = 0; i !== this.source.length; i += 1) {
45
- const element = this.source[i];
46
- if (element.key === key) {
47
- return this;
48
- }
49
- }
50
- return new Dictionary([...this.source, { key: key, value: value }]);
51
- }
52
- __add_entry_overwrite_if_exists(key, value) {
53
- return new Dictionary(this.source.map((entry) => {
54
- if (entry.key === key) {
55
- return { key: key, value: value };
56
- }
57
- else {
58
- return entry;
59
- }
60
- }));
61
- }
62
- __remove_entry_if_exists(key) {
63
- return new Dictionary(this.source.filter((entry) => {
64
- return entry.key !== key;
65
- }));
35
+ __get_number_of_entries() {
36
+ return this.source.length;
66
37
  }
67
38
  }
68
39
  /**
package/dist/index.d.ts CHANGED
@@ -7,5 +7,4 @@ export * from "./imp/public/block";
7
7
  export * from "./imp/public/switch_state";
8
8
  export * from "./imp/public/set";
9
9
  export * from "./imp/public/not_set";
10
- export * from "./transformation";
11
10
  export * from "./refinement";
package/dist/index.js CHANGED
@@ -23,5 +23,4 @@ __exportStar(require("./imp/public/block"), exports);
23
23
  __exportStar(require("./imp/public/switch_state"), exports);
24
24
  __exportStar(require("./imp/public/set"), exports);
25
25
  __exportStar(require("./imp/public/not_set"), exports);
26
- __exportStar(require("./transformation"), exports);
27
26
  __exportStar(require("./refinement"), exports);
@@ -1,17 +1,5 @@
1
- export interface Refinement_Result<T, E> {
2
- /**
3
- * @param set what to do when the value was set, returns the new type
4
- * @param not_set what to do when the value was not set, returns the new type
5
- */
6
- process(success: ($: T) => void, exception: ($: E) => void): void;
7
- map<NT, NE>(handle_value: ($: T) => NT, handle_exception: ($: E) => NE): Refinement_Result<NT, NE>;
8
- map_result<NT>(handle_value: ($: T) => NT): Refinement_Result<NT, E>;
9
- transform<NT>(handle_value: ($: T) => NT, handle_exception: ($: E) => NT): NT;
10
- with_result<NT>(handle_value: ($: T) => Refinement_Result<NT, E>): Refinement_Result<NT, E>;
11
- }
12
- export type Refinement_With_Parameters<In, Parameters, Out, Error> = ($: In, $p: Parameters) => Refinement_Result<Out, Error>;
13
- export type Refinement_Without_Parameters<In, Out, Error> = ($: In) => Refinement_Result<Out, Error>;
1
+ import * as _et from 'exupery-core-types';
14
2
  export declare namespace refinement {
15
- const failed: <T, E>(exception: E) => Refinement_Result<T, E>;
16
- const successful: <T, E>(value: T) => Refinement_Result<T, E>;
3
+ const failed: <T, E>(exception: E) => _et.Refinement_Result<T, E>;
4
+ const successful: <T, E>(value: T) => _et.Refinement_Result<T, E>;
17
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exupery-core-internals",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "license": "ISC",
5
5
  "description": "",
6
6
  "author": "Corno",
@@ -15,7 +15,7 @@
15
15
  "url": "https://github.com/corno/exupery-core/issues"
16
16
  },
17
17
  "dependencies": {
18
- "exupery-core-types": "^0.2.0"
18
+ "exupery-core-types": "^0.3.2"
19
19
  },
20
20
  "main": "./dist/index.js",
21
21
  "types": "dist/index.d.ts",
@@ -1,2 +0,0 @@
1
- export type Transformation_With_Parameters<In, Parameters, Out> = ($: In, $p: Parameters) => Out;
2
- export type Transformation_Without_Parameters<In, Out> = ($: In) => Out;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });