diff --git a/docs/HockeyGame.html b/docs/HockeyGame.html index b41493f..7b1803c 100644 --- a/docs/HockeyGame.html +++ b/docs/HockeyGame.html @@ -92,7 +92,9 @@
-
+

Represent a the scoring of a hockey game. The two teams +playing are "home" and "away".

+
Constructors
diff --git a/docs/index.html b/docs/index.html index e7270e6..49a4da5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -90,7 +90,9 @@
- +

Represent a the scoring of a hockey game. The two teams +playing are "home" and "away".

+
@@ -129,7 +131,8 @@ function returns NaN

- +

Validate is the input string is a valid ISBN https://en.wikipedia.org/wiki/ISBN

+
@@ -144,7 +147,9 @@ function returns NaN

- +

Validate is the input string is a valid 10 digits ISBN as defined +in https://en.wikipedia.org/wiki/ISBN

+
@@ -159,7 +164,9 @@ function returns NaN

- +

Validate is the input string is a valid 13 digits ISBN as defined +in https://en.wikipedia.org/wiki/ISBN

+
diff --git a/docs/isValidIsbn.html b/docs/isValidIsbn.html index ef754e7..577ea1f 100644 --- a/docs/isValidIsbn.html +++ b/docs/isValidIsbn.html @@ -116,7 +116,8 @@
-
+

Validate is the input string is a valid ISBN https://en.wikipedia.org/wiki/ISBN

+
Parameters
@@ -139,7 +140,8 @@
- +

a text we want to test if it is a real isbn

+
diff --git a/docs/isValidIsbn10.html b/docs/isValidIsbn10.html index 5fc3edf..70c75ff 100644 --- a/docs/isValidIsbn10.html +++ b/docs/isValidIsbn10.html @@ -116,7 +116,9 @@
-
+

Validate is the input string is a valid 10 digits ISBN as defined +in https://en.wikipedia.org/wiki/ISBN

+
Parameters
@@ -139,7 +141,8 @@
- +

a text we want to test if it is a real isbn

+
diff --git a/docs/isValidIsbn13.html b/docs/isValidIsbn13.html index 21bcf10..7cb9bbc 100644 --- a/docs/isValidIsbn13.html +++ b/docs/isValidIsbn13.html @@ -116,7 +116,9 @@
-
+

Validate is the input string is a valid 13 digits ISBN as defined +in https://en.wikipedia.org/wiki/ISBN

+
Parameters
@@ -139,7 +141,8 @@
- +

a text we want to test if it is a real isbn

+
diff --git a/docs/search_index.js b/docs/search_index.js index a02c92f..0e1e33d 100644 --- a/docs/search_index.js +++ b/docs/search_index.js @@ -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"}]}; })() \ No newline at end of file diff --git a/modules-examples/books.js b/modules-examples/books.js index 5f57b67..6c30976 100644 --- a/modules-examples/books.js +++ b/modules-examples/books.js @@ -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); } diff --git a/modules-examples/hockey.js b/modules-examples/hockey.js index d3f743f..7b63591 100644 --- a/modules-examples/hockey.js +++ b/modules-examples/hockey.js @@ -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" } - }