@effect/match
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -117,3 +117,4 @@ "use strict"; | ||
const values = pattern.slice(0, -1); | ||
return self => self.add(new When(_ => typeof _ === "object" && _ != null && field in _ && values.includes(_[field]), f)); | ||
const pred = values.length === 1 ? _ => _[field] === values[0] : _ => values.includes(_[field]); | ||
return self => self.add(new When(pred, f)); | ||
}; | ||
@@ -253,4 +254,6 @@ /** | ||
} | ||
const len = self.cases.length; | ||
return input => { | ||
for (const _case of self.cases) { | ||
for (let i = 0; i < len; i++) { | ||
const _case = self.cases[i]; | ||
if (_case._tag === "When" && _case.guard(input)) { | ||
@@ -257,0 +260,0 @@ return E.right(_case.evaluate(input)); |
{ | ||
"name": "@effect/match", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87066
1214