Skip to content

Commit 3d46183

Browse files
committed
WIP to relax type predicates for objects and array-likes
1 parent 323d58b commit 3d46183

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/partial.lenses.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ const lensFrom = (get, set) => i => (x, _i, F, xi2yF) =>
249249

250250
//
251251

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

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

648648
export const seemsArrayLike = x =>
649-
x instanceof Object && (x = x.length, x === (x >> 0) && 0 <= x) ||
650-
I.isString(x)
649+
null != x && (x = x.length, x === (x >> 0) && 0 <= x)
651650

652651
// Internals
653652

0 commit comments

Comments
 (0)