CookieList

CookieList

new CookieList(parent, cookies)

Contains a list of header elements

Parameters:
Name Type Description
parent Object
cookies Array.<Object>
Source:

Extends

Methods

(static) isCookieList(obj) → {Boolean}

Checks if the given object is a CookieList

Parameters:
Name Type Description
obj *
Source:
Returns:
Type
Boolean

add(item)

Add an item or item definition to this list.

Parameters:
Name Type Description
item Object | PropertyList.Type
Inherited From:
Source:
To Do:
  • - remove item from original parent if already it has a parent - validate that the original parent's constructor matches this parent's constructor

all() → {Object}

Returns a map of all items.

Inherited From:
Source:
Returns:
Type
Object

append(item)

Adds or moves an item to the end of this list.

Parameters:
Name Type Description
item PropertyList.Type
Inherited From:
Source:

assimilate(source, pruneopt)

Add or update values from a source list.

Parameters:
Name Type Attributes Default Description
source PropertyList | Array
prune Boolean <optional>
false

Setting this to true will cause the extra items from the list to be deleted

Inherited From:
Source:

clear()

Removes all items in the list

Inherited From:
Source:

count() → {Number}

Returns the length of the PropertyList

Inherited From:
Source:
Returns:
Type
Number

each(iterator, context)

Iterate on each item of this list.

Parameters:
Name Type Description
iterator function
context Object
Inherited From:
Source:

eachParent(iterator, contextopt)

Iterates over all parents of the property list

Parameters:
Name Type Attributes Description
iterator function
context Object <optional>
Inherited From:
Source:

filter(rule, context)

Parameters:
Name Type Description
rule function
context Object
Inherited From:
Source:

find(rule, contextopt) → {Item|ItemGroup}

Find an item within the item group

Parameters:
Name Type Attributes Description
rule function
context Object <optional>
Inherited From:
Source:
Returns:
Type
Item | ItemGroup

get(key) → {PropertyList.Type|*}

Get the value of an item in this list. This is similar to PropertyList.one barring the fact that it returns the value of the underlying type of the list content instead of the item itself.

Parameters:
Name Type Description
key String | function
Inherited From:
Source:
Returns:
Type
PropertyList.Type | *

has(item, valueopt) → {Boolean}

Check whether an item exists in this list

Parameters:
Name Type Attributes Description
item String | PropertyList.Type
value * <optional>
Inherited From:
Source:
Returns:
Type
Boolean

idx(index) → {PropertyList.Type}

Get a member of this list by it's index

Parameters:
Name Type Description
index Number
Inherited From:
Source:
Returns:
Type
PropertyList.Type

indexOf(item) → {Number}

Find the index of an item in this list

Parameters:
Name Type Description
item String | Object
Inherited From:
Source:
Returns:
Type
Number

insert(item, beforeopt)

Insert an element at the end of this list. When a reference member specified via second parameter is found, the member is inserted at an index before the reference member.

Parameters:
Name Type Attributes Description
item PropertyList.Type
before PropertyList.Type | String <optional>
Inherited From:
Source:

insertAfter(item, afteropt)

Insert an element at the end of this list. When a reference member specified via second parameter is found, the member is inserted at an index after the reference member.

Parameters:
Name Type Attributes Description
item PropertyList.Type
after PropertyList.Type | String <optional>
Inherited From:
Source:

map(iterator, context)

Iterates over the property list.

Parameters:
Name Type Description
iterator function

Function to call on each item.

context Object

Optional context, defaults to the PropertyList itself.

Inherited From:
Source:

one(id) → {PropertyList.Type}

Get Item in this list by ID reference. If multiple values are allowed, the last value is returned.

Parameters:
Name Type Description
id String
Inherited From:
Source:
Returns:
Type
PropertyList.Type

populate(items)

Load one or more items

Parameters:
Name Type Description
items Object | Array
Inherited From:
Source:

prepend(item)

Adds or moves an item to the beginning of this list.

Parameters:
Name Type Description
item PropertyList.Type
Inherited From:
Source:

remove(predicate, context)

Removes all elements from the PropertyList for which the predicate returns truthy.

Parameters:
Name Type Description
predicate function | String | Type
context Object

Optional context to bind the predicate to.

Inherited From:
Source:

repopulate(items)

Clears the list and adds new items.

Parameters:
Name Type Description
items Object | Array
Inherited From:
Source:

toObject(excludeDisabledopt, nullable, caseSensitiveopt, nullable, multiValueopt, nullable, sanitizeKeysopt) → {Object}

Converts a list of Properties into an object where key is _postman_propertyIndexKey and value is determined by the valueOf function

Parameters:
Name Type Attributes Default Description
excludeDisabled Boolean <optional>
<nullable>
false

When set to true, disabled properties are excluded from the resultant object.

caseSensitive Boolean <optional>
<nullable>

When set to true, properties are treated strictly as per their original case. The default value for this property also depends on the case insensitivity definition of the current property.

multiValue Boolean <optional>
<nullable>
false

When set to true, only the first value of a multi valued property is returned.

sanitizeKeys Boolean <optional>
false

When set to true, properties with falsy keys are removed.

Inherited From:
Source:
To Do:
  • Change the function signature to an object of options instead of the current structure.
Returns:
Type
Object

toString() → {String}

Adds ability to convert a list to a string provided it's underlying format has unparse function defined.

Inherited From:
Source:
Returns:
Type
String

upsert(item) → (nullable) {Boolean}

Add an item or update an existing item

Parameters:
Name Type Description
item PropertyList~Type
Inherited From:
Source:
Returns:
Type
Boolean