dudaodong
bc9bacaa55
refactor: change param to item
2022-05-21 16:50:57 +08:00
dudaodong
cc6e10ee5a
add func IndexOf and LastIndexOf
2022-05-16 10:40:33 +08:00
dudaodong
3c16d50c4b
refactor: rename ReverseIntersect to SymmetricDifference
2022-04-01 18:05:02 +08:00
dudaodong
79867e8a63
feat: add ReverseIntersect function
2022-03-31 19:42:27 +08:00
dudaodong
50ef63e27d
feat: add GroupWith func
2022-03-21 15:29:10 +08:00
dudaodong
c939b26cb8
refactor: interface{} -> any
2022-03-16 18:41:40 +08:00
dudaodong
5e318a78d2
refactor: remove unused code
2022-02-15 11:19:07 +08:00
dudaodong
c2257493a8
fix: fix panic info text
2022-02-14 15:36:44 +08:00
dudaodong
5ae746a1f0
rename: rename InsertByIndex -> InsertAt, UpdateByIndex -> UpdateAt, DeleteByIndex -> DeleteAt for release 2.0
2022-02-10 11:25:34 +08:00
dudaodong
70077a6010
merge main branch
2022-01-26 17:47:57 +08:00
dudaodong
efdf36a817
Merge branch 'main' into v2
2022-01-26 17:44:46 +08:00
dudaodong
5937183af0
feat: replace constraints comparable into any in some funcs
2022-01-24 15:47:47 +08:00
dudaodong
1ad990ce9d
feat: add FindLast func
2022-01-24 15:28:47 +08:00
dudaodong
4eaa0a39d5
feat: add FindLast func
2022-01-24 15:22:43 +08:00
dudaodong
18ec73839b
feat: add DifferenceWith
2022-01-24 14:53:45 +08:00
dudaodong
89aef977a2
refactor: clean code for slice/slice.go
2022-01-24 11:46:09 +08:00
dudaodong
2612569500
merge: merge main branch and refector slice func with generics
2022-01-24 11:10:12 +08:00
dudaodong
6f035f710e
feat: add DifferenceBy func
2022-01-23 14:27:37 +08:00
dudaodong
6a1a0b8677
feat: add Concat func
2022-01-22 21:16:34 +08:00
dudaodong
0efe2f57c3
merge main
2022-01-19 20:47:47 +08:00
dudaodong
28317a1683
feat: remove ConvertSlice func
2022-01-19 20:41:46 +08:00
dudaodong
d46d12f949
feat: add func ContainSubSlice
2022-01-13 11:52:21 +08:00
dudaodong
e31fb28003
feat: add func ContainSubSlice
2022-01-13 11:00:27 +08:00
dudaodong
907df56f86
update: make func comment consistent
2022-01-11 20:27:06 +08:00
donutloop
f147f78a41
Slice: sort from v2 branch ( #22 )
...
ref: f1d7154179
2022-01-11 20:13:25 +08:00
dudaodong
3dadfa234b
update: make func comment consistent
2022-01-11 19:33:15 +08:00
donutloop
f1d7154179
refactor: sort ( #21 )
...
Removed reverse func because it use to much cpu and add test cas for asc sort
2022-01-11 19:24:36 +08:00
dudaodong
6e626851cf
merge #pr20
2022-01-11 18:12:57 +08:00
donutloop
c906d8aea7
Slice: group by and without v2 ( #20 )
...
* Slice: group by and without v2
Migrate from reflection to generic
* update doc
2022-01-11 18:11:01 +08:00
dudaodong
e5e4e09308
comment without func
2022-01-11 18:10:21 +08:00
dudaodong
7ed173849a
refactor: rewrite DeleteByIndex, InsertByIndex, UpdateByIndex and Without func with generics
2022-01-11 18:08:22 +08:00
donutloop
24c0d95112
Slice: reverse and shufffle v2 ( #19 )
...
* Slice: reverse and shufffle v2
Migrate from reflection to generic form
Note: after migration, old reverse must be removed
* Suffle test: remove reflection calls
* Reverse test: change name of test
2022-01-10 19:52:23 +08:00
dudaodong
e9fed34729
fmt: slice.go
2022-01-10 10:27:20 +08:00
dudaodong
9caefdb67d
fmt: slice.go
2022-01-10 10:24:33 +08:00
dudaodong
b0e9758e0d
Merge branch 'v2' of github.com:duke-git/lancet into v2
2022-01-09 22:15:18 +08:00
donutloop
7b9a8a55e7
Slice: CountV2 ( #18 )
...
Use generic instead of reflection
2022-01-09 22:15:03 +08:00
dudaodong
44ac82e8b8
refactor: rewrite some slice functions with go generics
2022-01-09 22:14:46 +08:00
donutloop
30d798366b
Slice: find v2 ( #17 )
...
* If slice len is zero then return false
* Convert find to generic form.
* If return T is nil then no items matched the predicate func
2022-01-07 20:19:27 +08:00
dudaodong
3e9a2b5c59
refactor: refact Filter, ForEach, Map func with generics
2022-01-07 17:53:55 +08:00
dudaodong
1343683b08
checkout v2 branch for generics migration
2022-01-07 17:48:00 +08:00
donutloop
3905c0bde1
Slice: Add count func ( #15 )
...
Returns the count of matched elements
2022-01-06 20:32:14 +08:00
dudaodong
df9de3065b
feat: add ForEach func
2022-01-05 20:17:16 +08:00
donutloop
4aef9d6d22
Slice: Add none func ( #13 )
...
Returns true whether no elements of this slice match the provided predicate
func. Negated form of Every func
2022-01-05 19:38:14 +08:00
donutloop
bc39b0887b
Filter: remove second loop and indexes slice ( #12 )
...
Use less memory and cpu resources to filter out elements from the slice.
2022-01-03 20:10:15 +08:00
dudaodong
7a9b0847f9
fix: fix some go line issue in go report card
2022-01-03 14:57:14 +08:00
donutloop
f15131f032
Slice: find nothing case ( #11 )
...
The current behavior can result into wired edge cases.
**Current behavior**
if find was unsuccessfully then it will return the first element of the
slice
**Desired behavior**
if find was unsuccessfully then it should return negative ok and a none
value
2022-01-02 22:05:27 +08:00
donutloop
b4a49fccfd
Slice: Add GroupBy func ( #10 )
...
Group by: split slice into two groups, applies on each slice element a
predicate func to categorize this element.
Changes
* Add groub by func
* Add test case for this func
2022-01-02 21:24:56 +08:00
dudaodong
ed4acc1c67
feat: add Shuffle func
2022-01-01 19:18:33 +08:00
dudaodong
042a00296f
feat: add FlattenDeep func
2022-01-01 18:14:35 +08:00
dudaodong
b42aac53b3
feat: add Drop func
2022-01-01 17:20:41 +08:00