added docs
This commit is contained in:
1 parent
8acba51d27
commit
8d9b66ea2e
8 files changed
+53
-13
No files matched your search
@@ -92,7 +92,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="doc_block_items"><div>
|
||||
<div class="doc_block_items"><div class="markdown_summary"><p>Represent a the scoring of a hockey game. The two teams
|
||||
playing are "home" and "away".</p>
|
||||
</div><div>
|
||||
Constructors
|
||||
<div class="section">
|
||||
<div class="doc_item" id="constructor_0">
|
||||
|
||||
+11
-4
@@ -90,7 +90,9 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="symbol_section_doc">
|
||||
|
||||
<div class="markdown_summary"><p>Represent a the scoring of a hockey game. The two teams
|
||||
playing are "home" and "away".</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -129,7 +131,8 @@ function returns NaN</p>
|
||||
</div>
|
||||
</td>
|
||||
<td class="symbol_section_doc">
|
||||
|
||||
<div class="markdown_summary"><p>Validate is the input string is a valid ISBN <a href="https://en.wikipedia.org/wiki/ISBN">https://en.wikipedia.org/wiki/ISBN</a></p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -144,7 +147,9 @@ function returns NaN</p>
|
||||
</div>
|
||||
</td>
|
||||
<td class="symbol_section_doc">
|
||||
|
||||
<div class="markdown_summary"><p>Validate is the input string is a valid 10 digits ISBN as defined
|
||||
in <a href="https://en.wikipedia.org/wiki/ISBN">https://en.wikipedia.org/wiki/ISBN</a></p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -159,7 +164,9 @@ function returns NaN</p>
|
||||
</div>
|
||||
</td>
|
||||
<td class="symbol_section_doc">
|
||||
|
||||
<div class="markdown_summary"><p>Validate is the input string is a valid 13 digits ISBN as defined
|
||||
in <a href="https://en.wikipedia.org/wiki/ISBN">https://en.wikipedia.org/wiki/ISBN</a></p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -116,7 +116,8 @@
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<div class="doc_block_items" id="function_isValidIsbn_0_div"><div>
|
||||
<div class="doc_block_items" id="function_isValidIsbn_0_div"><div class="markdown_summary"><p>Validate is the input string is a valid ISBN <a href="https://en.wikipedia.org/wiki/ISBN">https://en.wikipedia.org/wiki/ISBN</a></p>
|
||||
</div><div>
|
||||
Parameters
|
||||
<div class="section">
|
||||
<div class="doc_item" id="function_isValidIsbn_0_parameters_str">
|
||||
@@ -139,7 +140,8 @@
|
||||
</code>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="markdown"><p>a text we want to test if it is a real isbn</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><div>
|
||||
|
||||
@@ -116,7 +116,9 @@
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<div class="doc_block_items" id="function_isValidIsbn10_0_div"><div>
|
||||
<div class="doc_block_items" id="function_isValidIsbn10_0_div"><div class="markdown_summary"><p>Validate is the input string is a valid 10 digits ISBN as defined
|
||||
in <a href="https://en.wikipedia.org/wiki/ISBN">https://en.wikipedia.org/wiki/ISBN</a></p>
|
||||
</div><div>
|
||||
Parameters
|
||||
<div class="section">
|
||||
<div class="doc_item" id="function_isValidIsbn10_0_parameters_str">
|
||||
@@ -139,7 +141,8 @@
|
||||
</code>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="markdown"><p>a text we want to test if it is a real isbn</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><div>
|
||||
|
||||
@@ -116,7 +116,9 @@
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<div class="doc_block_items" id="function_isValidIsbn13_0_div"><div>
|
||||
<div class="doc_block_items" id="function_isValidIsbn13_0_div"><div class="markdown_summary"><p>Validate is the input string is a valid 13 digits ISBN as defined
|
||||
in <a href="https://en.wikipedia.org/wiki/ISBN">https://en.wikipedia.org/wiki/ISBN</a></p>
|
||||
</div><div>
|
||||
Parameters
|
||||
<div class="section">
|
||||
<div class="doc_item" id="function_isValidIsbn13_0_parameters_str">
|
||||
@@ -139,7 +141,8 @@
|
||||
</code>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="markdown"><p>a text we want to test if it is a real isbn</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><div>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
(function () {
|
||||
window.DENO_DOC_SEARCH_INDEX = {"nodes":[{"kind":"function","name":"isValidIsbn13","nsQualifiers":"","location":{"filename":"books.js","line":1,"col":0},"declarationKind":"export"},{"kind":"function","name":"isValidIsbn10","nsQualifiers":"","location":{"filename":"books.js","line":22,"col":0},"declarationKind":"export"},{"kind":"function","name":"isValidIsbn","nsQualifiers":"","location":{"filename":"books.js","line":46,"col":0},"declarationKind":"export"},{"kind":"class","name":"HockeyGame","nsQualifiers":"","location":{"filename":"hockey.js","line":1,"col":0},"declarationKind":"export"},{"kind":"variable","name":"INFINITY","nsQualifiers":"","location":{"filename":"stats.js","line":5,"col":13},"declarationKind":"export"},{"kind":"function","name":"average","nsQualifiers":"","location":{"filename":"stats.js","line":13,"col":0},"declarationKind":"export"},{"kind":"function","name":"std","nsQualifiers":"","location":{"filename":"stats.js","line":33,"col":0},"declarationKind":"export"}]};
|
||||
window.DENO_DOC_SEARCH_INDEX = {"nodes":[{"kind":"function","name":"isValidIsbn13","nsQualifiers":"","location":{"filename":"books.js","line":8,"col":0},"declarationKind":"export"},{"kind":"function","name":"isValidIsbn10","nsQualifiers":"","location":{"filename":"books.js","line":36,"col":0},"declarationKind":"export"},{"kind":"function","name":"isValidIsbn","nsQualifiers":"","location":{"filename":"books.js","line":65,"col":0},"declarationKind":"export"},{"kind":"class","name":"HockeyGame","nsQualifiers":"","location":{"filename":"hockey.js","line":6,"col":0},"declarationKind":"export"},{"kind":"variable","name":"INFINITY","nsQualifiers":"","location":{"filename":"stats.js","line":5,"col":13},"declarationKind":"export"},{"kind":"function","name":"average","nsQualifiers":"","location":{"filename":"stats.js","line":13,"col":0},"declarationKind":"export"},{"kind":"function","name":"std","nsQualifiers":"","location":{"filename":"stats.js","line":33,"col":0},"declarationKind":"export"}]};
|
||||
})()
|
||||
@@ -1,3 +1,10 @@
|
||||
|
||||
/**
|
||||
* Validate is the input string is a valid 13 digits ISBN as defined
|
||||
* in https://en.wikipedia.org/wiki/ISBN
|
||||
* @param {String} str a text we want to test if it is a real isbn
|
||||
* @returns {boolean} true/false depending is str is a valid 13 digits ISBN
|
||||
*/
|
||||
export function isValidIsbn13(str) {
|
||||
let sum, digit, check, i;
|
||||
|
||||
@@ -19,6 +26,13 @@ export function isValidIsbn13(str) {
|
||||
return (check.toString() === str[str.length - 1]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validate is the input string is a valid 10 digits ISBN as defined
|
||||
* in https://en.wikipedia.org/wiki/ISBN
|
||||
* @param {String} str a text we want to test if it is a real isbn
|
||||
* @returns {boolean} true/false depending is str is a valid 10 digits ISBN
|
||||
*/
|
||||
export function isValidIsbn10(str) {
|
||||
let sum, digit, weight, check, i;
|
||||
|
||||
@@ -43,6 +57,11 @@ export function isValidIsbn10(str) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validate is the input string is a valid ISBN https://en.wikipedia.org/wiki/ISBN
|
||||
* @param {String} str a text we want to test if it is a real isbn
|
||||
* @returns {boolean} true/false depending is str is a valid isbn
|
||||
*/
|
||||
export function isValidIsbn(str) {
|
||||
return isValidIsbn13(str) || isValidIsbn10(str);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
|
||||
/**
|
||||
* Represent a the scoring of a hockey game. The two teams
|
||||
* playing are "home" and "away".
|
||||
*/
|
||||
export class HockeyGame{
|
||||
constructor(){
|
||||
this.home = 0
|
||||
@@ -34,5 +39,4 @@ export class HockeyGame{
|
||||
}
|
||||
return "tie"
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user