@pacote/linked-list
Advanced tools
Comparing version 0.4.6 to 0.4.7
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.4.7](https://github.com/PacoteJS/pacote/compare/@pacote/linked-list@0.4.6...@pacote/linked-list@0.4.7) (2021-04-18) | ||
**Note:** Version bump only for package @pacote/linked-list | ||
## [0.4.6](https://github.com/PacoteJS/pacote/compare/@pacote/linked-list@0.4.5...@pacote/linked-list@0.4.6) (2021-04-15) | ||
@@ -8,0 +16,0 @@ |
@@ -44,3 +44,3 @@ "use strict"; | ||
function lastIndexOf(value, list) { | ||
return option_1.map(function (lastIndex) { return core_1.length(list) - lastIndex - 1; }, recursiveFind(function (current) { return current === value; }, function (_, index) { return option_1.Some(index); }, function () { return option_1.None; }, core_1.reverse(list), 0)); | ||
return option_1.map(function (lastIndex) { return core_1.length(list) - lastIndex - 1; })(recursiveFind(function (current) { return current === value; }, function (_, index) { return option_1.Some(index); }, function () { return option_1.None; }, core_1.reverse(list), 0)); | ||
} | ||
@@ -47,0 +47,0 @@ exports.lastIndexOf = lastIndexOf; |
@@ -34,3 +34,3 @@ import { None, Some, map } from '@pacote/option'; | ||
export function lastIndexOf(value, list) { | ||
return map((lastIndex) => length(list) - lastIndex - 1, recursiveFind((current) => current === value, (_, index) => Some(index), () => None, reverse(list), 0)); | ||
return map((lastIndex) => length(list) - lastIndex - 1)(recursiveFind((current) => current === value, (_, index) => Some(index), () => None, reverse(list), 0)); | ||
} | ||
@@ -37,0 +37,0 @@ export function findIndex(predicate, list) { |
{ | ||
"name": "@pacote/linked-list", | ||
"description": "Immutable linked lists.", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"sideEffects": false, | ||
@@ -37,5 +37,5 @@ "license": "MIT", | ||
"dependencies": { | ||
"@pacote/option": "^1.1.0" | ||
"@pacote/option": "^2.0.0" | ||
}, | ||
"gitHead": "d9493bbf8f30eb40aebeef457367e2dc447a3af0" | ||
"gitHead": "222e07265504ddff2e8625ab0b25bfa421af9ee1" | ||
} |
@@ -90,4 +90,3 @@ import { None, Option, Some, map } from '@pacote/option' | ||
export function lastIndexOf<T>(value: T, list: LinkedList<T>): Option<number> { | ||
return map( | ||
(lastIndex) => length(list) - lastIndex - 1, | ||
return map((lastIndex: number) => length(list) - lastIndex - 1)( | ||
recursiveFind<T, Option<number>>( | ||
@@ -94,0 +93,0 @@ (current) => current === value, |
102118
2303
+ Added@pacote/option@2.0.2(transitive)
- Removed@pacote/option@1.1.0(transitive)
Updated@pacote/option@^2.0.0