Skip to content

Commit

Permalink
Documentation (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBuchholz committed Aug 30, 2018
1 parent 5d39e4f commit 8a65c31
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/serial/property.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* @file Serialization types
* @since 0.2.8
*/
/*#ifndef(UMD)*/
"use strict";
Expand All @@ -17,8 +18,9 @@ _gpfErrorDeclare("serial/property", {
* ### Description
*
* Name should respect the pattern `/^[a-z][a-z0-9_]*$/i`
* @since 0.2.8
*/
"invalidSerialName": "Invalid serial name",
invalidSerialName: "Invalid serial name",

/**
* ### Summary
Expand All @@ -28,8 +30,9 @@ _gpfErrorDeclare("serial/property", {
* ### Description
*
* Type should be one of the enumeration {@see gpf.serial.types}
* @since 0.2.8
*/
"invalidSerialType": "Invalid serial type",
invalidSerialType: "Invalid serial type",

/**
* ### Summary
Expand All @@ -39,14 +42,16 @@ _gpfErrorDeclare("serial/property", {
* ### Description
*
* Required can either be true or false
* @since 0.2.8
*/
"invalidSerialRequired": "Invalid serial required"
invalidSerialRequired: "Invalid serial required"

});

/**
* @namespace gpf.serial
* @description Root namespace for the serialization helpers.
* @since 0.2.8
*/
gpf.serial = {};

Expand All @@ -58,6 +63,7 @@ gpf.serial = {};
* @property {gpf.serial.types} [type=gpf.serial.types.string] Type of the property
* @property {Boolean} [required=false] Property must have a value
* @see gpf.attributes.Serializable
* @since 0.2.8
*/

/**
Expand All @@ -73,10 +79,12 @@ var _GPF_SERIAL_TYPE = {
*
* @enum {String}
* @readonly
* @since 0.2.8
*/
gpf.serial.types = {
/**
* String, might be limited by {@see gpf.typedef.serializableProperty.length}
* @since 0.2.8
*/
string: _GPF_SERIAL_TYPE.STRING
};
Expand Down Expand Up @@ -141,6 +149,7 @@ function _gpfSerialPropertyCheckRequired (property) {
* @throws {gpf.Error.InvalidSerialName}
* @throws {gpf.Error.InvalidSerialType}
* @throws {gpf.Error.InvalidSerialRequired}
* @since 0.2.8
*/
function _gpfSerialPropertyCheck (property) {
property = Object.assign(property); // Clone
Expand Down

0 comments on commit 8a65c31

Please sign in to comment.