style: align multiline ternary operators
This commit is contained in:
@@ -34,9 +34,9 @@ export class StockCatalogService {
|
||||
data:
|
||||
result.data?.map((item) => {
|
||||
const short = stock(item);
|
||||
const detail = item.detail ?
|
||||
stock({ ...item.detail, uid: item.uid }) :
|
||||
short;
|
||||
const detail = item.detail
|
||||
? stock({ ...item.detail, uid: item.uid })
|
||||
: short;
|
||||
const last = item.price;
|
||||
return {
|
||||
...detail,
|
||||
@@ -44,12 +44,12 @@ export class StockCatalogService {
|
||||
isin: detail.isin ?? short.isin,
|
||||
apiTradeAvailable: short.apiTradeAvailable,
|
||||
price:
|
||||
last?.price && detail.currency ?
|
||||
{
|
||||
last?.price && detail.currency
|
||||
? {
|
||||
currency: detail.currency,
|
||||
value: formatDecimal(decimal(last.price)),
|
||||
} :
|
||||
null,
|
||||
}
|
||||
: null,
|
||||
priceAt: timestamp(last?.time),
|
||||
};
|
||||
}) ?? null,
|
||||
@@ -64,9 +64,9 @@ export class StockCatalogService {
|
||||
const result = await this.discovery.detail(userId, 'share', uid, observe);
|
||||
return {
|
||||
...result,
|
||||
data: result.data ?
|
||||
{ ...stock(result.data), slug: result.data.slug } :
|
||||
null,
|
||||
data: result.data
|
||||
? { ...stock(result.data), slug: result.data.slug }
|
||||
: null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -83,9 +83,9 @@ export class StockCatalogService {
|
||||
);
|
||||
return {
|
||||
...result,
|
||||
data: result.data ?
|
||||
{ ...stock(result.data), slug: result.data.slug } :
|
||||
null,
|
||||
data: result.data
|
||||
? { ...stock(result.data), slug: result.data.slug }
|
||||
: null,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user