@inrupt/solid-client / thing/add

Module: thing/add

Type aliases

AddOfType

Ƭ AddOfType<Type>: <T>(thing: T, property: Url | UrlString, value: Type) => T

param Thing to add a value to.

param Property on which to add the given value.

param Value to add to thing for the given property.

returns A new Thing equal to the input Thing with the given value removed for the given Property.

Type parameters

Name

Type

Type declaration

▸ <T>(thing, property, value): T

Type parameters

Name

Type

T

T: Thing

Parameters

Name

Type

thing

T

property

Url | UrlString

value

Type

Returns

T

Functions

addBoolean

Const addBoolean<T>(thing, property, value): T

Create a new Thing with a boolean added for a Property.

This preserves existing values for the given Property. To replace them, see setBoolean.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

T: Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to add a boolean value to.

property

string | Url

Property for which to add the given boolean value.

value

boolean

Boolean to add to thing for the given property.

Returns

T

A new Thing equal to the input Thing with the given value added for the given Property.


addDatetime

Const addDatetime<T>(thing, property, value): T

Create a new Thing with a datetime added for a Property.

This preserves existing values for the given Property. To replace them, see setDatetime.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

T: Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to add a datetime value to.

property

string | Url

Property for which to add the given datetime value.

value

Date

Datetime to add to thing for the given property.

Returns

T

A new Thing equal to the input Thing with the given value added for the given Property.


addDecimal

Const addDecimal<T>(thing, property, value): T

Create a new Thing with a decimal added for a Property.

This preserves existing values for the given Property. To replace them, see setDecimal.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

T: Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to add a decimal value to.

property

string | Url

Property for which to add the given decimal value.

value

number

Decimal to add to thing for the given property.

Returns

T

A new Thing equal to the input Thing with the given value added for the given Property.


addInteger

Const addInteger<T>(thing, property, value): T

Create a new Thing with an integer added for a Property.

This preserves existing values for the given Property. To replace them, see setInteger.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

T: Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to add an integer value to.

property

string | Url

Property for which to add the given integer value.

value

number

Integer to add to thing for the given property.

Returns

T

A new Thing equal to the input Thing with the given value added for the given Property.


addStringNoLocale

Const addStringNoLocale<T>(thing, property, value): T

Create a new Thing with an unlocalised string added for a Property.

This preserves existing values for the given Property. To replace them, see setStringNoLocale.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

T: Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to add an unlocalised string value to.

property

string | Url

Property for which to add the given string value.

value

string

String to add to thing for the given property.

Returns

T

A new Thing equal to the input Thing with the given value added for the given Property.


addStringWithLocale

addStringWithLocale<T>(thing, property, value, locale): T

Create a new Thing with a localised string added for a Property.

This preserves existing values for the given Property. To replace them, see setStringWithLocale.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

T: Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to add a localised string value to.

property

Url | UrlString

Property for which to add the given string value.

value

string

String to add to thing for the given property.

locale

string

Locale of the added string.

Returns

T

A new Thing equal to the input Thing with the given value added for the given Property.


addUrl

Const addUrl<T>(thing, property, value): T

Create a new Thing with a URL added for a Property.

This preserves existing values for the given Property. To replace them, see setUrl.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

T: Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to add a URL value to.

property

string | Url

Property for which to add the given URL value.

value

string | Readonly<Object> | Url

-

Returns

T

A new Thing equal to the input Thing with the given value added for the given Property.