本文整理匯總了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))