This module defines the core ONE object types. It has the type definitions as well as the recipes.
The module deliberately does not import any other module. This ensures that there are no cyclic imports (type imports don't count, they don't exist at runtime).
- Source:
Members
(static, constant) ORDERED_BY :object
The allowed values for RecipeRule's property list
for list properties (i.e. more
than one value for the given itemprop
). Leave the property undefined if the value is not a
list but a single value.
Background/reason: The same elements but a different order will produce a different SHA-256 hash of the content! Here is when you tell one that this is what is intended or not.
-
ORDERED_BY.ONE
: When converting an array of values to microdata the result will be alphabetically ordered to impose a reproducible order, in order to guarantee that the same unordered "bag" of data produces the exact same microdata and the exact same SHA-256 hash. This means that an array of the exact same elements in different order is going to lead to a microdata representation that is always the same. IT also means that when reading the ONE object back from storage the order will be whatever the alphabetical sorting of the microdata elements produced, which may be different from the original order when the data was saved. -
ORDERED_BY.APP
: When converting the array of values the order is left as-is. This means that an array of the exact same elements in different order is going to lead to a microdata representation that is different, which leads to a different SHA-256 hash.
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
ONE |
'orderedByONE' | |
APP |
'orderedByApp' |
- Source:
(static, constant) CORE_RECIPES :Array.<Recipe>
Declare the private ONE storage for RECIPES. They describe how objects are built and are used to create the Javascript, JSON and the microdata representations of ONE objects.
Note: The examples for each ONE object type recipe are with newlines and indentation for readability. The actual output will not have spaces or newlines!
Type:
- Array.<Recipe>
- Source:
Type Definitions
PersonId
The ID object of a Person with only "email" as the sole ID property of Person objects.
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
$type$ |
'Person' | |
email |
string |
- Source: