[Class] biga.ahk (immutable utility library for arrays, strings, etc)

Post your working scripts, libraries and tools
User avatar
Chunjee
Posts: 754
Joined: 18 Apr 2014, 19:05
GitHub: Chunjee

Re: [Class] biga.ahk (immutable utility library for arrays, strings, etc)

29 Oct 2020, 12:56

v0.35.0 has been published.

.groupBy was added. https://biga-ahk.github.io/biga.ahk/#/?id=groupby
Creates an object composed of keys generated from the results of running each element of collection thru iteratee.

Code: Select all

A.groupBy([6.1, 4.2, 6.2], A.floor)
; => {4: [4.2], 6: [6.1, 6.2]}

A.groupBy([6.1, 4.2, 6.3], func("Ceil"))
; => {5: [4.2], 7: [6.1, 6.3]}


users := [ { "user": "barney", "lastActive": "Monday" }
        , { "user": "fred", "lastActive": "Tuesday" }
        , { "user": "pebbles", "lastActive": "Tuesday" } ]
        
; The `A.property` iteratee shorthand.
A.groupBy(users, "lastActive")
/* => {"Monday": [{ "user": "barney", "lastActive": "Monday" }]
     , "Tuesday": [{ "user": "fred", "lastActive": "Tuesday" }, { "user": "pebbles", "lastActive": "Tuesday" }]}*/
Somewhat similar to .partition; except this can separate elements into a number of groups.
User avatar
Chunjee
Posts: 754
Joined: 18 Apr 2014, 19:05
GitHub: Chunjee

Re: [Class] biga.ahk (immutable utility library for arrays, strings, etc)

18 Nov 2020, 17:35

v0.35.1 has been published.

.isEqual was updated. Previously only two parameters were allowed. The 2nd parameter is now variadic allowing multiple values to be compared in a single call.

Code: Select all

A.isEqual(1, 1, 1)
; => true

A.isEqual({ "a": 1 }, { "a": 1 }, { "a": 2 })
; => false
User avatar
Chunjee
Posts: 754
Joined: 18 Apr 2014, 19:05
GitHub: Chunjee

Re: [Class] biga.ahk (immutable utility library for arrays, strings, etc)

28 Dec 2020, 13:24

v0.35.2 has been published.

.sampleSize has been updated. Previously supplying an associative array would yield unexpected results. This has been fixed.

Previously:

Code: Select all

A.sampleSize({"key1": "value1", "key2": "value2"}, 2)
; => ["", ""]
Now:

Code: Select all

A.sampleSize({"key1": "value1", "key2": "value2"}, 2)
; => ["value1", "value2"]
User avatar
Chunjee
Posts: 754
Joined: 18 Apr 2014, 19:05
GitHub: Chunjee

Re: [Class] biga.ahk (immutable utility library for arrays, strings, etc)

29 Dec 2020, 18:52

v0.35.3 has been published.

.sample and .sampleSize should perform measurably faster.
User avatar
hasantr
Posts: 749
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: [Class] biga.ahk (immutable utility library for arrays, strings, etc)

30 Dec 2020, 02:13

Can you add some functionality that is not built into the ahk? We understand your sticking to Lodash. But if we are using this library it would be nice if it gives some additional stuff as well. Especially some functional features built into python.
Thanks for everything.
User avatar
Chunjee
Posts: 754
Joined: 18 Apr 2014, 19:05
GitHub: Chunjee

Re: [Class] biga.ahk (immutable utility library for arrays, strings, etc)

30 Dec 2020, 15:12

That is a cool idea. I don't know when but I do want to make an accompanying utility class for things that aren't exact translations but still needed.
User avatar
Chunjee
Posts: 754
Joined: 18 Apr 2014, 19:05
GitHub: Chunjee

Re: [Class] biga.ahk (immutable utility library for arrays, strings, etc)

15 Jan 2021, 19:06

v0.35.4 has been published.

.truncate should perform much faster.
.indexOf should perform slightly faster.

There was an incorrect parameter accepted on .initial

There was a bug with .truncate that would not allow a blank omission option "". This is now an accepted option.
User avatar
Chunjee
Posts: 754
Joined: 18 Apr 2014, 19:05
GitHub: Chunjee

Re: [Class] biga.ahk (immutable utility library for arrays, strings, etc)

19 Jan 2021, 16:37

v0.36.0 has been publshed.

.pad .padStart and .padEnd have been added.

A longstanding bug was fixed in .floor
User avatar
Chunjee
Posts: 754
Joined: 18 Apr 2014, 19:05
GitHub: Chunjee

Re: [Class] biga.ahk (immutable utility library for arrays, strings, etc)

19 Jan 2021, 19:56

v0.37.1 has been published.

For some other projects I created a process for aliases and I brought that support into biga.ahk's build script. Therefore the following aliases now work, are documented, and are included in tests:

.head is also accessible via .first
.forEach is also accessible via .each
.toPairs is also accessible via .entries

Return to “Scripts and Functions”

Who is online

Users browsing this forum: malcev, VxMiMxV and 16 guests