blob: 51334193e1037e50dd8c88cae77e5d9e2e31befc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# @netopwibby/order-object
Ever get annoyed when your `Object` keys aren't in alphabetical order? No? Just me?
## Installation
```sh
# deno
deno add jsr:@netopwibby/order-object
# node
npx jsr add @netopwibby/order-object
```
## Usage
```ts
// deno
import { orderObject } from "jsr:@netopwibby/order-object";
// node
import { orderObject } from "@netopwibby/order-object";
console.log(orderObject({ zebra: "yay", 1: "neo", horse: "neigh" }));
// returns { "1": "neo", horse: "neigh", zebra: "yay" }
```
### Running Tests
```sh
# lint all TypeScript files
deno lint
# type-check file
deno check mod.ts
deno check test.ts
# run the tests in `test.ts`
deno test
```
## License
MIT
## Prior Art
- [@webb/order-object](https://github.com/NetOpWibby/order-object/tree/node.js): I made this when Node.js was my best friend. Now Deno is my best friend.
|