Dictionary

Classin dictionary@fastly/js-compute 4.0.0View source
Deprecated: Use ConfigStore from 'fastly:config-store' instead.

Class for accessing Fastly Edge Dictionaries.

Note: Can only be used when processing requests, not during build-time initialization.

Constructor

deprecatedView source
Deprecated: Use ConfigStore from 'fastly:config-store' instead.
new Dictionary(name: string)

Creates a new Dictionary object, providing access to the named Edge Dictionary.

Parameters

name: string

The name of the Edge Dictionary.

Throws

  • TypeError if no Dictionary exists with the provided name.
  • TypeError if the provided name is empty, longer than 255 characters, does not start with an ASCII alphabetical character, or contains characters other than ASCII alphanumerics, underscores, and spaces.

Methods

get

deprecatedView source
Deprecated: Use ConfigStore from 'fastly:config-store' instead.
get(key: string): string | null

Get a value for a key in the Dictionary. If the provided key does not exist in the Dictionary then this returns null.

Parameters

key: string

The key to retrieve.

Returns

string | null

Throws

  • TypeError if the provided key is empty or longer than 255 characters.