Hierarchy

  • RecordFactory

Constructors

Properties

fieldMapKey: typeof fieldMapKey = ...

Symbol under which the field map is stored on the record when using proxy transformation

useRecordProxy: boolean = false

Create records using a JS Proxy to intercept property access and transform the property name to the correct casing. When enabled the property access is case insensitive and upon each property access the property name is normalized and checked against all normalized field names in the current record. This can be slow due to the the multiple string comparisons that need to be executed.

When false the RecordFactory will use Object.defineProperty to transform the property names which causes the normalized property names to always be case sensitive but avoids the disadvantages of using a Proxy.

Methods

  • Normalize the field names to the correct casing for making queried records accessible by both the API name and the normalized name.

    When using the proxy transformation (see useRecordProxy or options.useRecordProxy) fields access is case insensitive.

    Type Parameters

    • T extends object = any

    Parameters

    • queryResultRecord: Partial<QueryResultRecord>

      The raw salesforce record returned by the API

    • Optional options: RecordFactoryCreateOptions

      Transformation options that override the default behavior of the factory

    Returns T

    The transformed record based on the specified options