semantic-typescript 0.0.4 → 0.0.5

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.
@@ -148,7 +148,7 @@ export declare abstract class Collectable<E> {
148
148
  findLast(): Optional<E>;
149
149
  forEach(action: BiConsumer<E, bigint>): void;
150
150
  group<K>(classifier: Functional<E, K>): Map<K, Array<E>>;
151
- groupBy<K, V>(keyExtractor: Functional<E, K>, valueExtractor: Functional<E, V>): Map<K, V>;
151
+ groupBy<K, V>(keyExtractor: Functional<E, K>, valueExtractor: Functional<E, V>): Map<K, Array<V>>;
152
152
  join(): string;
153
153
  join(delimiter: string): string;
154
154
  join(prefix: string, delimiter: string, suffix: string): string;
package/dist/semantic.js CHANGED
@@ -776,7 +776,9 @@ export class Collectable {
776
776
  }, (map, element) => {
777
777
  let key = keyExtractor(element);
778
778
  let value = valueExtractor(element);
779
- map.set(key, value);
779
+ let group = (validate(map.get(key)) ? map.get(key) : []);
780
+ group.push(value);
781
+ map.set(key, group);
780
782
  return map;
781
783
  }, (map) => {
782
784
  return map;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semantic-typescript",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",