Skip to main content Link Search Menu Expand Document (external link)

ValueOrder.ts overview

This module implements a type that represents an order on the properties of a non-primitive value. A PPValueOrder can be used as the propertySortOrder field of a PPNonPrimitiveParameters so that properties are sorted before being formatted. Several pre-built orderings are provided (by prototypal depth, by key, by callability, by key type, by enumerability, by source). They can be combined with Order.combine from the effect library if a multi-criteria order is needed.


Exports Grouped by Category


Models

Type (interface)

Type of a PPValueOrder

Signature

export interface Type extends Order.Order<PPValue.Any> {}

Source

Ordering

byCallability

Order instance based on the callability of the content property (non functions first, then functions)

Signature

declare const byCallability: Type

Source

byEnumerability

Order instance based on the enumerability of the property to which the value belongs (non- enumerable keys first, then enumerable keys)

Signature

declare const byEnumerability: Type

Source

byKeyType

Order instance based on the type of the key associated to the value (symbolic keys first, then string keys)

Signature

declare const byKeyType: Type

Source

byOneLineStringKey

Order instance based on the oneLineStringKey property

Signature

declare const byOneLineStringKey: Type

Source

byProtoDepth

Order instance based on the protoDepth property, lowest depth first

Signature

declare const byProtoDepth: Type

Source

bySource

Order instance based on the source of the property (first from iterating on the non primitive value then from Object.ownKeys)

Signature

declare const bySource: Type

Source