Skip to content

Commit

Permalink
WIP to relax type predicates for objects and array-likes
Browse files Browse the repository at this point in the history
  • Loading branch information
polytypic committed Oct 21, 2017
1 parent 323d58b commit 3d46183
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/partial.lenses.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ const lensFrom = (get, set) => i => (x, _i, F, xi2yF) =>

//

const getProp = (k, o) => o instanceof Object ? o[k] : void 0
const getProp = (k, o) => null != o ? o[k] : void 0

const setProp = /*#__PURE__*/(process.env.NODE_ENV === "production" ? I.id : C.res(I.freeze))((k, v, o) =>
void 0 !== v ? I.assocPartialU(k, v, o) : I.dissocPartialU(k, o) || I.object0)
Expand Down Expand Up @@ -646,8 +646,7 @@ const pickInAux = (t, k) => [k, pickIn(t)]
// Auxiliary

export const seemsArrayLike = x =>
x instanceof Object && (x = x.length, x === (x >> 0) && 0 <= x) ||
I.isString(x)
null != x && (x = x.length, x === (x >> 0) && 0 <= x)

// Internals

Expand Down

0 comments on commit 3d46183

Please sign in to comment.