本文整理匯總了TypeScript中lodash.inRange函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript inRange函數的具體用法?TypeScript inRange怎麽用?TypeScript inRange使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了inRange函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: patchSupported
export function patchSupported(
edition: GameEdition,
from: PatchNumber,
to: PatchNumber,
at = (new Date()).getTime(),
) {
if (!from) { return false }
const nextPatchKey = sortedPatches[sortedPatches.indexOf(to) - 1]
const nextPatch = patchData[nextPatchKey]
const fromDate = getPatchDate(edition, from)
const toDate = nextPatch
? getPatchDate(edition, nextPatchKey)
: Infinity
return _.inRange(at, fromDate, toDate)
}
示例2: expect
expect(_.every(reply.data.filter(d => d.side === 'sell'), d => _.inRange(d.funds.btc, -1, -0.001))).toBe(true);
示例3: return
return _.filter(this.getAllAnimals(), (animal) => {
return (
_.inRange(animal.row, row - radius, row + radius + 1) &&
_.inRange(animal.col, col - radius, col + radius + 1)
);
});
示例4: return
return ([start, end]) => inRange(index, start + 1, end);