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

PropertyFilter.ts overview

This module implements a type that takes care of filtering properties when printing non-primitive values.

With the make function, you can define your own instances if the provided ones don’t suit your needs.


Exports Grouped by Category


Constructors

make

Constructor of a PPPropertyFilter

Signature

declare const make: (params: MTypes.Data<Type>) => Type

Source

merge

Creates a new PPPropertyFilter by composing several existing PPPropertyFilter’s in sequence. The resulting PPPropertyFilter removes any value that is removed by at least one of the composed PPPropertyFilter’s.

Signature

declare const merge: ({ id, filters }: { readonly id: string; readonly filters: ReadonlyArray<Type> }) => Type

Source

removeNotFulfillingKeyPredicateMaker

Constructor of a PPPropertyFilter instance that removes properties of non-primitive values whose key is:

  • A string that does not fulfill predicate
  • A symbol

Signature

declare const removeNotFulfillingKeyPredicateMaker: ({
  id,
  predicate
}: {
  readonly id: string
  readonly predicate: Predicate.Predicate<string>
}) => Type

Source

Equivalences

equivalence

Equivalence of PPPropertyFilter’s

Signature

declare const equivalence: Equivalence.Equivalence<Type>

Source

Getters

action

Returns the action property of self

Signature

declare const action: MTypes.OneArgFunction<Type, MTypes.OneArgFunction<PPValues.Type, PPValues.Type>>

Source

id

Returns the id property of self

Signature

declare const id: MTypes.OneArgFunction<Type, string>

Source

Instances

none

PPPropertyFilter instance that removes no properties

Signature

declare const none: Type

Source

removeEnumerables

PPPropertyFilter instance that removes enumerable properties of non-primitive values

Signature

declare const removeEnumerables: Type

Source

removeFunctions

PPPropertyFilter instance that removes properties of non-primitive values whose value is a function

Signature

declare const removeFunctions: Type

Source

removeNonEnumerables

PPPropertyFilter instance that removes non-enumerable properties of non-primitive values

Signature

declare const removeNonEnumerables: Type

Source

removeNonFunctions

PPPropertyFilter instance that removes properties of non-primitive values whose value is not a function

Signature

declare const removeNonFunctions: Type

Source

removeStringKeys

PPPropertyFilter instance that removes properties of non-primitive values with a string key

Signature

declare const removeStringKeys: Type

Source

removeSymbolicKeys

PPPropertyFilter instance that removes properties of non-primitive values with a symbolic key

Signature

declare const removeSymbolicKeys: Type

Source

Models

Type (class)

Type that represents a PPPropertyFilter

Signature

declare class Type {
  constructor({ id, action }: MTypes.Data<Type>)
}

Source

[MData.idSymbol] (method)

Returns the id of this

Signature

declare const [MData.idSymbol]: () => string | (() => string)

Source

[Hash.symbol] (method)

Calculates the hash value of this

Signature

declare const [Hash.symbol]: () => number

Source

[MEquivalenceBasedEqualityData.isEquivalentToSymbol] (method)

Function that implements the equivalence of this and that

Signature

declare const [MEquivalenceBasedEqualityData.isEquivalentToSymbol]: (this: this, that: this) => boolean

Source

[MEquivalenceBasedEqualityData.hasSameTypeMarkerAsSymbol] (method)

Predicate that returns true if that has the same type marker as this

Signature

declare const [MEquivalenceBasedEqualityData.hasSameTypeMarkerAsSymbol]: (that: unknown) => boolean

Source

id (property)

Id of this PropertyFilter instance. Useful for equality and debugging

Signature

readonly id: string

Source

action (property)

Action of this PropertyFilter instance

Signature

readonly action: MTypes.OneArgFunction<PPValues.Type, PPValues.Type>

Source

Module markers

moduleTag

Module tag

Signature

declare const moduleTag: "@parischap/pretty-print/Parameters/PropertyFilter/"

Source