From 381da1af452d623e412d03868af8e4530cd77be7 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Thu, 29 Mar 2018 17:08:04 +0100 Subject: [PATCH] build(aio): move "optional" and "default" to end of param description (#23062) PR Close #23062 --- aio/tools/transforms/templates/api/lib/paramList.html | 9 +++++---- packages/common/src/pipes/date_pipe.ts | 6 ++++-- packages/common/src/pipes/number_pipe.ts | 10 ++++++---- packages/common/src/pipes/slice_pipe.ts | 3 ++- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/aio/tools/transforms/templates/api/lib/paramList.html b/aio/tools/transforms/templates/api/lib/paramList.html index 10fb182c84..0f63ad32d9 100644 --- a/aio/tools/transforms/templates/api/lib/paramList.html +++ b/aio/tools/transforms/templates/api/lib/paramList.html @@ -21,11 +21,12 @@ {% if showType %}{$ parameter.type $}{% endif %} {% marked %} - {% if parameter.isOptional or parameter.defaultValue !== undefined %}Optional. Default is `{$ parameter.defaultValue === undefined and 'undefined' or parameter.defaultValue $}`.{% endif %} + {% if parameter.description | trim %}{$ parameter.description $} - {% if parameter.description | trim %}{$ parameter.description $} - {% elseif not showType and parameter.type %}

Type: {$ parameter.type $}.

- {% endif %} + {% elseif not showType and parameter.type %}

Type: {$ parameter.type $}.

+ {% endif %} + + {% if parameter.isOptional or parameter.defaultValue !== undefined %}Optional. Default is `{$ parameter.defaultValue === undefined and 'undefined' or parameter.defaultValue $}`.{% endif %} {% endmarked %} {% endfor %} diff --git a/packages/common/src/pipes/date_pipe.ts b/packages/common/src/pipes/date_pipe.ts index 0fad70a4d5..239122eca2 100644 --- a/packages/common/src/pipes/date_pipe.ts +++ b/packages/common/src/pipes/date_pipe.ts @@ -113,7 +113,8 @@ export class DatePipe implements PipeTransform { * shown below (all examples are given for `en-US`) or custom as shown in the table. * - `'short'`: equivalent to `'M/d/yy, h:mm a'` (e.g. `6/15/15, 9:03 AM`). * - `'medium'`: equivalent to `'MMM d, y, h:mm:ss a'` (e.g. `Jun 15, 2015, 9:03:01 AM`). - * - `'long'`: equivalent to `'MMMM d, y, h:mm:ss a z'` (e.g. `June 15, 2015 at 9:03:01 AM GMT+1`). + * - `'long'`: equivalent to `'MMMM d, y, h:mm:ss a z'` (e.g. `June 15, 2015 at 9:03:01 AM + * GMT+1`). * - `'full'`: equivalent to `'EEEE, MMMM d, y, h:mm:ss a zzzz'` (e.g. `Monday, June 15, 2015 at * 9:03:01 AM GMT+01:00`). * - `'shortDate'`: equivalent to `'M/d/yy'` (e.g. `6/15/15`). @@ -124,7 +125,8 @@ export class DatePipe implements PipeTransform { * - `'mediumTime'`: equivalent to `'h:mm:ss a'` (e.g. `9:03:01 AM`). * - `'longTime'`: equivalent to `'h:mm:ss a z'` (e.g. `9:03:01 AM GMT+1`). * - `'fullTime'`: equivalent to `'h:mm:ss a zzzz'` (e.g. `9:03:01 AM GMT+01:00`). - * @param timezone to be used for formatting the time. It understands UTC/GMT and the continental US time zone + * @param timezone to be used for formatting the time. It understands UTC/GMT and the continental + * US time zone * abbreviations, but for general use, use a time zone offset (e.g. `'+0430'`). * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by * default). diff --git a/packages/common/src/pipes/number_pipe.ts b/packages/common/src/pipes/number_pipe.ts index e29df041d8..2c54e235c1 100644 --- a/packages/common/src/pipes/number_pipe.ts +++ b/packages/common/src/pipes/number_pipe.ts @@ -35,8 +35,10 @@ export class DecimalPipe implements PipeTransform { * @param digitsInfo a `string` which has a following format:
* {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}. * - `minIntegerDigits` is the minimum number of integer digits to use. Defaults to `1`. - * - `minFractionDigits` is the minimum number of digits after the decimal point. Defaults to `0`. - * - `maxFractionDigits` is the maximum number of digits after the decimal point. Defaults to `3`. + * - `minFractionDigits` is the minimum number of digits after the decimal point. Defaults to + * `0`. + * - `maxFractionDigits` is the maximum number of digits after the decimal point. Defaults to + * `3`. * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by * default). */ @@ -112,8 +114,8 @@ export class CurrencyPipe implements PipeTransform { /** * * @param value a number to be formatted as currency. - * @param currencyCodeis the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, such - * as `USD` for the US dollar and `EUR` for the euro. + * @param currencyCodeis the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, + * such as `USD` for the US dollar and `EUR` for the euro. * @param display indicates whether to show the currency symbol, the code or a custom value: * - `code`: use code (e.g. `USD`). * - `symbol`(default): use symbol (e.g. `$`). diff --git a/packages/common/src/pipes/slice_pipe.ts b/packages/common/src/pipes/slice_pipe.ts index d587190cbb..af86424e70 100644 --- a/packages/common/src/pipes/slice_pipe.ts +++ b/packages/common/src/pipes/slice_pipe.ts @@ -50,7 +50,8 @@ export class SlicePipe implements PipeTransform { * in the list or string expression. * - **a negative integer**: return the item at `start` index from the end and all items after * in the list or string expression. - * - **if positive and greater than the size of the expression**: return an empty list or string. + * - **if positive and greater than the size of the expression**: return an empty list or + * string. * - **if negative and greater than the size of the expression**: return entire list or string. * @param end the ending index of the subset to return: * - **omitted**: return all items until the end.