Skip to content

Make sure your Object keys are in alphabetical order

Notifications You must be signed in to change notification settings

NetOpWibby/order-object

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@netopwibby/order-object

Ever get annoyed when your Object keys aren't in alphabetical order? No? Just me?

Installation

# deno
deno add jsr:@netopwibby/order-object

# node
npx jsr add @netopwibby/order-object

Usage

// 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

# 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: I made this when Node.js was my best friend. Now Deno is my best friend.

About

Make sure your Object keys are in alphabetical order

Topics

Resources

Stars

Watchers

Forks