Skip to content

Commit 612a96e

Browse files
authored
Update parseInt parameter name and jsdoc (#42756)
* feat(lib): improve parseInt type definition and docstring * Accepted baselines * update tests
1 parent 25375a2 commit 612a96e

10 files changed

+78
-78
lines changed

src/lib/es2015.core.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ interface NumberConstructor {
248248

249249
/**
250250
* Converts A string to an integer.
251-
* @param s A string to convert into a number.
252-
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
251+
* @param string A string to convert into a number.
252+
* @param radix A value between 2 and 36 that specifies the base of the number in `string`.
253253
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
254254
* All other strings are considered decimal.
255255
*/

src/lib/es5.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ declare function eval(x: string): any;
1313

1414
/**
1515
* Converts a string to an integer.
16-
* @param s A string to convert into a number.
17-
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
16+
* @param string A string to convert into a number.
17+
* @param radix A value between 2 and 36 that specifies the base of the number in `string`.
1818
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
1919
* All other strings are considered decimal.
2020
*/
21-
declare function parseInt(s: string, radix?: number): number;
21+
declare function parseInt(string: string, radix?: number): number;
2222

2323
/**
2424
* Converts a string to a floating-point number.

tests/baselines/reference/abstractPropertyInConstructor.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ abstract class AbstractClass {
1212
>this : this
1313
>method : (num: number) => void
1414
>parseInt(str) : number
15-
>parseInt : (s: string, radix?: number) => number
15+
>parseInt : (string: string, radix?: number) => number
1616
>str : string
1717

1818
let val = this.prop.toLowerCase();

tests/baselines/reference/completionsCommentsClass.baseline

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
"kind": "punctuation"
123123
},
124124
{
125-
"text": "s",
125+
"text": "string",
126126
"kind": "parameterName"
127127
},
128128
{
@@ -191,11 +191,11 @@
191191
"tags": [
192192
{
193193
"name": "param",
194-
"text": "s A string to convert into a number."
194+
"text": "string A string to convert into a number."
195195
},
196196
{
197197
"name": "param",
198-
"text": "radix A value between 2 and 36 that specifies the base of the number in numString.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
198+
"text": "radix A value between 2 and 36 that specifies the base of the number in `string`.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
199199
}
200200
]
201201
},

tests/baselines/reference/completionsCommentsClassMembers.baseline

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9061,7 +9061,7 @@
90619061
"kind": "punctuation"
90629062
},
90639063
{
9064-
"text": "s",
9064+
"text": "string",
90659065
"kind": "parameterName"
90669066
},
90679067
{
@@ -9130,11 +9130,11 @@
91309130
"tags": [
91319131
{
91329132
"name": "param",
9133-
"text": "s A string to convert into a number."
9133+
"text": "string A string to convert into a number."
91349134
},
91359135
{
91369136
"name": "param",
9137-
"text": "radix A value between 2 and 36 that specifies the base of the number in numString.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
9137+
"text": "radix A value between 2 and 36 that specifies the base of the number in `string`.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
91389138
}
91399139
]
91409140
},
@@ -14051,7 +14051,7 @@
1405114051
"kind": "punctuation"
1405214052
},
1405314053
{
14054-
"text": "s",
14054+
"text": "string",
1405514055
"kind": "parameterName"
1405614056
},
1405714057
{
@@ -14120,11 +14120,11 @@
1412014120
"tags": [
1412114121
{
1412214122
"name": "param",
14123-
"text": "s A string to convert into a number."
14123+
"text": "string A string to convert into a number."
1412414124
},
1412514125
{
1412614126
"name": "param",
14127-
"text": "radix A value between 2 and 36 that specifies the base of the number in numString.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
14127+
"text": "radix A value between 2 and 36 that specifies the base of the number in `string`.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
1412814128
}
1412914129
]
1413014130
},
@@ -22449,7 +22449,7 @@
2244922449
"kind": "punctuation"
2245022450
},
2245122451
{
22452-
"text": "s",
22452+
"text": "string",
2245322453
"kind": "parameterName"
2245422454
},
2245522455
{
@@ -22518,11 +22518,11 @@
2251822518
"tags": [
2251922519
{
2252022520
"name": "param",
22521-
"text": "s A string to convert into a number."
22521+
"text": "string A string to convert into a number."
2252222522
},
2252322523
{
2252422524
"name": "param",
22525-
"text": "radix A value between 2 and 36 that specifies the base of the number in numString.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
22525+
"text": "radix A value between 2 and 36 that specifies the base of the number in `string`.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
2252622526
}
2252722527
]
2252822528
},
@@ -26299,7 +26299,7 @@
2629926299
"kind": "punctuation"
2630026300
},
2630126301
{
26302-
"text": "s",
26302+
"text": "string",
2630326303
"kind": "parameterName"
2630426304
},
2630526305
{
@@ -26368,11 +26368,11 @@
2636826368
"tags": [
2636926369
{
2637026370
"name": "param",
26371-
"text": "s A string to convert into a number."
26371+
"text": "string A string to convert into a number."
2637226372
},
2637326373
{
2637426374
"name": "param",
26375-
"text": "radix A value between 2 and 36 that specifies the base of the number in numString.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
26375+
"text": "radix A value between 2 and 36 that specifies the base of the number in `string`.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
2637626376
}
2637726377
]
2637826378
},
@@ -30149,7 +30149,7 @@
3014930149
"kind": "punctuation"
3015030150
},
3015130151
{
30152-
"text": "s",
30152+
"text": "string",
3015330153
"kind": "parameterName"
3015430154
},
3015530155
{
@@ -30218,11 +30218,11 @@
3021830218
"tags": [
3021930219
{
3022030220
"name": "param",
30221-
"text": "s A string to convert into a number."
30221+
"text": "string A string to convert into a number."
3022230222
},
3022330223
{
3022430224
"name": "param",
30225-
"text": "radix A value between 2 and 36 that specifies the base of the number in numString.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
30225+
"text": "radix A value between 2 and 36 that specifies the base of the number in `string`.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
3022630226
}
3022730227
]
3022830228
},
@@ -33999,7 +33999,7 @@
3399933999
"kind": "punctuation"
3400034000
},
3400134001
{
34002-
"text": "s",
34002+
"text": "string",
3400334003
"kind": "parameterName"
3400434004
},
3400534005
{
@@ -34068,11 +34068,11 @@
3406834068
"tags": [
3406934069
{
3407034070
"name": "param",
34071-
"text": "s A string to convert into a number."
34071+
"text": "string A string to convert into a number."
3407234072
},
3407334073
{
3407434074
"name": "param",
34075-
"text": "radix A value between 2 and 36 that specifies the base of the number in numString.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
34075+
"text": "radix A value between 2 and 36 that specifies the base of the number in `string`.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
3407634076
}
3407734077
]
3407834078
},
@@ -37849,7 +37849,7 @@
3784937849
"kind": "punctuation"
3785037850
},
3785137851
{
37852-
"text": "s",
37852+
"text": "string",
3785337853
"kind": "parameterName"
3785437854
},
3785537855
{
@@ -37918,11 +37918,11 @@
3791837918
"tags": [
3791937919
{
3792037920
"name": "param",
37921-
"text": "s A string to convert into a number."
37921+
"text": "string A string to convert into a number."
3792237922
},
3792337923
{
3792437924
"name": "param",
37925-
"text": "radix A value between 2 and 36 that specifies the base of the number in numString.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
37925+
"text": "radix A value between 2 and 36 that specifies the base of the number in `string`.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
3792637926
}
3792737927
]
3792837928
},
@@ -41699,7 +41699,7 @@
4169941699
"kind": "punctuation"
4170041700
},
4170141701
{
41702-
"text": "s",
41702+
"text": "string",
4170341703
"kind": "parameterName"
4170441704
},
4170541705
{
@@ -41768,11 +41768,11 @@
4176841768
"tags": [
4176941769
{
4177041770
"name": "param",
41771-
"text": "s A string to convert into a number."
41771+
"text": "string A string to convert into a number."
4177241772
},
4177341773
{
4177441774
"name": "param",
41775-
"text": "radix A value between 2 and 36 that specifies the base of the number in numString.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
41775+
"text": "radix A value between 2 and 36 that specifies the base of the number in `string`.\r\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r\nAll other strings are considered decimal."
4177641776
}
4177741777
]
4177841778
},

0 commit comments

Comments
 (0)