getExn -> get
This commit is contained in:
parent
9f103f5cbe
commit
25dce72f11
|
@ -5,17 +5,17 @@ let nameSpace = "PointSet"
|
||||||
let requiresNamespace = true
|
let requiresNamespace = true
|
||||||
|
|
||||||
let inputsToDist = (inputs: array<Reducer_T.value>, xyShapeToPointSetDist) => {
|
let inputsToDist = (inputs: array<Reducer_T.value>, xyShapeToPointSetDist) => {
|
||||||
// TODO - rewritein more functional/functor-based style
|
// TODO - rewrite in more functional/functor-based style
|
||||||
switch inputs {
|
switch inputs {
|
||||||
| [IEvArray(items)] => {
|
| [IEvArray(items)] => {
|
||||||
items->Belt.Array.map(
|
items->Belt.Array.map(
|
||||||
item =>
|
item =>
|
||||||
switch item {
|
switch item {
|
||||||
| IEvRecord(map) => {
|
| IEvRecord(map) => {
|
||||||
let xValue = map->Belt.Map.String.getExn("x")
|
let xValue = map->Belt.Map.String.get("x")
|
||||||
let yValue = map->Belt.Map.String.getExn("y")
|
let yValue = map->Belt.Map.String.get("y")
|
||||||
switch (xValue, yValue) {
|
switch (xValue, yValue) {
|
||||||
| (IEvNumber(x), IEvNumber(y)) => (x, y)
|
| (Some(IEvNumber(x)), Some(IEvNumber(y))) => (x, y)
|
||||||
| _ => impossibleError->Reducer_ErrorValue.toException
|
| _ => impossibleError->Reducer_ErrorValue.toException
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user