本文整理汇总了TypeScript中ramda.drop函数的典型用法代码示例。如果您正苦于以下问题:TypeScript drop函数的具体用法?TypeScript drop怎么用?TypeScript drop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drop函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: verifyNode
function verifyNode(node: ITreeNode, path: string[]) {
expect(node.id).toEqual(path[0]);
expect(node.text).toEqual(path[0]);
if (path.length === 1) {
expect(node.children === null || node.children.length === 0);
} else {
expect(node.children.length).toBe(1);
verifyNode(node.children[0], R.drop(1, path));
}
}
示例2: sort
public static sort(unsorted: number [] = []): number[] {
if (unsorted.length !== 0) {
const sorted = [];
const m = R.head(unsorted);
const {l, h} = R.groupBy(curr => R.gte(curr, m) ? 'h' : 'l', R.drop(1, unsorted))
sorted.push(...QuickSort.sort(l));
sorted.push(m);
sorted.push(...QuickSort.sort(h));
return sorted;
} else
return unsorted;
}
示例3: head
export const pinNumbers = (observed: string): Array<String> => {
const lookUp = ['08', '124', '1235', '236', '1457', '24568', '3569', '478', '57890', '689'];
let obsHead: string = head(observed);
const heads = lookUp[obsHead];
if (observed.length <= 1)
return split('', heads);
const result = [];
for (const h of heads) {
for (const t of pinNumbers(drop(1, observed))) {
result.push(h + t)
}
}
return result
};
示例4: add
[isStrike, rolls => add(add(nth(1, rolls), nth(2, rolls)), bonus(drop(1, rolls)))],
示例5: bonus
[T, rolls => bonus(drop(2, rolls))],
示例6: nth
[isSpare, rolls => nth(2, rolls) + bonus(drop(2, rolls))],