• Blog
  • Changelog
  • Follow us on GitHubFollow us on XJoin our Discord server
  • Blog
  • GitHub
  • Releases
  • Getting started

    • Overview
  • Library

    • Getting started
    • Array
    • Result
    • Dependency injection
    • Resource management
    • Task
    • Type
    • Conventions
  • Local-first

    • Getting started
    • Playgrounds
    • Examples
    • Owners
    • Relay
    • Migrations
    • Time travel
    • Indexes
    • Protocol
    • Privacy
    • FAQ
  • Other

    • API reference
    • Comparison
    • Showcase
    • Changelog

API reference › @evolu/common › Order › orderString

const orderString: Order<string>;

Defined in: packages/common/src/Order.ts:70

An order for string values in ascending order.

Example

orderString("a", "b"); // -1
orderString("b", "a"); // 1
orderString("a", "a"); // 0
["c", "b", "a"].toSorted(orderString); // ["a", "b", "c"]
Markdown for LLMs

© 2026 Evolu

Follow us on GitHubFollow us on XJoin our Discord server