@@ -17,26 +17,26 @@ const { isArray } = Array;
17
17
*/
18
18
const httpMethodSet = new Set ( METHODS ) ;
19
19
20
- /** Transforms a value which has type object<string,T > but is not defined as
21
- * Map[string,T ] in OpenAPI.
20
+ /** Transforms a value which has type object<string,ValueType > but is not
21
+ * defined as Map[string,ValueType ] in OpenAPI.
22
22
*
23
23
* Note: This is currently used for schema properties, where #transformMap()
24
24
* often complicates transformations due to differences with Map[string,Schema]
25
25
* on definitions/components.schema and complicates optimizations.
26
26
*
27
27
* @private
28
- * @template T, U
28
+ * @template ValueType, TransformedType
29
29
* @this {!OpenApiTransformerBase}
30
- * @param {!object<string,T >|* } obj Map-like object to transform.
31
- * @param {function(this:!OpenApiTransformerBase, T ): U } transform Method which
32
- * transforms values in obj.
30
+ * @param {!object<string,ValueType >|* } obj Map-like object to transform.
31
+ * @param {function(this:!OpenApiTransformerBase, ValueType ): TransformedType
32
+ * } transform Method which transforms values in obj.
33
33
* @param {boolean= } skipExtensions If true, do not call transform on {@link
34
34
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#specificationExtensions
35
35
* Specification Extensions} (i.e. properties starting with "x-").
36
36
* Such properties are copied to the returned object without transformation.
37
- * @returns {!object<string,U >|* } If obj is a Map, a plain object with the
38
- * same own enumerable string-keyed properties as obj with values returned
39
- * by transform. Otherwise, obj is returned unchanged.
37
+ * @returns {!object<string,TransformedType >|* } If obj is a Map, a plain object
38
+ * with the same own enumerable string-keyed properties as obj with values
39
+ * returned by transform. Otherwise, obj is returned unchanged.
40
40
*/
41
41
function transformMapLike ( obj , transform , skipExtensions ) {
42
42
if ( typeof obj !== 'object' || obj === null ) {
@@ -103,7 +103,8 @@ function transformMapLike(obj, transform, skipExtensions) {
103
103
* </ul>
104
104
*/
105
105
class OpenApiTransformerBase {
106
- /** Transforms a <code>Map[string, T]</code> using a given transform method.
106
+ /** Transforms a <code>Map[string, ValueType]</code> using a given transform
107
+ * method.
107
108
*
108
109
* Similar to modify-values and _.mapValues from lodash.
109
110
*
@@ -116,13 +117,13 @@ class OpenApiTransformerBase {
116
117
* the first argument with transformed values.</li>
117
118
* </ul>
118
119
*
119
- * @template T, U
120
- * @param {!object<string,T >|* } obj Map to transform.
121
- * @param {function(this:!OpenApiTransformerBase, T ): U } transform Method
122
- * which transforms values in obj.
123
- * @returns {!object<string,U >|* } If obj is a Map, a plain object with the
124
- * same own enumerable string-keyed properties as obj with values returned
125
- * by transform. Otherwise, obj is returned unchanged.
120
+ * @template ValueType, TransformedType
121
+ * @param {!object<string,ValueType >|* } obj Map to transform.
122
+ * @param {function(this:!OpenApiTransformerBase, ValueType ): TransformedType
123
+ * } transform Method which transforms values in obj.
124
+ * @returns {!object<string,TransformedType >|* } If obj is a Map, a plain
125
+ * object with the same own enumerable string-keyed properties as obj with
126
+ * values returned by transform. Otherwise, obj is returned unchanged.
126
127
*/
127
128
transformMap ( obj , transform ) {
128
129
return transformMapLike . call ( this , obj , transform ) ;
0 commit comments