X-Git-Url: http://git.squeep.com/?p=squeep-api-dingus;a=blobdiff_plain;f=lib%2Frouter%2Fpath-parameter.js;h=3c6f1cb1f6e1c3a28129ee9bf0adbfe988192c05;hp=585aaec7500a3ccf3fd6c9529fdb288f817f14e8;hb=ad464818fe8f839bea962f57bcdca4fe26c92ce7;hpb=9fe1e9b22b8e753c44dec77d1dee3d0061b2e991 diff --git a/lib/router/path-parameter.js b/lib/router/path-parameter.js index 585aaec..3c6f1cb 100644 --- a/lib/router/path-parameter.js +++ b/lib/router/path-parameter.js @@ -1,6 +1,5 @@ 'use strict'; -const kPathParameter = Symbol('kSqueepDingusRouterPathParameter'); const parameters = new Map(); /** * De-duplicating factory of minimal-objects to track the named-parameter parts of path definitions. @@ -16,24 +15,17 @@ class PathParameter extends null { return parameters.get(parameter); } const pathParameter = Object.create(PathParameter.prototype); - pathParameter[kPathParameter] = parameter; // eslint-disable-line security/detect-object-injection + pathParameter.parameter = parameter; parameters.set(parameter, pathParameter); Object.freeze(pathParameter); return pathParameter; } - /** - * Return the parameter name. - */ - get parameter() { - return this[kPathParameter];// eslint-disable-line security/detect-object-injection - } - /** * @returns {String} */ toString() { - return `{${this.constructor.name} ${this.parameter}}`; // eslint-disable-line security/detect-object-injection + return `{${this.constructor.name} ${this.parameter}}`; } /** @@ -43,7 +35,6 @@ class PathParameter extends null { this.parameters.clear(); } } -PathParameter.kPathParameter = kPathParameter; PathParameter.parameters = parameters; module.exports = PathParameter; \ No newline at end of file