Dev Guide
Dev GuideUser GuidesLegal TermsGitHubDevCommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

OCP App SDK / StringSet

StringSet

A node Set of only strings.
Used to differentiate between a string set or a number set as stored in the key-value storage.

Hierarchy

  • Set<string>.StringSet

Index

Constructors

Properties

Methods

Constructors

constructor()

Signature

new StringSet(values?: null | readonly string[]): StringSet;

Parameters

NameType
values?null | readonly string[]

Returns

StringSet

Inherited from: Set<string>.constructor

Defined in: node_modules/typescript/lib/lib.es2015.collection.d.ts:119

Signature

new StringSet(iterable?: null | Iterable<string>): StringSet;

Parameters

NameType
iterable?null | Iterable<string>

Returns

StringSet

Inherited from: Set<string>.constructor

Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:209

Properties

[toStringTag]

Readonly string

Inherited from: Set.[toStringTag]

Defined in: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:143

size

Readonly number

Inherited from: Set.size

Defined in: node_modules/typescript/lib/lib.es2015.collection.d.ts:115

[species]

Static Readonly SetConstructor

Inherited from: Set.[species]

Defined in: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:320

Methods

Iterates over values in the set.

Signature

iterator: IterableIterator<string>;

Returns

IterableIterator<string>

Inherited from: Set.[iterator]

Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:172

add()

Appends a new element with a specified value to the end of the Set.

Signature

add(value: string): StringSet;

Parameters

NameType
valuestring

Returns

StringSet

Inherited from: Set.add

Defined in: node_modules/typescript/lib/lib.es2015.collection.d.ts:96

clear()

Signature

clear(): void;

Returns

void

Inherited from: Set.clear

Defined in: node_modules/typescript/lib/lib.es2015.collection.d.ts:98

delete()

Removes a specified value from the Set.

Signature

delete(value: string): boolean;

Parameters

NameType
valuestring

Returns

boolean

Returns true if an element in the Set existed and has been removed, or false if the element does not exist.

Inherited from: Set.delete

Defined in: node_modules/typescript/lib/lib.es2015.collection.d.ts:103

entries()

Returns an iterable of [v,v] pairs for every value v in the set.

Signature

entries(): IterableIterator<[string, string]>;

Returns

IterableIterator<[string, string]>

Inherited from: Set.entries

Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:176

forEach()

Executes a provided function once per each value in the Set object, in insertion order.

Signature

forEach(callbackfn: Function, thisArg?: any): void;

Parameters

NameType
callbackfn(value: string, value2: string, set: Set<string>) => void
thisArg?any

Returns

void

Inherited from: Set.forEach

Defined in: node_modules/typescript/lib/lib.es2015.collection.d.ts:107

has()

Signature

has(value: string): boolean;

Parameters

NameType
valuestring

Returns

boolean

a boolean indicating whether an element with the specified value exists in the Set or not.

Inherited from: Set.has

Defined in: node_modules/typescript/lib/lib.es2015.collection.d.ts:111

keys()

Despite its name, returns an iterable of the values in the set.

Signature

keys(): IterableIterator<string>;

Returns

IterableIterator<string>

Inherited from: Set.keys

Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:180

values()

Returns an iterable of values in the set.

Signature

values(): IterableIterator<string>;

Returns

IterableIterator<string>

Inherited from: Set.values

Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:185