v1.3.0
deno module, a collection of array util under dallmo-util
Attributes
Includes Deno configuration
Repository
Current version released
2 months ago
@dallmo/util-array
overview
- a collection of array util under dallmo-util, published as a deno module.
- re-written in typescript, migrated from nodejs to base only on deno standard libraries ;
- published on both deno land and jsr ;
list of available methods
- random_index
- random_item
- random_insert
- insert_item
- update_item
- remove_item
- gen_array_by_range
- add_all
- search
usage
1. running on deno, import via deno module
- nothing to add via CLI.
- create
test-via-deno-modules.ts
;
// this assumes the latest version
import * as dallmo_util_array from "https://deno.land/x/dallmo_util_array/mod.ts";
const test_array: any[] = ["123","abc", 456, "何ですか"];
console.log( "random_item : ", dallmo_util_array.random_item( test_array ) );
- run the test file
deno run test-via-deno-modules.ts
2. running on deno, import via jsr
- in CLI, add the module with :
deno add @dallmo/util-array
- create
test-via-jsr.ts
;
import * as dallmo_util_array from "@dallmo/util-array";
const test_array: any[] = ["123","abc", 456, "何ですか"];
console.log( "random_item : ", dallmo_util_array.random_item( test_array ) );
- run the test file
deno run test-via-jsr.ts
test
to run test codes :
- switch to the project root folder, i.e.
[root]/
; - run deno task scripts :
- to test with dependencies via deno modules :
- run
deno task test-deno
;
- run
- to test with dependencies via jsr :
- run
deno task test-jsr
;
- run