diff --git a/mod.test.ts b/mod.test.ts index 24545ab..94e8498 100644 --- a/mod.test.ts +++ b/mod.test.ts @@ -25,14 +25,6 @@ Rhum.testPlan("option", () => { }); }); - Rhum.testSuite("match", () => { - Rhum.testCase("should freeze value", () => { - const val = match("testi"); - - Rhum.asserts.assert(Object.isFrozen(val.unwrap())); - }); - }); - Rhum.testSuite("toOption", () => { Rhum.testCase("should return value", () => { const original: Option = "testi"; diff --git a/mod.ts b/mod.ts index 6adef45..aeca601 100644 --- a/mod.ts +++ b/mod.ts @@ -29,7 +29,7 @@ export function isNone(value: Option): value is None { * @param maybe Value that is possibly null or undefined */ export function match(maybe: Option): Matcher { - return new Matcher(Object.freeze(maybe)); + return new Matcher(maybe); } interface isSomeArg { @@ -123,7 +123,7 @@ export class Matcher { */ unwrapOr(defaultValue: T): Some> { if (isNone(this._value)) { - return Object.freeze(defaultValue); + return defaultValue; } return this._value;