本文整理汇总了TypeScript中@jonggrang/prelude.deepEq函数的典型用法代码示例。如果您正苦于以下问题:TypeScript deepEq函数的具体用法?TypeScript deepEq怎么用?TypeScript deepEq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deepEq函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: deepEq
jsv.property('is inverse to encodePathSegments', jsv.array(jsv.string), segments =>
segments.length === 1 && segments[0] === '' ? true
: deepEq(decodePathSegments(encodePathSegments(segments)), segments)
示例2: saveSessionOnDb
export function saveSessionOnDb(
state: ServerSessionState,
now: number,
msess: Session | null,
dec: DecomposedSession
): StorageTx<Session | null> {
const storage = state.storage;
const ctx = storage.tx;
if (msess == null && dec.authId == null && isEmpty(dec.decomposed)) return ctx.of(null);
if (msess != null && state.timeoutResolution !== null && msess.authId === dec.authId && deepEq(msess.data, dec.decomposed)
&& Math.abs(msess.accessedAt - now) < (state.timeoutResolution * 1000)) {
return ctx.of(msess);
}
if (msess == null) {
return ctx.liftTask(generateSessionId)
.chain(id => {
const sess = createSession(id, dec.authId, dec.decomposed, now, now);
return storage.insert(sess).map(() => sess);
});
}
const sess = createSession(msess.id, dec.authId, dec.decomposed, msess.createdAt, now);
return storage.replace(sess).map(() => sess);
}
示例3: deepEq
function tEquals<A>(xs: [A, A]) {
return deepEq(xs[0], xs[1]);
}
示例4: intMapArb
jsv.property('filter keep all', intMapArb(jsv.number), im =>
P.deepEq(im, IM.filter(() => true, im))