aang 2.0.0-alpha.8 → 2.0.0-alpha.9

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/lib/option.d.ts CHANGED
@@ -10,6 +10,7 @@ declare abstract class OptionMethods {
10
10
  safeExtract<A>(this: Option<A>, getDefaultValue: () => A): A;
11
11
  unsafeExtract<A>(this: Option<A>, error: Exception | string): A;
12
12
  toResult<E, A>(this: Option<A>, getError: () => E): Result<E, A>;
13
+ [Symbol.iterator]<A>(this: Option<A>): Generator<A, void, undefined>;
13
14
  }
14
15
  export declare class Some<out A> extends OptionMethods {
15
16
  readonly value: A;
package/lib/option.js CHANGED
@@ -22,6 +22,10 @@ class OptionMethods {
22
22
  toResult(getError) {
23
23
  return this.isSome ? new Success(this.value) : new Failure(getError());
24
24
  }
25
+ *[Symbol.iterator]() {
26
+ if (this.isSome)
27
+ yield this.value;
28
+ }
25
29
  }
26
30
  export class Some extends OptionMethods {
27
31
  value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aang",
3
- "version": "2.0.0-alpha.8",
3
+ "version": "2.0.0-alpha.9",
4
4
  "description": "A powerful functional programming library for TypeScript.",
5
5
  "keywords": [
6
6
  "aang",