'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.
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}}`;
}
/**
this.parameters.clear();
}
}
-PathParameter.kPathParameter = kPathParameter;
PathParameter.parameters = parameters;
module.exports = PathParameter;
\ No newline at end of file