Skip to content

Commit

Permalink
Merge pull request #20 from kcl-lang/collectionutil-module
Browse files Browse the repository at this point in the history
feat: add collectionutil module v0.0.1
  • Loading branch information
Peefy authored Oct 27, 2023
2 parents deda6e6 + 523aea1 commit f1f4b3c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
23 changes: 23 additions & 0 deletions collectionutil/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Introduction

`collectionutil` is a kcl module for list and config values

## How to Use

+ Add the dependency

```shell
kpm add collectionutil
```

+ Write the kcl code

```python
import collectionutil

items = collectionutil.to_str_set(["aa", "aa", "bb"]) # ["aa", "bb"]
```

## Resource

Code source and document is [here](https://github.com/kcl-lang/artifacthub/tree/main/collectionutil)
4 changes: 4 additions & 0 deletions collectionutil/kcl.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[package]
name = "collectionutil"
version = "0.0.1"
description = "`collectionutil` is a kcl module for list and config values"
4 changes: 4 additions & 0 deletions collectionutil/main.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

to_str_set = lambda items: [str] {
[item for item in {item = None for item in items}]
}

0 comments on commit f1f4b3c

Please sign in to comment.