Files
shields/services_test-validators.js.html
T

474 lines
21 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: services/test-validators.js</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: services/test-validators.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/**
* Joi validators that are shared across more than one service's tests.
* Validators which are only used by one service should be declared in
* that service's test file.
*
* @module
*/
import Joi from 'joi'
import { semver as isSemver } from './validators.js'
/**
* Creates a Joi string validator that matches the given regular expression.
*
* @param {RegExp} re Regular expression the string must match
* @returns {Joi.StringSchema} Joi string schema validating against the regex
*/
const withRegex = re => Joi.string().regex(re)
/**
* Validates a version string with three dotted numeric clauses prefixed
* by `v`, e.g. `v1.2.3`.
*
* @type {Joi.StringSchema}
*/
const isVPlusTripleDottedVersion = withRegex(/^v[0-9]+\.[0-9]+\.[0-9]+$/)
/**
* Validates a version string prefixed by `v` with at least a major version
* and optional minor and patch numbers, e.g. `v1`, `v1.2`, or `v1.2.3`.
*
* @type {Joi.StringSchema}
*/
const isVPlusDottedVersionAtLeastOne = withRegex(/^v\d+(\.\d+)?(\.\d+)?$/)
/**
* Validates a version number prefixed by `v` with N 'clauses',
* e.g. `v1.2` or `v1.22.7.392`.
*
* @type {Joi.StringSchema}
*/
const isVPlusDottedVersionNClauses = withRegex(/^v\d+(\.\d+)*$/)
/**
* Validates a version number prefixed by `v` with N 'clauses' and an
* optional text suffix, e.g. `-beta`, `-preview1`, `-release-candidate`,
* `+beta`, or `~pre9-12`.
*
* @type {Joi.StringSchema}
*/
const isVPlusDottedVersionNClausesWithOptionalSuffix = withRegex(
/^v\d+(\.\d+)*([-+~].*)?$/,
)
/**
* Same as {@link isVPlusDottedVersionNClausesWithOptionalSuffix}, but also
* accepts an optional 'epoch' prefix that can be found e.g. in distro
* package versions, like `4:6.3.0-4`.
*
* @type {Joi.StringSchema}
*/
const isVPlusDottedVersionNClausesWithOptionalSuffixAndEpoch = withRegex(
/^v(\d+:)?\d+(\.\d+)*([-+~].*)?$/,
)
/**
* Simple regex for testing Composer version rules, e.g. `7.1`, `>=5.6`,
* `>1.0 &lt;2.0`, `!=1.0 &lt;1.1 || >=1.2`, `7.1.*`, or `7.* || 5.6.*`.
* This regex does not support branches, minimum-stability, ref, or any (`*`).
*
* @see https://getcomposer.org/doc/articles/versions.md
* @see https://getcomposer.org/doc/04-schema.md#package-links
* @see https://getcomposer.org/doc/04-schema.md#minimum-stability
* @type {Joi.StringSchema}
*/
const isComposerVersion = withRegex(
/^\*|(\s*(>=|>|&lt;|&lt;=|!=|\^|~)?\d+(\.(\*|(\d+(\.(\d+|\*))?)))?((\s*\|*)?\s*(>=|>|&lt;|&lt;=|!=|\^|~)?\d+(\.(\*|(\d+(\.(\d+|\*))?)))?)*\s*)$/,
)
/**
* Validates the reduced PHP version string produced by
* `php-version.versionReduction()`, e.g. `>= 7`, `>= 7.1`,
* `5.4, 5.6, 7.2`, or `5.4 - 7.1, HHVM`.
*
* @type {Joi.StringSchema}
*/
const isPhpVersionReduction = withRegex(
/^((>= \d+(\.\d+)?)|(\d+\.\d+(, \d+\.\d+)*)|(\d+\.\d+ - \d+\.\d+))(, HHVM)?$/,
)
/**
* Validates a short or full git commit hash (7 to 40 hexadecimal characters).
*
* @type {Joi.StringSchema}
*/
const isCommitHash = withRegex(/^[a-f0-9]{7,40}$/)
/**
* Validates a 5-character star rating string composed of full, fractional,
* and empty star glyphs, e.g. `★★★¾☆`.
*
* @type {Joi.StringSchema}
*/
const isStarRating = withRegex(
/^(?=.{5}$)(\u2605{0,5}[\u00BC\u00BD\u00BE]?\u2606{0,5})$/,
)
/**
* Validates a metric-formatted positive number, e.g. `10`, `1k`, or `2.5M`.
* Required to be > 0, because accepting zero masks many problems.
*
* @type {Joi.StringSchema}
*/
const isMetric = withRegex(/^([1-9][0-9]*[kMGTPEZY]?|[1-9]\.[1-9][kMGTPEZY])$/)
/**
* Same as {@link isMetric}, but also accepts zero and negative numbers,
* e.g. `0`, `-1k`, or `-2.5M`.
*
* @type {Joi.StringSchema}
*/
const isMetricAllowNegative = withRegex(
/^(0|-?[1-9][0-9]*[kMGTPEZY]?|-?[0-9]\.[0-9][kMGTPEZY])$/,
)
/**
* Creates a validator that matches a metric (see {@link isMetric}) followed
* by another pattern, e.g. ` open` or `/year`.
*
* @param {RegExp} nestedRegexp Pattern that must appear after the metric
* @returns {Joi.StringSchema} Joi string schema for the combined pattern
*/
const isMetricWithPattern = nestedRegexp => {
const pattern = `^([1-9][0-9]*[kMGTPEZY]?|[1-9]\\.[1-9][kMGTPEZY])${nestedRegexp.source}$`
const regexp = new RegExp(pattern)
return withRegex(regexp)
}
/**
* Validates a metric followed by ` open`, e.g. `3 open` or `1.2k open`.
*
* @type {Joi.StringSchema}
*/
const isMetricOpenIssues = isMetricWithPattern(/ open/)
/**
* Validates a metric followed by ` closed`, e.g. `3 closed` or `1.2k closed`.
*
* @type {Joi.StringSchema}
*/
const isMetricClosedIssues = isMetricWithPattern(/ closed/)
/**
* Validates a metric followed by `/` and another metric, e.g. `3/10` or `1.2k/5k`.
*
* @type {Joi.StringSchema}
*/
const isMetricOverMetric = isMetricWithPattern(
/\/([1-9][0-9]*[kMGTPEZY]?|[1-9]\.[1-9][kMGTPEZY])/,
)
/**
* Validates a metric followed by `/` and a time period, e.g. `3/day` or `1.2k/month`.
*
* @type {Joi.StringSchema}
*/
const isMetricOverTimePeriod = isMetricWithPattern(
/\/(year|month|four weeks|quarter|week|day)/,
)
/**
* Validates a literal zero followed by `/` and a time period, e.g. `0/day` or `0/year`.
*
* @type {Joi.StringSchema}
*/
const isZeroOverTimePeriod = withRegex(
/^0\/(year|month|four weeks|quarter|week|day)$/,
)
/**
* Validates a non-negative integer percentage, e.g. `0%`, `75%`, or `100%`.
*
* @type {Joi.StringSchema}
*/
const isIntegerPercentage = withRegex(/^[1-9][0-9]?%|^100%|^0%$/)
/**
* Same as {@link isIntegerPercentage}, but also accepts negative values, e.g. `-25%`.
*
* @type {Joi.StringSchema}
*/
const isIntegerPercentageNegative = withRegex(/^-?[1-9][0-9]?%|^100%|^0%$/)
/**
* Validates a non-negative decimal percentage, e.g. `0.5%` or `12.34%`.
*
* @type {Joi.StringSchema}
*/
const isDecimalPercentage = withRegex(/^[0-9]+\.[0-9]*%$/)
/**
* Same as {@link isDecimalPercentage}, but also accepts negative values, e.g. `-0.5%`.
*
* @type {Joi.StringSchema}
*/
const isDecimalPercentageNegative = withRegex(/^-?[0-9]+\.[0-9]*%$/)
/**
* Validates any percentage string by combining {@link isIntegerPercentage},
* {@link isDecimalPercentage}, {@link isIntegerPercentageNegative}, and
* {@link isDecimalPercentageNegative}.
*
* @type {Joi.AlternativesSchema}
*/
const isPercentage = Joi.alternatives().try(
isIntegerPercentage,
isDecimalPercentage,
isIntegerPercentageNegative,
isDecimalPercentageNegative,
)
/**
* Validates a metric (SI) file size, e.g. `1 B`, `12.5 kB`, or `2 MB`.
*
* @type {Joi.StringSchema}
*/
const isMetricFileSize = withRegex(
/^[0-9]*[.]?[0-9]+\s(B|kB|KB|MB|GB|TB|PB|EB|ZB|YB)$/,
)
/**
* Validates an IEC (binary) file size, e.g. `1 B`, `12.5 KiB`, or `2 MiB`.
*
* @type {Joi.StringSchema}
*/
const isIecFileSize = withRegex(
/^[0-9]*[.]?[0-9]+\s(B|KiB|MiB|GiB|TiB|PiB|EiB|ZiB|YiB)$/,
)
/**
* Validates a human-readable formatted date, such as `today`, `yesterday`,
* `last tuesday`, or `january 2021`.
*
* @type {Joi.AlternativesSchema}
*/
const isFormattedDate = Joi.alternatives().try(
Joi.equal('today', 'yesterday'),
Joi.string().regex(/^last (sun|mon|tues|wednes|thurs|fri|satur)day$/),
Joi.string().regex(
/^(january|february|march|april|may|june|july|august|september|october|november|december)( \d{4})?$/,
),
)
/**
* Validates a relative formatted date, e.g. `2 days ago`, `in 3 months`,
* or `a few seconds ago`.
*
* @type {Joi.AlternativesSchema}
*/
const isRelativeFormattedDate = Joi.alternatives().try(
Joi.string().regex(
/^(in |)([0-9]+|a few|a|an|)(| )(second|minute|hour|day|month|year)(s|)( ago|)$/,
),
)
/**
* Validates a dependency state string, e.g. `up to date`, `3 out of date`,
* or `2 deprecated`.
*
* @type {Joi.StringSchema}
*/
const isDependencyState = withRegex(
/^(\d+ out of date|\d+ deprecated|up to date)$/,
)
/**
* Creates a validator for test totals in the format
* `&lt;n> &lt;passed>(, &lt;n> &lt;failed>)?(, &lt;n> &lt;skipped>)?`, e.g. `5 passed, 1 failed`.
*
* @param {object} labels Label strings used for each outcome
* @param {string} labels.passed Label for passing tests
* @param {string} labels.failed Label for failing tests
* @param {string} labels.skipped Label for skipped tests
* @returns {Joi.StringSchema} Joi string schema for the test totals format
*/
const makeTestTotalsValidator = ({ passed, failed, skipped }) =>
withRegex(
new RegExp(`^[0-9]+ ${passed}(, [0-9]+ ${failed})?(, [0-9]+ ${skipped})?$`),
)
/**
* Creates a validator for test totals in the compact format
* `&lt;passed> &lt;n>( | &lt;failed> &lt;n>)?( | &lt;skipped> &lt;n>)?`, e.g. `✔ 5 | ✘ 1`.
*
* @param {object} labels Label strings used for each outcome
* @param {string} labels.passed Label for passing tests
* @param {string} labels.failed Label for failing tests
* @param {string} labels.skipped Label for skipped tests
* @returns {Joi.StringSchema} Joi string schema for the compact test totals format
*/
const makeCompactTestTotalsValidator = ({ passed, failed, skipped }) =>
withRegex(
new RegExp(
`^${passed} [0-9]+( \\| ${failed} [0-9]+)?( \\| ${skipped} [0-9]+)?$`,
),
)
/**
* Validates a default test totals string with the labels `passed`, `failed`,
* and `skipped`, e.g. `5 passed, 1 failed, 2 skipped`.
*
* @type {Joi.StringSchema}
*/
const isDefaultTestTotals = makeTestTotalsValidator({
passed: 'passed',
failed: 'failed',
skipped: 'skipped',
})
/**
* Validates a default compact test totals string with the glyph labels
* `✔`, `✘`, and `➟`, e.g. `✔ 5 | ✘ 1 | ➟ 2`.
*
* @type {Joi.StringSchema}
*/
const isDefaultCompactTestTotals = makeCompactTestTotalsValidator({
passed: '✔',
failed: '✘',
skipped: '➟',
})
/**
* Validates a custom test totals string with the labels `good`, `bad`, and
* `n/a`, e.g. `5 good, 1 bad, 2 n/a`.
*
* @type {Joi.StringSchema}
*/
const isCustomTestTotals = makeTestTotalsValidator({
passed: 'good',
failed: 'bad',
skipped: 'n/a',
})
/**
* Validates a custom compact test totals string with the emoji labels
* `💃`, `🤦‍♀️`, and `🤷`, e.g. `💃 5 | 🤦‍♀️ 1 | 🤷 2`.
*
* @type {Joi.StringSchema}
*/
const isCustomCompactTestTotals = makeCompactTestTotalsValidator({
passed: '💃',
failed: '🤦‍♀️',
skipped: '🤷',
})
/**
* Validates an ordinal number string with a superscript suffix, e.g. `1ˢᵗ`, `2ⁿᵈ`, or `11ᵗʰ`.
*
* @type {Joi.StringSchema}
*/
const isOrdinalNumber = Joi.string().regex(/^[1-9][0-9]*(ᵗʰ|ˢᵗ|ⁿᵈ|ʳᵈ)$/)
/**
* Same as {@link isOrdinalNumber}, but followed by ` daily`, e.g. `1ˢᵗ daily`.
*
* @type {Joi.StringSchema}
*/
const isOrdinalNumberDaily = Joi.string().regex(
/^[1-9][0-9]*(ᵗʰ|ˢᵗ|ⁿᵈ|ʳᵈ) daily$/,
)
/**
* Validates a humanized duration string, e.g. `3 days`, `1 hour`, or `2 years`.
*
* @type {Joi.StringSchema}
*/
const isHumanized = Joi.string().regex(
/[0-9a-z]+ (second|seconds|minute|minutes|hour|hours|day|days|month|months|year|years)/,
)
/**
* Validates a currency amount string with an optional `$` prefix, thousands
* separators, and up to two decimal places. For example, `$1,530,602.24` and
* `1,530,602.24` are valid, while `$1,666.24$`, `,1,666,88,`, `1.6.66,6`, and
* `.1555.` are not.
*
* @type {Joi.StringSchema}
*/
const isCurrency = withRegex(
/(?=.*\d)^\$?(([1-9]\d{0,2}(,\d{3})*)|0)?(\.\d{1,2})?$/,
)
export {
isSemver,
isVPlusTripleDottedVersion,
isVPlusDottedVersionAtLeastOne,
isVPlusDottedVersionNClauses,
isVPlusDottedVersionNClausesWithOptionalSuffix,
isVPlusDottedVersionNClausesWithOptionalSuffixAndEpoch,
isComposerVersion,
isPhpVersionReduction,
isCommitHash,
isStarRating,
isMetric,
isMetricAllowNegative,
isMetricWithPattern,
isMetricOpenIssues,
isMetricClosedIssues,
isMetricOverMetric,
isMetricOverTimePeriod,
isZeroOverTimePeriod,
isPercentage,
isIntegerPercentage,
isDecimalPercentage,
isMetricFileSize,
isIecFileSize,
isFormattedDate,
isRelativeFormattedDate,
isDependencyState,
withRegex,
isDefaultTestTotals,
isDefaultCompactTestTotals,
isCustomTestTotals,
isCustomCompactTestTotals,
makeTestTotalsValidator,
makeCompactTestTotalsValidator,
isOrdinalNumber,
isOrdinalNumberDaily,
isHumanized,
isCurrency,
}
</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-badge-maker.html">badge-maker</a></li><li><a href="module-badge-maker_lib_xml.html">badge-maker/lib/xml</a></li><li><a href="module-core_base-service_base.html">core/base-service/base</a></li><li><a href="module-core_base-service_base-graphql.html">core/base-service/base-graphql</a></li><li><a href="module-core_base-service_base-json.html">core/base-service/base-json</a></li><li><a href="module-core_base-service_base-jsonl.html">core/base-service/base-jsonl</a></li><li><a href="module-core_base-service_base-svg-scraping.html">core/base-service/base-svg-scraping</a></li><li><a href="module-core_base-service_base-toml.html">core/base-service/base-toml</a></li><li><a href="module-core_base-service_base-xml.html">core/base-service/base-xml</a></li><li><a href="module-core_base-service_base-yaml.html">core/base-service/base-yaml</a></li><li><a href="module-core_base-service_categories.html">core/base-service/categories</a></li><li><a href="module-core_base-service_check-error-response.html">core/base-service/check-error-response</a></li><li><a href="module-core_base-service_errors.html">core/base-service/errors</a></li><li><a href="module-core_base-service_graphql.html">core/base-service/graphql</a></li><li><a href="module-core_base-service_openapi.html">core/base-service/openapi</a></li><li><a href="module-core_base-service_resource-cache.html">core/base-service/resource-cache</a></li><li><a href="module-core_base-service_service-definitions.html">core/base-service/service-definitions</a></li><li><a href="module-core_server_server.html">core/server/server</a></li><li><a href="module-core_service-test-runner_create-service-tester.html">core/service-test-runner/create-service-tester</a></li><li><a href="module-core_service-test-runner_icedfrisby-shields.html">core/service-test-runner/icedfrisby-shields</a></li><li><a href="module-core_service-test-runner_runner.html">core/service-test-runner/runner</a></li><li><a href="module-core_service-test-runner_service-tester.html">core/service-test-runner/service-tester</a></li><li><a href="module-core_service-test-runner_services-for-title.html">core/service-test-runner/services-for-title</a></li><li><a href="module-core_token-pooling_token-pool.html">core/token-pooling/token-pool</a></li><li><a href="module-services_build-status.html">services/build-status</a></li><li><a href="module-services_color-formatters.html">services/color-formatters</a></li><li><a href="module-services_contributor-count.html">services/contributor-count</a></li><li><a href="module-services_date.html">services/date</a></li><li><a href="module-services_downloads.html">services/downloads</a></li><li><a href="module-services_dynamic-common.html">services/dynamic-common</a></li><li><a href="module-services_dynamic_json-path.html">services/dynamic/json-path</a></li><li><a href="module-services_endpoint-common.html">services/endpoint-common</a></li><li><a href="module-services_licenses.html">services/licenses</a></li><li><a href="module-services_package-json-helpers.html">services/package-json-helpers</a></li><li><a href="module-services_php-version.html">services/php-version</a></li><li><a href="module-services_pipenv-helpers.html">services/pipenv-helpers</a></li><li><a href="module-services_route-builder.html">services/route-builder</a></li><li><a href="module-services_size.html">services/size</a></li><li><a href="module-services_steam_steam-base.html">services/steam/steam-base</a></li><li><a href="module-services_test-results.html">services/test-results</a></li><li><a href="module-services_test-validators.html">services/test-validators</a></li><li><a href="module-services_text-formatters.html">services/text-formatters</a></li><li><a href="module-services_validators.html">services/validators</a></li><li><a href="module-services_version.html">services/version</a></li><li><a href="module-services_website-status.html">services/website-status</a></li><li><a href="module-services_winget_version.html">services/winget/version</a></li></ul><h3>Classes</h3><ul><li><a href="BaseThunderstoreService.html">BaseThunderstoreService</a></li><li><a href="module.html#.exports">exports</a></li><li><a href="module-badge-maker_lib_xml.ElementList.html">ElementList</a></li><li><a href="module-badge-maker_lib_xml.XmlElement.html">XmlElement</a></li><li><a href="module-core_base-service_base-graphql-BaseGraphqlService.html">BaseGraphqlService</a></li><li><a href="module-core_base-service_base-jsonl-BaseJsonlService.html">BaseJsonlService</a></li><li><a href="module-core_base-service_base-json-BaseJsonService.html">BaseJsonService</a></li><li><a href="module-core_base-service_base-svg-scraping-BaseSvgScrapingService.html">BaseSvgScrapingService</a></li><li><a href="module-core_base-service_base-toml-BaseTomlService.html">BaseTomlService</a></li><li><a href="module-core_base-service_base-xml-BaseXmlService.html">BaseXmlService</a></li><li><a href="module-core_base-service_base-yaml-BaseYamlService.html">BaseYamlService</a></li><li><a href="module-core_base-service_base-BaseService.html">BaseService</a></li><li><a href="module-core_base-service_errors-ImproperlyConfigured.html">ImproperlyConfigured</a></li><li><a href="module-core_base-service_errors-Inaccessible.html">Inaccessible</a></li><li><a href="module-core_base-service_errors-InvalidParameter.html">InvalidParameter</a></li><li><a href="module-core_base-service_errors-InvalidResponse.html">InvalidResponse</a></li><li><a href="module-core_base-service_errors-NotFound.html">NotFound</a></li><li><a href="module-core_base-service_errors-ShieldsRuntimeError.html">ShieldsRuntimeError</a></li><li><a href="module-core_server_server-Server.html">Server</a></li><li><a href="module-core_service-test-runner_runner-Runner.html">Runner</a></li><li><a href="module-core_service-test-runner_service-tester-ServiceTester.html">ServiceTester</a></li><li><a href="module-core_token-pooling_token-pool-Token.html">Token</a></li><li><a href="module-core_token-pooling_token-pool-TokenPool.html">TokenPool</a></li><li><a href="module-services_route-builder.html">services/route-builder</a></li><li><a href="module-services_steam_steam-base-BaseSteamAPI.html">BaseSteamAPI</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-TUTORIAL.html">TUTORIAL</a></li><li><a href="tutorial-adding-new-config-values.html">adding-new-config-values</a></li><li><a href="tutorial-authentication.html">authentication</a></li><li><a href="tutorial-badge-redirectors.html">badge-redirectors</a></li><li><a href="tutorial-badge-urls.html">badge-urls</a></li><li><a href="tutorial-code-walkthrough.html">code-walkthrough</a></li><li><a href="tutorial-input-validation.html">input-validation</a></li><li><a href="tutorial-json-format.html">json-format</a></li><li><a href="tutorial-performance-testing.html">performance-testing</a></li><li><a href="tutorial-production-hosting.html">production-hosting</a></li><li><a href="tutorial-releases.html">releases</a></li><li><a href="tutorial-retiring-badges.html">retiring-badges</a></li><li><a href="tutorial-self-hosting.html">self-hosting</a></li><li><a href="tutorial-server-secrets.html">server-secrets</a></li><li><a href="tutorial-service-tests.html">service-tests</a></li></ul><h3>Global</h3><ul><li><a href="global.html#_formatLabelForStage">_formatLabelForStage</a></li><li><a href="global.html#assert">assert</a></li><li><a href="global.html#createNumRequestCounter">createNumRequestCounter</a></li><li><a href="global.html#escapeFormat">escapeFormat</a></li><li><a href="global.html#fakeJwtToken">fakeJwtToken</a></li><li><a href="global.html#generateFakeConfig">generateFakeConfig</a></li><li><a href="global.html#generateInstanceId">generateInstanceId</a></li><li><a href="global.html#getBadgeExampleCall">getBadgeExampleCall</a></li><li><a href="global.html#getServiceClassAuthOrigin">getServiceClassAuthOrigin</a></li><li><a href="global.html#getUserAgent">getUserAgent</a></li><li><a href="global.html#legacySonarResponse">legacySonarResponse</a></li><li><a href="global.html#logTrace">logTrace</a></li><li><a href="global.html#noteGithubTokenInvalidation">noteGithubTokenInvalidation</a></li><li><a href="global.html#parseJson">parseJson</a></li><li><a href="global.html#parseJsonl">parseJsonl</a></li><li><a href="global.html#rasterRedirectUrl">rasterRedirectUrl</a></li><li><a href="global.html#testAuth">testAuth</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.5</a> on Fri Oct 02 2026 16:19:52 GMT+0000 (Coordinated Universal Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>