diff --git a/badge-maker_lib_index.js.html b/badge-maker_lib_index.js.html index 838bb2d807..61c9254d1c 100644 --- a/badge-maker_lib_index.js.html +++ b/badge-maker_lib_index.js.html @@ -117,13 +117,13 @@ module.exports = {
diff --git a/badge-maker_lib_xml.js.html b/badge-maker_lib_xml.js.html index 47134dfacd..bf9e6352ad 100644 --- a/badge-maker_lib_xml.js.html +++ b/badge-maker_lib_xml.js.html @@ -132,13 +132,13 @@ module.exports = { escapeXml, stripXmlWhitespace, XmlElement, ElementList }
diff --git a/core_base-service_base-graphql.js.html b/core_base-service_base-graphql.js.html index c758601f1d..72b130c50e 100644 --- a/core_base-service_base-graphql.js.html +++ b/core_base-service_base-graphql.js.html @@ -130,13 +130,13 @@ export default BaseGraphqlService
diff --git a/core_base-service_base-json.js.html b/core_base-service_base-json.js.html index 95629ba754..85ca97fb80 100644 --- a/core_base-service_base-json.js.html +++ b/core_base-service_base-json.js.html @@ -91,13 +91,13 @@ export default BaseJsonService
diff --git a/core_base-service_base-svg-scraping.js.html b/core_base-service_base-svg-scraping.js.html index aac86c7971..be70cb2484 100644 --- a/core_base-service_base-svg-scraping.js.html +++ b/core_base-service_base-svg-scraping.js.html @@ -127,13 +127,13 @@ export default BaseSvgScrapingService
diff --git a/core_base-service_base-xml.js.html b/core_base-service_base-xml.js.html index 8467f1acc3..60ed18a0a9 100644 --- a/core_base-service_base-xml.js.html +++ b/core_base-service_base-xml.js.html @@ -106,13 +106,13 @@ export default BaseXmlService
diff --git a/core_base-service_base-yaml.js.html b/core_base-service_base-yaml.js.html index de6f82a27d..f57dc04ecc 100644 --- a/core_base-service_base-yaml.js.html +++ b/core_base-service_base-yaml.js.html @@ -109,13 +109,13 @@ export default BaseYamlService
diff --git a/core_base-service_base.js.html b/core_base-service_base.js.html index 162623ca9b..9119f84d1f 100644 --- a/core_base-service_base.js.html +++ b/core_base-service_base.js.html @@ -619,13 +619,13 @@ export default BaseService
diff --git a/core_base-service_errors.js.html b/core_base-service_errors.js.html index 840e267fd0..cb91645b7f 100644 --- a/core_base-service_errors.js.html +++ b/core_base-service_errors.js.html @@ -255,13 +255,13 @@ export {
diff --git a/core_base-service_graphql.js.html b/core_base-service_graphql.js.html index 204c07bdbc..7d0612c56f 100644 --- a/core_base-service_graphql.js.html +++ b/core_base-service_graphql.js.html @@ -87,13 +87,13 @@ export { mergeQueries }
diff --git a/core_base-service_resource-cache.js.html b/core_base-service_resource-cache.js.html index 7cc5e85a3f..e1923a93f9 100644 --- a/core_base-service_resource-cache.js.html +++ b/core_base-service_resource-cache.js.html @@ -42,14 +42,16 @@ let resourceCache = Object.create(null) /** * Make a HTTP request using an in-memory cache * - * @param {object} attrs Refer to individual attrs - * @param {string} attrs.url URL to request - * @param {number} attrs.ttl Number of milliseconds to keep cached value for - * @param {boolean} [attrs.json=true] True if we expect to parse the response as JSON - * @param {Function} [attrs.scraper=buffer => buffer] Function to extract value from the response - * @param {object} [attrs.options={}] Options to pass to got - * @param {Function} [attrs.requestFetcher=fetch] Custom fetch function - * @returns {*} Parsed response + * @async + * @param {object} attrs - Refer to individual attrs + * @param {string} attrs.url - URL to request + * @param {number} attrs.ttl - Number of milliseconds to keep cached value for + * @param {boolean} [attrs.json=true] - True if we expect to parse the response as JSON + * @param {Function} [attrs.scraper=buffer => buffer] - Function to extract value from the response + * @param {object} [attrs.options={}] - Options to pass to got + * @param {Function} [attrs.requestFetcher=fetch] - Custom fetch function + * @throws {InvalidResponse} - Error if unable to parse response + * @returns {Promise<*>} Promise that resolves to parsed response */ async function getCachedResource({ url, @@ -103,13 +105,13 @@ export { getCachedResource, clearResourceCache }
diff --git a/core_server_prometheus-metrics.js.html b/core_server_prometheus-metrics.js.html index da9cc1e393..c8aa418544 100644 --- a/core_server_prometheus-metrics.js.html +++ b/core_server_prometheus-metrics.js.html @@ -121,13 +121,13 @@ export default class PrometheusMetrics {
diff --git a/core_server_server.js.html b/core_server_server.js.html index 34e954935c..0313574ac3 100644 --- a/core_server_server.js.html +++ b/core_server_server.js.html @@ -629,13 +629,13 @@ export default Server
diff --git a/core_service-test-runner_create-service-tester.js.html b/core_service-test-runner_create-service-tester.js.html index dcd1fa4cd5..c9f3dd491e 100644 --- a/core_service-test-runner_create-service-tester.js.html +++ b/core_service-test-runner_create-service-tester.js.html @@ -68,13 +68,13 @@ export default createServiceTester
diff --git a/core_service-test-runner_icedfrisby-shields.js.html b/core_service-test-runner_icedfrisby-shields.js.html index 5ed1f311cd..b45c42c9b9 100644 --- a/core_service-test-runner_icedfrisby-shields.js.html +++ b/core_service-test-runner_icedfrisby-shields.js.html @@ -140,13 +140,13 @@ export default factory
diff --git a/core_service-test-runner_infer-pull-request.js.html b/core_service-test-runner_infer-pull-request.js.html index 76e728080a..4b78e76735 100644 --- a/core_service-test-runner_infer-pull-request.js.html +++ b/core_service-test-runner_infer-pull-request.js.html @@ -138,13 +138,13 @@ export { parseGithubPullRequestUrl, parseGithubRepoSlug, inferPullRequest }
diff --git a/core_service-test-runner_runner.js.html b/core_service-test-runner_runner.js.html index a924c04e9b..2c443fdbbb 100644 --- a/core_service-test-runner_runner.js.html +++ b/core_service-test-runner_runner.js.html @@ -112,13 +112,13 @@ export default Runner
diff --git a/core_service-test-runner_service-tester.js.html b/core_service-test-runner_service-tester.js.html index d44c210b77..305df4cd45 100644 --- a/core_service-test-runner_service-tester.js.html +++ b/core_service-test-runner_service-tester.js.html @@ -178,13 +178,13 @@ export default ServiceTester
diff --git a/core_service-test-runner_services-for-title.js.html b/core_service-test-runner_services-for-title.js.html index e4980b0419..1eb8cf1ccc 100644 --- a/core_service-test-runner_services-for-title.js.html +++ b/core_service-test-runner_services-for-title.js.html @@ -69,13 +69,13 @@ export default servicesForTitle
diff --git a/core_token-pooling_token-pool.js.html b/core_token-pooling_token-pool.js.html index 41e699b1f0..6ae26d6554 100644 --- a/core_token-pooling_token-pool.js.html +++ b/core_token-pooling_token-pool.js.html @@ -373,13 +373,13 @@ export { sanitizeToken, Token, TokenPool }
diff --git a/global.html b/global.html index 1c25a5e51f..7e2f4fb30f 100644 --- a/global.html +++ b/global.html @@ -678,13 +678,13 @@
diff --git a/index.html b/index.html index 49e8eef9df..c195d3c79f 100644 --- a/index.html +++ b/index.html @@ -214,13 +214,13 @@ under their terms and license.


diff --git a/module-badge-maker.html b/module-badge-maker.html index 099ff65fe4..1e788c4f28 100644 --- a/module-badge-maker.html +++ b/module-badge-maker.html @@ -423,13 +423,13 @@
diff --git a/module-badge-maker_lib_xml-ElementList.html b/module-badge-maker_lib_xml-ElementList.html index 9c7b60adf4..e10ec66fac 100644 --- a/module-badge-maker_lib_xml-ElementList.html +++ b/module-badge-maker_lib_xml-ElementList.html @@ -157,13 +157,13 @@ like an XmlElement but renders multiple XML tags (not wrapped in a ).


diff --git a/module-badge-maker_lib_xml-XmlElement.html b/module-badge-maker_lib_xml-XmlElement.html index 500cfa5bef..d23a2faaa5 100644 --- a/module-badge-maker_lib_xml-XmlElement.html +++ b/module-badge-maker_lib_xml-XmlElement.html @@ -468,13 +468,13 @@ element will be rendered as a self-closing element.


diff --git a/module-badge-maker_lib_xml.html b/module-badge-maker_lib_xml.html index c9a321d5d5..39f23d0fd3 100644 --- a/module-badge-maker_lib_xml.html +++ b/module-badge-maker_lib_xml.html @@ -122,13 +122,13 @@
diff --git a/module-core_base-service_base-BaseService.html b/module-core_base-service_base-BaseService.html index 59b7d4f8ae..5e819db6c0 100644 --- a/module-core_base-service_base-BaseService.html +++ b/module-core_base-service_base-BaseService.html @@ -739,13 +739,13 @@ defined in this.route.pattern or this.route.capture


diff --git a/module-core_base-service_base-graphql-BaseGraphqlService.html b/module-core_base-service_base-graphql-BaseGraphqlService.html index 25ea6eeb58..2e34e77cb1 100644 --- a/module-core_base-service_base-graphql-BaseGraphqlService.html +++ b/module-core_base-service_base-graphql-BaseGraphqlService.html @@ -823,13 +823,13 @@ an InvalidResponse.


diff --git a/module-core_base-service_base-graphql.html b/module-core_base-service_base-graphql.html index d14f30d168..294b7b14df 100644 --- a/module-core_base-service_base-graphql.html +++ b/module-core_base-service_base-graphql.html @@ -119,13 +119,13 @@
diff --git a/module-core_base-service_base-json-BaseJsonService.html b/module-core_base-service_base-json-BaseJsonService.html index 4e5f28c2bd..01516f1634 100644 --- a/module-core_base-service_base-json-BaseJsonService.html +++ b/module-core_base-service_base-json-BaseJsonService.html @@ -668,13 +668,13 @@ This can be used to extend or override the
diff --git a/module-core_base-service_base-json.html b/module-core_base-service_base-json.html index 67ed7abe17..6f8607bcd3 100644 --- a/module-core_base-service_base-json.html +++ b/module-core_base-service_base-json.html @@ -119,13 +119,13 @@
diff --git a/module-core_base-service_base-svg-scraping-BaseSvgScrapingService.html b/module-core_base-service_base-svg-scraping-BaseSvgScrapingService.html index 1ed6725fe1..f468a55356 100644 --- a/module-core_base-service_base-svg-scraping-BaseSvgScrapingService.html +++ b/module-core_base-service_base-svg-scraping-BaseSvgScrapingService.html @@ -759,13 +759,13 @@ This can be used to extend or override the
diff --git a/module-core_base-service_base-svg-scraping.html b/module-core_base-service_base-svg-scraping.html index c75a6ee665..4aaac89cd4 100644 --- a/module-core_base-service_base-svg-scraping.html +++ b/module-core_base-service_base-svg-scraping.html @@ -119,13 +119,13 @@
diff --git a/module-core_base-service_base-xml-BaseXmlService.html b/module-core_base-service_base-xml-BaseXmlService.html index d02f905d88..13475a4647 100644 --- a/module-core_base-service_base-xml-BaseXmlService.html +++ b/module-core_base-service_base-xml-BaseXmlService.html @@ -551,13 +551,13 @@ This can be used to extend or override the
diff --git a/module-core_base-service_base-xml.html b/module-core_base-service_base-xml.html index 15cf9d33e0..eaf0d255da 100644 --- a/module-core_base-service_base-xml.html +++ b/module-core_base-service_base-xml.html @@ -119,13 +119,13 @@
diff --git a/module-core_base-service_base-yaml-BaseYamlService.html b/module-core_base-service_base-yaml-BaseYamlService.html index ec0ead4482..ee9d73f6f3 100644 --- a/module-core_base-service_base-yaml-BaseYamlService.html +++ b/module-core_base-service_base-yaml-BaseYamlService.html @@ -548,13 +548,13 @@ This can be used to extend or override the
diff --git a/module-core_base-service_base-yaml.html b/module-core_base-service_base-yaml.html index 243c77e915..3501dd0b0a 100644 --- a/module-core_base-service_base-yaml.html +++ b/module-core_base-service_base-yaml.html @@ -119,13 +119,13 @@
diff --git a/module-core_base-service_base.html b/module-core_base-service_base.html index bf94c1e471..fe5ba4088c 100644 --- a/module-core_base-service_base.html +++ b/module-core_base-service_base.html @@ -1202,13 +1202,13 @@ when the parameter is absent. (Note that in,
diff --git a/module-core_base-service_errors-Deprecated.html b/module-core_base-service_errors-Deprecated.html index 8131faa438..12e46573e9 100644 --- a/module-core_base-service_errors-Deprecated.html +++ b/module-core_base-service_errors-Deprecated.html @@ -205,13 +205,13 @@
diff --git a/module-core_base-service_errors-ImproperlyConfigured.html b/module-core_base-service_errors-ImproperlyConfigured.html index 93781eea34..ea3173a608 100644 --- a/module-core_base-service_errors-ImproperlyConfigured.html +++ b/module-core_base-service_errors-ImproperlyConfigured.html @@ -205,13 +205,13 @@
diff --git a/module-core_base-service_errors-Inaccessible.html b/module-core_base-service_errors-Inaccessible.html index 4a2e7a669a..493166bf3e 100644 --- a/module-core_base-service_errors-Inaccessible.html +++ b/module-core_base-service_errors-Inaccessible.html @@ -206,13 +206,13 @@ or to wrap a 5XX response


diff --git a/module-core_base-service_errors-InvalidParameter.html b/module-core_base-service_errors-InvalidParameter.html index 93bf41b2e1..2d75984195 100644 --- a/module-core_base-service_errors-InvalidParameter.html +++ b/module-core_base-service_errors-InvalidParameter.html @@ -206,13 +206,13 @@ is invalid or unexpected


diff --git a/module-core_base-service_errors-InvalidResponse.html b/module-core_base-service_errors-InvalidResponse.html index 9f23fa6843..c5bd677ea6 100644 --- a/module-core_base-service_errors-InvalidResponse.html +++ b/module-core_base-service_errors-InvalidResponse.html @@ -205,13 +205,13 @@
diff --git a/module-core_base-service_errors-NotFound.html b/module-core_base-service_errors-NotFound.html index 12e13b4493..7f24fbee24 100644 --- a/module-core_base-service_errors-NotFound.html +++ b/module-core_base-service_errors-NotFound.html @@ -205,13 +205,13 @@
diff --git a/module-core_base-service_errors-ShieldsRuntimeError.html b/module-core_base-service_errors-ShieldsRuntimeError.html index 16cfe56ead..892d2878b1 100644 --- a/module-core_base-service_errors-ShieldsRuntimeError.html +++ b/module-core_base-service_errors-ShieldsRuntimeError.html @@ -378,13 +378,13 @@ should override this method.


diff --git a/module-core_base-service_errors.html b/module-core_base-service_errors.html index 36dc04e314..53e5e4bc38 100644 --- a/module-core_base-service_errors.html +++ b/module-core_base-service_errors.html @@ -312,13 +312,13 @@ badge when we catch and render the exception (Optional)


diff --git a/module-core_base-service_graphql.html b/module-core_base-service_graphql.html index d553b528ae..de33523ad7 100644 --- a/module-core_base-service_graphql.html +++ b/module-core_base-service_graphql.html @@ -290,13 +290,13 @@ but can't use that due to incorrect packaging.


diff --git a/module-core_base-service_resource-cache.html b/module-core_base-service_resource-cache.html index be2cbb62a2..ee71e64f2a 100644 --- a/module-core_base-service_resource-cache.html +++ b/module-core_base-service_resource-cache.html @@ -106,7 +106,7 @@ -

(async, inner) getCachedResource(attrs) → {*}

+

(async, inner) getCachedResource(attrs) → {Promise.<*>}

@@ -463,7 +463,7 @@
Source:
@@ -486,13 +486,44 @@ +
Throws:
+ + + +
+
+
+
    +
  • Error if unable to parse response
  • +
+
+
+
+
+
+
+ Type +
+
+ +InvalidResponse + + +
+
+
+
+
+ + +
Returns:
-

Parsed response

+

Promise that resolves to parsed response

@@ -503,7 +534,7 @@
-* +Promise.<*>
@@ -531,13 +562,13 @@
diff --git a/module-core_server_server-Server.html b/module-core_server_server-Server.html index 9c6db4bd5c..77d03a6453 100644 --- a/module-core_server_server-Server.html +++ b/module-core_server_server-Server.html @@ -675,13 +675,13 @@ Start listening for requests on this.baseUrl()


diff --git a/module-core_server_server.html b/module-core_server_server.html index 3e9d7e32de..8860ac1048 100644 --- a/module-core_server_server.html +++ b/module-core_server_server.html @@ -119,13 +119,13 @@
diff --git a/module-core_service-test-runner_create-service-tester.html b/module-core_service-test-runner_create-service-tester.html index 90054c4bc4..074dc43eed 100644 --- a/module-core_service-test-runner_create-service-tester.html +++ b/module-core_service-test-runner_create-service-tester.html @@ -230,13 +230,13 @@ service.


diff --git a/module-core_service-test-runner_icedfrisby-shields.html b/module-core_service-test-runner_icedfrisby-shields.html index a9c39ff6df..e7125d52c1 100644 --- a/module-core_service-test-runner_icedfrisby-shields.html +++ b/module-core_service-test-runner_icedfrisby-shields.html @@ -286,13 +286,13 @@
diff --git a/module-core_service-test-runner_infer-pull-request.html b/module-core_service-test-runner_infer-pull-request.html index 0f9f65cec7..08e8228bda 100644 --- a/module-core_service-test-runner_infer-pull-request.html +++ b/module-core_service-test-runner_infer-pull-request.html @@ -506,13 +506,13 @@ of a pull request from the environment variables.


diff --git a/module-core_service-test-runner_runner-Runner.html b/module-core_service-test-runner_runner-Runner.html index ce44d4d73e..690dbf22e4 100644 --- a/module-core_service-test-runner_runner-Runner.html +++ b/module-core_service-test-runner_runner-Runner.html @@ -562,13 +562,13 @@ overridden on instances.


diff --git a/module-core_service-test-runner_runner.html b/module-core_service-test-runner_runner.html index 9bb8741328..39bb566e7a 100644 --- a/module-core_service-test-runner_runner.html +++ b/module-core_service-test-runner_runner.html @@ -119,13 +119,13 @@
diff --git a/module-core_service-test-runner_service-tester-ServiceTester.html b/module-core_service-test-runner_service-tester-ServiceTester.html index 9456a10920..ca76f25146 100644 --- a/module-core_service-test-runner_service-tester-ServiceTester.html +++ b/module-core_service-test-runner_service-tester-ServiceTester.html @@ -1120,13 +1120,13 @@ the CLI, or directly on the tester.


diff --git a/module-core_service-test-runner_service-tester.html b/module-core_service-test-runner_service-tester.html index 9671043370..715d502cbc 100644 --- a/module-core_service-test-runner_service-tester.html +++ b/module-core_service-test-runner_service-tester.html @@ -119,13 +119,13 @@
diff --git a/module-core_service-test-runner_services-for-title.html b/module-core_service-test-runner_services-for-title.html index aa7d69b0ec..9ca62036c0 100644 --- a/module-core_service-test-runner_services-for-title.html +++ b/module-core_service-test-runner_services-for-title.html @@ -278,13 +278,13 @@ as an array of strings.


diff --git a/module-core_token-pooling_token-pool-Token.html b/module-core_token-pooling_token-pool-Token.html index 814ff131d6..06248f426b 100644 --- a/module-core_token-pooling_token-pool-Token.html +++ b/module-core_token-pooling_token-pool-Token.html @@ -709,13 +709,13 @@ stable ordering for a valid priority queue.


diff --git a/module-core_token-pooling_token-pool-TokenPool.html b/module-core_token-pooling_token-pool-TokenPool.html index 3fcfa01029..5b3a4a32df 100644 --- a/module-core_token-pooling_token-pool-TokenPool.html +++ b/module-core_token-pooling_token-pool-TokenPool.html @@ -893,13 +893,13 @@ indicate it should not be reused.


diff --git a/module-core_token-pooling_token-pool.html b/module-core_token-pooling_token-pool.html index 69c80a29e1..528af2941a 100644 --- a/module-core_token-pooling_token-pool.html +++ b/module-core_token-pooling_token-pool.html @@ -285,13 +285,13 @@
diff --git a/module-services_build-status.html b/module-services_build-status.html index a27c9cf97a..f0bdc8e5e1 100644 --- a/module-services_build-status.html +++ b/module-services_build-status.html @@ -447,13 +447,13 @@ Determines the message and color of the badge according to the build status.


diff --git a/module-services_color-formatters.html b/module-services_color-formatters.html index fae14365b4..70919aed68 100644 --- a/module-services_color-formatters.html +++ b/module-services_color-formatters.html @@ -1526,13 +1526,13 @@ The color defaults to red if the score does not matches with any of the grade va
diff --git a/module-services_contributor-count.html b/module-services_contributor-count.html index e9161e2452..f714a2f0cd 100644 --- a/module-services_contributor-count.html +++ b/module-services_contributor-count.html @@ -530,13 +530,13 @@ Determines the message and color of the badge according to the contributor count
diff --git a/module-services_downloads.html b/module-services_downloads.html index 5b31da4bf8..d4e9645484 100644 --- a/module-services_downloads.html +++ b/module-services_downloads.html @@ -540,13 +540,13 @@ this value as the prefix for versioned badges, e.g. foobar@v1.23. D
diff --git a/module-services_dynamic-common.html b/module-services_dynamic-common.html index dfe4569068..e335f0516e 100644 --- a/module-services_dynamic-common.html +++ b/module-services_dynamic-common.html @@ -954,13 +954,13 @@ Sets the color of the badge to blue.


diff --git a/module-services_dynamic_json-path.html b/module-services_dynamic_json-path.html index 340f2f6494..2db6b73490 100644 --- a/module-services_dynamic_json-path.html +++ b/module-services_dynamic_json-path.html @@ -417,13 +417,13 @@ This can be used to extend or override the
diff --git a/module-services_endpoint-common.html b/module-services_endpoint-common.html index 1eaa82eeca..472ee8063b 100644 --- a/module-services_endpoint-common.html +++ b/module-services_endpoint-common.html @@ -804,13 +804,13 @@ Optionally it prints those keys in the message to provide detailed feedback.


diff --git a/module-services_licenses.html b/module-services_licenses.html index 88219fbcee..feca003d2d 100644 --- a/module-services_licenses.html +++ b/module-services_licenses.html @@ -644,13 +644,13 @@ Sets the badge color to the provided value, if not provided then the color is us
diff --git a/module-services_package-json-helpers.html b/module-services_package-json-helpers.html index 84d0250258..ce1be42902 100644 --- a/module-services_package-json-helpers.html +++ b/module-services_package-json-helpers.html @@ -650,13 +650,13 @@ Checks if the object has all the dependency types and the dependency types are v
diff --git a/module-services_php-version.html b/module-services_php-version.html new file mode 100644 index 0000000000..31f0e13ec8 --- /dev/null +++ b/module-services_php-version.html @@ -0,0 +1,1481 @@ + + + + + JSDoc: Module: services/php-version + + + + + + + + + + +
+ +

Module: services/php-version

+ + + + + + +
+ +
+ +
+ +
+
+ + +

Utilities relating to PHP version numbers. This compares version numbers +using the algorithm followed by Composer (see +https://getcomposer.org/doc/04-schema.md#version).

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(inner) asciiVersionCompare(v1, v2) → {number}

+ + + + + + +
+

Return a negative value if v1 < v2, +zero if v1 = v2, a positive value otherwise.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
v1 + + +string + + + +

First version for comparison

v2 + + +string + + + +

Second version for comparison

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Comparison result (-1, 0 or 1)

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + + + + + + +

(inner) compare(v1, v2) → {number}

+ + + + + + +
+

Compares two versions and return an interger based on the result. +See https://getcomposer.org/doc/04-schema.md#version +and https://github.com/badges/shields/issues/319#issuecomment-74411045

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
v1 + + +string + + + +

First version

v2 + + +string + + + +

Second version

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Negative value if v1 < v2, zero if v1 = v2, else a positive value

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + + + + + + +

(async, inner) getPhpReleases(githubApiProvider) → {Promise.<*>}

+ + + + + + +
+

Fetches the PHP release versions from cache if exists, else fetch from the souce url and save in cache.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
githubApiProvider + + +object + + + +

Github API provider

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Promise that resolves to parsed response

+
+ + + +
+
+ Type +
+
+ +Promise.<*> + + +
+
+ + + + + + + + + + + + + +

(inner) isStable(version) → {boolean}

+ + + + + + +
+

Determines if a version is stable or not.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
version + + +string + + + +

Version number

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

true if version is stable, else false

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + + + + +

(inner) latest(versions) → {string}

+ + + + + + +
+

Determines the latest version from a list of versions.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
versions + + +Array.<string> + + + +

List of versions

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Latest version

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + + + + +

(inner) minorVersion(version) → {string}

+ + + + + + +
+

Checks if a version is valid and returns the minor version.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
version + + +string + + + +

Version number

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Minor version

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + + + + +

(inner) numberedVersionData(version) → {object}

+ + + + + + +
+

Take a version without the starting v. +eg, '1.0.x-beta' +Return { numbers: [1,0,something big], modifier: 2, modifierCount: 1 }

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
version + + +string + + + +

Version number string

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Object containing version details

+
+ + + +
+
+ Type +
+
+ +object + + +
+
+ + + + + + + + + + + + + +

(inner) versionReduction(versions, phpReleases) → {Array.<string>}

+ + + + + + +
+

Reduces the list of php versions that intersect with release versions to a version range (for eg. '5.4 - 7.1', '>= 5.5').

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
versions + + +Array.<string> + + + +

List of php versions

phpReleases + + +Array.<string> + + + +

List of php release versions

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Reduced Version Range (for eg. ['5.4 - 7.1'], ['>= 5.5'])

+
+ + + +
+
+ Type +
+
+ +Array.<string> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/module-services_steam_steam-base-BaseSteamAPI.html b/module-services_steam_steam-base-BaseSteamAPI.html index 3ec7e65ab2..377e38b9b5 100644 --- a/module-services_steam_steam-base-BaseSteamAPI.html +++ b/module-services_steam_steam-base-BaseSteamAPI.html @@ -374,13 +374,13 @@
diff --git a/module-services_steam_steam-base.html b/module-services_steam_steam-base.html index bb4f0663eb..06613a2178 100644 --- a/module-services_steam_steam-base.html +++ b/module-services_steam_steam-base.html @@ -119,13 +119,13 @@
diff --git a/services_build-status.js.html b/services_build-status.js.html index 39b2de4042..0db1777dc6 100644 --- a/services_build-status.js.html +++ b/services_build-status.js.html @@ -134,13 +134,13 @@ export { isBuildStatus, renderBuildStatusBadge }
diff --git a/services_color-formatters.js.html b/services_color-formatters.js.html index ecb9b89e38..b0c9b84ae6 100644 --- a/services_color-formatters.js.html +++ b/services_color-formatters.js.html @@ -234,13 +234,13 @@ export {
diff --git a/services_contributor-count.js.html b/services_contributor-count.js.html index 118cfab7d3..67e37f9420 100644 --- a/services_contributor-count.js.html +++ b/services_contributor-count.js.html @@ -79,13 +79,13 @@ export { contributorColor, renderContributorBadge }
diff --git a/services_downloads.js.html b/services_downloads.js.html index fa52a43025..f72ae85fdd 100644 --- a/services_downloads.js.html +++ b/services_downloads.js.html @@ -95,13 +95,13 @@ export { renderDownloadsBadge }
diff --git a/services_dynamic-common.js.html b/services_dynamic-common.js.html index dced9f60fd..e48c6d8ec8 100644 --- a/services_dynamic-common.js.html +++ b/services_dynamic-common.js.html @@ -136,13 +136,13 @@ export {
diff --git a/services_dynamic_json-path.js.html b/services_dynamic_json-path.js.html index 0646d8d0cb..b54ff31faa 100644 --- a/services_dynamic_json-path.js.html +++ b/services_dynamic_json-path.js.html @@ -114,13 +114,13 @@ export default superclass =>
diff --git a/services_endpoint-common.js.html b/services_endpoint-common.js.html index 8ab67efd90..9628ba64b7 100644 --- a/services_endpoint-common.js.html +++ b/services_endpoint-common.js.html @@ -142,13 +142,13 @@ export { validateEndpointData, fetchEndpointData }
diff --git a/services_licenses.js.html b/services_licenses.js.html index 554d5b7d15..50c370edcb 100644 --- a/services_licenses.js.html +++ b/services_licenses.js.html @@ -195,13 +195,13 @@ export { licenseToColor, renderLicenseBadge }
diff --git a/services_package-json-helpers.js.html b/services_package-json-helpers.js.html index 162c34d232..3145087207 100644 --- a/services_package-json-helpers.js.html +++ b/services_package-json-helpers.js.html @@ -114,13 +114,13 @@ export { isDependencyMap, isPackageJsonWithDependencies, getDependencyVersion }
diff --git a/services_packagist_packagist-base.js.html b/services_packagist_packagist-base.js.html index 85ea77fc76..24541f59c9 100644 --- a/services_packagist_packagist-base.js.html +++ b/services_packagist_packagist-base.js.html @@ -223,13 +223,13 @@ export {
diff --git a/services_php-version.js.html b/services_php-version.js.html new file mode 100644 index 0000000000..d4e33d0566 --- /dev/null +++ b/services_php-version.js.html @@ -0,0 +1,350 @@ + + + + + JSDoc: Source: services/php-version.js + + + + + + + + + + +
+ +

Source: services/php-version.js

+ + + + + + +
+
+
/**
+ * Utilities relating to PHP version numbers. This compares version numbers
+ * using the algorithm followed by Composer (see
+ * https://getcomposer.org/doc/04-schema.md#version).
+ *
+ * @module
+ */
+
+import { fetch } from '../core/base-service/got.js'
+import { getCachedResource } from '../core/base-service/resource-cache.js'
+import { listCompare } from './version.js'
+import { omitv } from './text-formatters.js'
+
+/**
+ * Return a negative value if v1 < v2,
+ * zero if v1 = v2, a positive value otherwise.
+ *
+ * @param {string} v1 - First version for comparison
+ * @param {string} v2 - Second version for comparison
+ * @returns {number} Comparison result (-1, 0 or 1)
+ */
+function asciiVersionCompare(v1, v2) {
+  if (v1 < v2) {
+    return -1
+  } else if (v1 > v2) {
+    return 1
+  } else {
+    return 0
+  }
+}
+
+/**
+ * Take a version without the starting v.
+ * eg, '1.0.x-beta'
+ * Return { numbers: [1,0,something big], modifier: 2, modifierCount: 1 }
+ *
+ * @param {string} version - Version number string
+ * @returns {object} Object containing version details
+ */
+function numberedVersionData(version) {
+  // A version has a numbered part and a modifier part
+  // (eg, 1.0.0-patch, 2.0.x-dev).
+  const parts = version.split('-')
+  const numbered = parts[0]
+
+  // Aliases that get caught here.
+  if (numbered === 'dev') {
+    return {
+      numbers: parts[1],
+      modifier: 5,
+      modifierCount: 1,
+    }
+  }
+
+  let modifierLevel = 3
+  let modifierLevelCount = 0
+
+  // Normalization based on
+  // https://github.com/composer/semver/blob/1.5.0/src/VersionParser.php
+
+  if (parts.length > 1) {
+    const modifier = parts[parts.length - 1]
+    const firstLetter = modifier.charCodeAt(0)
+    let modifierLevelCountString
+
+    // Modifiers: alpha < beta < RC < normal < patch < dev
+    if (firstLetter === 97 || firstLetter === 65) {
+      // a / A
+      modifierLevel = 0
+      if (/^alpha/i.test(modifier)) {
+        modifierLevelCountString = +modifier.slice(5)
+      } else {
+        modifierLevelCountString = +modifier.slice(1)
+      }
+    } else if (firstLetter === 98 || firstLetter === 66) {
+      // b / B
+      modifierLevel = 1
+      if (/^beta/i.test(modifier)) {
+        modifierLevelCountString = +modifier.slice(4)
+      } else {
+        modifierLevelCountString = +modifier.slice(1)
+      }
+    } else if (firstLetter === 82 || firstLetter === 114) {
+      // R / r
+      modifierLevel = 2
+      modifierLevelCountString = +modifier.slice(2)
+    } else if (firstLetter === 112) {
+      // p
+      modifierLevel = 4
+      if (/^patch/.test(modifier)) {
+        modifierLevelCountString = +modifier.slice(5)
+      } else {
+        modifierLevelCountString = +modifier.slice(1)
+      }
+    } else if (firstLetter === 100) {
+      // d
+      modifierLevel = 5
+      if (/^dev/.test(modifier)) {
+        modifierLevelCountString = +modifier.slice(3)
+      } else {
+        modifierLevelCountString = +modifier.slice(1)
+      }
+    }
+
+    // If we got the empty string, it defaults to a modifier count of 1.
+    if (!modifierLevelCountString) {
+      modifierLevelCount = 1
+    } else {
+      modifierLevelCount = +modifierLevelCountString
+    }
+  }
+
+  /**
+   * Try to convert to a list of numbers.
+   *
+   * @param {string} s - Version number string
+   * @returns {number} Version number interger
+   */
+  function toNum(s) {
+    let n = +s
+    if (Number.isNaN(n)) {
+      n = 0xffffffff
+    }
+    return n
+  }
+  const numberList = numbered.split('.').map(toNum)
+
+  return {
+    numbers: numberList,
+    modifier: modifierLevel,
+    modifierCount: modifierLevelCount,
+  }
+}
+
+/**
+ * Compares two versions and return an interger based on the result.
+ * See https://getcomposer.org/doc/04-schema.md#version
+ * and https://github.com/badges/shields/issues/319#issuecomment-74411045
+ *
+ * @param {string} v1 - First version
+ * @param {string} v2 - Second version
+ * @returns {number} Negative value if v1 < v2, zero if v1 = v2, else a positive value
+ */
+function compare(v1, v2) {
+  // Omit the starting `v`.
+  const rawv1 = omitv(v1)
+  const rawv2 = omitv(v2)
+  let v1data, v2data
+  try {
+    v1data = numberedVersionData(rawv1)
+    v2data = numberedVersionData(rawv2)
+  } catch (e) {
+    return asciiVersionCompare(rawv1, rawv2)
+  }
+
+  // Compare the numbered part (eg, 1.0.0 < 2.0.0).
+  const numbersCompare = listCompare(v1data.numbers, v2data.numbers)
+  if (numbersCompare !== 0) {
+    return numbersCompare
+  }
+
+  // Compare the modifiers (eg, alpha < beta).
+  if (v1data.modifier < v2data.modifier) {
+    return -1
+  } else if (v1data.modifier > v2data.modifier) {
+    return 1
+  }
+
+  // Compare the modifier counts (eg, alpha1 < alpha3).
+  if (v1data.modifierCount < v2data.modifierCount) {
+    return -1
+  } else if (v1data.modifierCount > v2data.modifierCount) {
+    return 1
+  }
+
+  return 0
+}
+
+/**
+ * Determines the latest version from a list of versions.
+ *
+ * @param {string[]} versions - List of versions
+ * @returns {string} Latest version
+ */
+function latest(versions) {
+  let latest = versions[0]
+  for (let i = 1; i < versions.length; i++) {
+    if (compare(latest, versions[i]) < 0) {
+      latest = versions[i]
+    }
+  }
+  return latest
+}
+
+/**
+ * Determines if a version is stable or not.
+ *
+ * @param {string} version - Version number
+ * @returns {boolean} true if version is stable, else false
+ */
+function isStable(version) {
+  const rawVersion = omitv(version)
+  let versionData
+  try {
+    versionData = numberedVersionData(rawVersion)
+  } catch (e) {
+    return false
+  }
+  // normal or patch
+  return versionData.modifier === 3 || versionData.modifier === 4
+}
+
+/**
+ * Checks if a version is valid and returns the minor version.
+ *
+ * @param {string} version - Version number
+ * @returns {string} Minor version
+ */
+function minorVersion(version) {
+  const result = version.match(/^(\d+)(?:\.(\d+))?(?:\.(\d+))?/)
+
+  if (result === null) {
+    return ''
+  }
+
+  return `${result[1]}.${result[2] ? result[2] : '0'}`
+}
+
+/**
+ * Reduces the list of php versions that intersect with release versions to a version range (for eg. '5.4 - 7.1', '>= 5.5').
+ *
+ * @param {string[]} versions - List of php versions
+ * @param {string[]} phpReleases - List of php release versions
+ * @returns {string[]} Reduced Version Range (for eg. ['5.4 - 7.1'], ['>= 5.5'])
+ */
+function versionReduction(versions, phpReleases) {
+  if (!versions.length) {
+    return []
+  }
+
+  // versions intersect
+  versions = Array.from(new Set(versions))
+    .filter(n => phpReleases.includes(n))
+    .sort()
+
+  // nothing to reduction
+  if (versions.length < 2) {
+    return versions
+  }
+
+  const first = phpReleases.indexOf(versions[0])
+  const last = phpReleases.indexOf(versions[versions.length - 1])
+
+  // no missed versions
+  if (first + versions.length - 1 === last) {
+    if (last === phpReleases.length - 1) {
+      return [`>= ${versions[0][2] === '0' ? versions[0][0] : versions[0]}`] // 7.0 -> 7
+    }
+
+    return [`${versions[0]} - ${versions[versions.length - 1]}`]
+  }
+
+  return versions
+}
+
+/**
+ * Fetches the PHP release versions from cache if exists, else fetch from the souce url and save in cache.
+ *
+ * @async
+ * @param {object} githubApiProvider - Github API provider
+ * @returns {Promise<*>} Promise that resolves to parsed response
+ */
+async function getPhpReleases(githubApiProvider) {
+  return getCachedResource({
+    url: '/repos/php/php-src/git/refs/tags',
+    scraper: tags =>
+      Array.from(
+        new Set(
+          tags
+            // only releases
+            .filter(
+              tag => tag.ref.match(/^refs\/tags\/php-\d+\.\d+\.\d+$/) != null
+            )
+            // get minor version of release
+            .map(tag => tag.ref.match(/^refs\/tags\/php-(\d+\.\d+)\.\d+$/)[1])
+        )
+      ),
+    requestFetcher: githubApiProvider.fetch.bind(githubApiProvider, fetch),
+  })
+}
+
+export {
+  compare,
+  latest,
+  isStable,
+  minorVersion,
+  versionReduction,
+  getPhpReleases,
+}
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/services_steam_steam-base.js.html b/services_steam_steam-base.js.html index b798ce25b6..7e5f884f78 100644 --- a/services_steam_steam-base.js.html +++ b/services_steam_steam-base.js.html @@ -92,13 +92,13 @@ export default BaseSteamAPI
diff --git a/services_test-validators.js.html b/services_test-validators.js.html index 6d221d5d67..0df38adc1e 100644 --- a/services_test-validators.js.html +++ b/services_test-validators.js.html @@ -253,13 +253,13 @@ export {
diff --git a/tutorial-TUTORIAL.html b/tutorial-TUTORIAL.html index 978ca74b83..e49db66711 100644 --- a/tutorial-TUTORIAL.html +++ b/tutorial-TUTORIAL.html @@ -371,13 +371,13 @@ will review your contribution.
diff --git a/tutorial-adding-new-config-values.html b/tutorial-adding-new-config-values.html index fce59e5dfa..95379cd5e7 100644 --- a/tutorial-adding-new-config-values.html +++ b/tutorial-adding-new-config-values.html @@ -54,13 +54,13 @@
diff --git a/tutorial-authentication.html b/tutorial-authentication.html index 40d740eb7a..3b31122e7d 100644 --- a/tutorial-authentication.html +++ b/tutorial-authentication.html @@ -42,13 +42,13 @@
diff --git a/tutorial-badge-urls.html b/tutorial-badge-urls.html index 37b8f089c6..f7e1af7346 100644 --- a/tutorial-badge-urls.html +++ b/tutorial-badge-urls.html @@ -77,13 +77,13 @@ badge is for issues, and the parameters are :user/:repo.
diff --git a/tutorial-code-walkthrough.html b/tutorial-code-walkthrough.html index c0a02b2586..10c4852c1c 100644 --- a/tutorial-code-walkthrough.html +++ b/tutorial-code-walkthrough.html @@ -229,13 +229,13 @@ result over the HTTPS connection.
diff --git a/tutorial-deprecating-badges.html b/tutorial-deprecating-badges.html index 119352603b..e2a84b7b43 100644 --- a/tutorial-deprecating-badges.html +++ b/tutorial-deprecating-badges.html @@ -136,13 +136,13 @@ t.create('no longer available (previously number of layers)')
diff --git a/tutorial-input-validation.html b/tutorial-input-validation.html index 0a86a0fef4..29fdbff007 100644 --- a/tutorial-input-validation.html +++ b/tutorial-input-validation.html @@ -97,13 +97,13 @@
diff --git a/tutorial-json-format.html b/tutorial-json-format.html index b9a17c8ff4..2673a06d00 100644 --- a/tutorial-json-format.html +++ b/tutorial-json-format.html @@ -54,13 +54,13 @@ if you have any queries regarding the JSON format.


diff --git a/tutorial-logos.html b/tutorial-logos.html index 63736128c4..6690b0cfeb 100644 --- a/tutorial-logos.html +++ b/tutorial-logos.html @@ -101,13 +101,13 @@
diff --git a/tutorial-performance-testing.html b/tutorial-performance-testing.html index b94b5e5bc9..6f50415cd5 100644 --- a/tutorial-performance-testing.html +++ b/tutorial-performance-testing.html @@ -70,13 +70,13 @@ node --prof-process --preprocess -j isolate-00000244AB6ED3B0-11920-v8.log | flam
diff --git a/tutorial-production-hosting.html b/tutorial-production-hosting.html index 94b1237ca6..06ca304bae 100644 --- a/tutorial-production-hosting.html +++ b/tutorial-production-hosting.html @@ -229,13 +229,13 @@ via local-shields-io-production.yml (see Home

Modules

Classes

Tutorials

Global

+

Home

Modules

Classes

Tutorials

Global


diff --git a/tutorial-releases.html b/tutorial-releases.html index a621575ef1..994e2cdc89 100644 --- a/tutorial-releases.html +++ b/tutorial-releases.html @@ -73,13 +73,13 @@
diff --git a/tutorial-self-hosting.html b/tutorial-self-hosting.html index 67c221f3f2..1623a8a124 100644 --- a/tutorial-self-hosting.html +++ b/tutorial-self-hosting.html @@ -162,13 +162,13 @@ Set public.requireCloudflare: true.


diff --git a/tutorial-server-secrets.html b/tutorial-server-secrets.html index 2bd3dd74d2..1b20680f88 100644 --- a/tutorial-server-secrets.html +++ b/tutorial-server-secrets.html @@ -283,13 +283,13 @@ and create an API key for the YouTube Data API v3.


diff --git a/tutorial-service-tests.html b/tutorial-service-tests.html index 47fff51e48..e542bdf08d 100644 --- a/tutorial-service-tests.html +++ b/tutorial-service-tests.html @@ -240,13 +240,13 @@ comment there instead.


diff --git a/tutorial-static-badges.html b/tutorial-static-badges.html index f2466f65a9..dd14d3169a 100644 --- a/tutorial-static-badges.html +++ b/tutorial-static-badges.html @@ -45,13 +45,13 @@