Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
platform: Add newlines to JSDoc descriptions, cleanup unit tests, and…
Browse files Browse the repository at this point in the history
… update DocDown submodule. [jddalton]
  • Loading branch information
jdalton committed Apr 8, 2012
1 parent 1bdbd9c commit c079ee5
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 106 deletions.
24 changes: 12 additions & 12 deletions doc/README.md
Expand Up @@ -34,7 +34,7 @@

<!-- div -->

### <a id="platform" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L782" title="View in source">`platform`</a>
### <a id="platform" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L810" title="View in source">`platform`</a>
*(Object)*: The platform object.
[&#9650;][1]

Expand All @@ -43,7 +43,7 @@

<!-- div -->

### <a id="platform.description" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L812" title="View in source">`platform.description`</a>
### <a id="platform.description" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L844" title="View in source">`platform.description`</a>
*(String, Null)*: The platform description.
[&#9650;][1]

Expand All @@ -52,7 +52,7 @@

<!-- div -->

### <a id="platform.layout" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L819" title="View in source">`platform.layout`</a>
### <a id="platform.layout" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L852" title="View in source">`platform.layout`</a>
*(String, Null)*: The name of the browser layout engine.
[&#9650;][1]

Expand All @@ -61,7 +61,7 @@

<!-- div -->

### <a id="platform.manufacturer" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L826" title="View in source">`platform.manufacturer`</a>
### <a id="platform.manufacturer" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L860" title="View in source">`platform.manufacturer`</a>
*(String, Null)*: The name of the product's manufacturer.
[&#9650;][1]

Expand All @@ -70,7 +70,7 @@

<!-- div -->

### <a id="platform.name" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L796" title="View in source">`platform.name`</a>
### <a id="platform.name" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L826" title="View in source">`platform.name`</a>
*(String, Null)*: The name of the browser/environment.
[&#9650;][1]

Expand All @@ -79,7 +79,7 @@

<!-- div -->

### <a id="platform.os" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L803" title="View in source">`platform.os`</a>
### <a id="platform.os" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L834" title="View in source">`platform.os`</a>
*(String, Null)*: The name of the operating system.
[&#9650;][1]

Expand All @@ -88,7 +88,7 @@

<!-- div -->

### <a id="platform.prerelease" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L833" title="View in source">`platform.prerelease`</a>
### <a id="platform.prerelease" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L868" title="View in source">`platform.prerelease`</a>
*(String, Null)*: The alpha/beta release indicator.
[&#9650;][1]

Expand All @@ -97,7 +97,7 @@

<!-- div -->

### <a id="platform.product" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L840" title="View in source">`platform.product`</a>
### <a id="platform.product" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L876" title="View in source">`platform.product`</a>
*(String, Null)*: The name of the product hosting the browser.
[&#9650;][1]

Expand All @@ -106,7 +106,7 @@

<!-- div -->

### <a id="platform.ua" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L847" title="View in source">`platform.ua`</a>
### <a id="platform.ua" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L884" title="View in source">`platform.ua`</a>
*(String, Null)*: The browser's user agent string.
[&#9650;][1]

Expand All @@ -115,7 +115,7 @@

<!-- div -->

### <a id="platform.version" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L789" title="View in source">`platform.version`</a>
### <a id="platform.version" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L818" title="View in source">`platform.version`</a>
*(String, Null)*: The browser/environment version.
[&#9650;][1]

Expand All @@ -124,7 +124,7 @@

<!-- div -->

### <a id="platform.parse" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L219" title="View in source">`platform.parse([ua = navigator.userAgent])`</a>
### <a id="platform.parse" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L231" title="View in source">`platform.parse([ua = navigator.userAgent])`</a>
Creates a new platform object.
[&#9650;][1]

Expand All @@ -139,7 +139,7 @@ Creates a new platform object.

<!-- div -->

### <a id="platform.toString" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L497" title="View in source">`platform.toString()`</a>
### <a id="platform.toString" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L521" title="View in source">`platform.toString()`</a>
Return platform description when the platform object is coerced to a string.
[&#9650;][1]

Expand Down
31 changes: 30 additions & 1 deletion platform.js
Expand Up @@ -59,6 +59,7 @@

/**
* Capitalizes a string value.
*
* @private
* @param {String} string The string to capitalize.
* @returns {String} The capitalized string.
Expand All @@ -70,6 +71,7 @@

/**
* An iteration utility for arrays and objects.
*
* @private
* @param {Array|Object} object The object to iterate over.
* @param {Function} callback The function called per iteration.
Expand All @@ -89,6 +91,7 @@

/**
* Trim and conditionally capitalize string values.
*
* @private
* @param {String} string The string to format.
* @returns {String} The formatted string.
Expand All @@ -102,6 +105,7 @@

/**
* Iterates over an object's own properties, executing the `callback` for each.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} callback The function executed per own property.
Expand All @@ -114,6 +118,7 @@

/**
* Gets the internal [[Class]] of a value.
*
* @private
* @param {Mixed} value The value.
* @returns {String} The [[Class]].
Expand All @@ -126,6 +131,7 @@

/**
* Checks if an object has the specified key as a direct property.
*
* @private
* @param {Object} object The object to check.
* @param {String} key The key to check for.
Expand Down Expand Up @@ -161,6 +167,7 @@
* Host objects can return type values that are different from their actual
* data type. The objects we are concerned with usually return non-primitive
* types of object, function, or unknown.
*
* @private
* @param {Mixed} object The owner of the property.
* @param {String} property The property to check.
Expand All @@ -173,7 +180,9 @@
}

/**
* Prepares a string for use in a RegExp constructor by making hyphens and spaces optional.
* Prepares a string for use in a RegExp constructor by making hyphens and
* spaces optional.
*
* @private
* @param {String} string The string to qualify.
* @returns {String} The qualified string.
Expand All @@ -184,6 +193,7 @@

/**
* A bare-bones` Array#reduce` like utility function.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} callback The function called per iteration.
Expand All @@ -200,6 +210,7 @@

/**
* Removes leading and trailing whitespace from a string.
*
* @private
* @param {String} string The string to trim.
* @returns {String} The trimmed string.
Expand All @@ -212,6 +223,7 @@

/**
* Creates a new platform object.
*
* @memberOf platform
* @param {String} [ua = navigator.userAgent] The user agent string.
* @returns {Object} A platform object.
Expand Down Expand Up @@ -358,6 +370,7 @@

/**
* Picks the layout engine from an array of guesses.
*
* @private
* @param {Array} guesses An array of guesses.
* @returns {String|Null} The detected layout engine.
Expand All @@ -372,6 +385,7 @@

/**
* Picks the manufacturer from an array of guesses.
*
* @private
* @param {Array} guesses An array of guesses.
* @returns {String|Null} The detected manufacturer.
Expand All @@ -389,6 +403,7 @@

/**
* Picks the browser name from an array of guesses.
*
* @private
* @param {Array} guesses An array of guesses.
* @returns {String|Null} The detected browser name.
Expand All @@ -403,6 +418,7 @@

/**
* Picks the OS name from an array of guesses.
*
* @private
* @param {Array} guesses An array of guesses.
* @returns {String|Null} The detected OS name.
Expand Down Expand Up @@ -451,6 +467,7 @@

/**
* Picks the product name from an array of guesses.
*
* @private
* @param {Array} guesses An array of guesses.
* @returns {String|Null} The detected product name.
Expand Down Expand Up @@ -479,6 +496,7 @@

/**
* Resolves the version using an array of UA patterns.
*
* @private
* @param {Array} patterns An array of UA patterns.
* @returns {String|Null} The detected version.
Expand All @@ -494,6 +512,7 @@

/**
* Return platform description when the platform object is coerced to a string.
*
* @name toString
* @memberOf platform
* @type Function
Expand Down Expand Up @@ -784,27 +803,31 @@

/**
* The platform object.
*
* @name platform
* @type Object
*/
return {

/**
* The browser/environment version.
*
* @memberOf platform
* @type String|Null
*/
'version': name && version && (description.unshift(version), version),

/**
* The name of the browser/environment.
*
* @memberOf platform
* @type String|Null
*/
'name': name && (description.unshift(name), name),

/**
* The name of the operating system.
*
* @memberOf platform
* @type String|Null
*/
Expand All @@ -814,41 +837,47 @@

/**
* The platform description.
*
* @memberOf platform
* @type String|Null
*/
'description': description.length ? description.join(' ') : ua,

/**
* The name of the browser layout engine.
*
* @memberOf platform
* @type String|Null
*/
'layout': layout && layout[0],

/**
* The name of the product's manufacturer.
*
* @memberOf platform
* @type String|Null
*/
'manufacturer': manufacturer,

/**
* The alpha/beta release indicator.
*
* @memberOf platform
* @type String|Null
*/
'prerelease': prerelease,

/**
* The name of the product hosting the browser.
*
* @memberOf platform
* @type String|Null
*/
'product': product,

/**
* The browser's user agent string.
*
* @memberOf platform
* @type String|Null
*/
Expand Down

0 comments on commit c079ee5

Please sign in to comment.