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