0.3.14 • Published 5 years ago

dc-thing v0.3.14

Weekly downloads
4
License
UNLICENSED
Repository
github
Last release
5 years ago

Thing Data Controller

Data Controller for Thing Class, the most generic type of item.

Properties

PropertyExpected TypeDescription
additionalTypeURLAn additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
alternateNameTextAn alias for the item.
descriptionTextA description of the item.
disambiguatingDescriptionTextA sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifierPropertyValue or Text or URLThe identifier property represents any kind of identifier for any kind of Thing, such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links.
imageImageObject or URLAn image of the item. This can be a URL or a fully described ImageObject.
mainEntityOfPageCreativeWork or URLIndicates a page (or other CreativeWork) for which this thing is the main entity being described.
nameTextThe name of the item.
potentialActionActionIndicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
sameAsURLURL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
subjectOfCreativeWork or EventA CreativeWork or Event about this Thing..
urlURLThe url of the item.

Static methods

isNumber()
ParameterReturnsDescription
AnyBooleanTests if the value passed is of type Number, and returns true if it is, false otherwise.

Example:

//Checks if the passed value is of type number
Thing.isNumber(1);//true
Thing.isNumber('nope');//false

isString()
ParameterReturnsDescription
AnyBooleanTests if the value passed is of type String, and returns true if it is, false otherwise.

Example:

//Checks if the passed value is of type number
Thing.isString('yes');//true
Thing.isString(1);//false

isBoolean()
ParameterReturnsDescription
AnyBooleanTests if the value passed is of type Boolean, and returns true if it is, false otherwise.

Example:

//Checks if the passed value is of type number
Thing.isBoolean(true);//true
Thing.isBoolean(1);//false

isArray()
ParameterReturnsDescription
AnyBooleanTests if the value passed is of type Array, and returns true if it is, false otherwise.

Example:

//Checks if the passed value is of type number
Thing.isArray([]);//true
Thing.isArray(1);//false

isObject()
ParameterReturnsDescription
AnyBooleanTests if the value passed is of type Object, and returns true if it is, false otherwise.

Example:

//Checks if the passed value is of type number
Thing.isObject({});//true
Thing.isObject([1,2,3]);//true
Thing.isObject(1);//false

isPlainObject()
ParameterReturnsDescription
AnyBooleanTests if the value passed is of type PlainObject, and returns true if it is, false otherwise.

Example:

//Checks if the passed value is of type number
Thing.isPlainObject({'one' : 'two'});//true
Thing.isPlainObject([1,2,3]);//false
Thing.isPlainObject(1);//false

isNull()
ParameterReturnsDescription
AnyBooleanTests if the value passed is of type Null, and returns true if it is, false otherwise.

Example:

//Checks if the passed value is of type number
Thing.isNull(null);//true
Thing.isNull([1,2,3]);//false
Thing.isNull(1);//false

isEmpty()
ParameterReturnsDescription
AnyBooleanTests if the value passed is of type Empty, and returns true if it is, false otherwise.

Example:

//Checks if the passed value is of type number
Thing.isEmpty([]);//true
Thing.isEmpty([1,2,3]);//false
Thing.isEmpty(1);//false
isValidJSONInput()
ParameterReturnsDescription
AnyBooleanTests if the value passed is valid JSON, and returns true if it is, false otherwise.

Example:

//Checks if the passed value is of type number
Thing.isValidJSONInput({'one':'two'});//true
Thing.isValidJSONInput([1,2,3]);//false
Thing.isValidJSONInput(1);//false
0.3.14

5 years ago

0.3.13

5 years ago

0.3.12

5 years ago

0.3.11

5 years ago

0.3.10

5 years ago

0.3.9

5 years ago

0.3.8

5 years ago

0.3.7

5 years ago

0.3.6

5 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

7 years ago

0.1.0

7 years ago

1.0.1-beta

7 years ago

1.0.0-beta

7 years ago