X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Frouter%2Fpath-parameter.js;h=7728295250b182f88323a524d48a37f93b43c8cc;hb=281f49e3960d1562b86c56ebb75f340798623c62;hp=81405948a2ea951b5b404aa4bc1bbe78153df117;hpb=8d101705d3394039ddf2d2f3339a5e6ada911579;p=squeep-api-dingus diff --git a/lib/router/path-parameter.js b/lib/router/path-parameter.js index 8140594..7728295 100644 --- a/lib/router/path-parameter.js +++ b/lib/router/path-parameter.js @@ -3,12 +3,15 @@ const parameters = new Map(); /** * De-duplicating factory of minimal-objects to track the named-parameter parts of path definitions. - * - * @property {String} parameter */ class PathParameter extends null { static #parameters = parameters; + /** + * + * @param {string} parameter name + * @returns {PathParameter} frozen parameter object + */ constructor(parameter) { if (!parameter || typeof(parameter) !== 'string') { throw new RangeError('parameter must be string'); @@ -26,14 +29,14 @@ class PathParameter extends null { } /** - * @returns {String} + * @returns {string} parameter string */ toString() { return this.parameter; } /** - * @returns {String} + * @returns {string} parameter string */ toJSON() { return this.parameter;