Transforming data from an API using Typescript and Lodash
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
3
down vote
favorite
As a front-end developer, I am given the following result from an API, an array of objects that looks like:
[
Color: "#065b79",
GroupName: "VXYZ",
QuoteCount: 4,
SortOrder: 0,
TabCategoryID: "CHSI1",
TabCategoryName: "Workers' Compensation",
TabCategoryOrder: 0,
TabID: 1,
TabName: "new"
]
I need to display the data in a more hierarchical/nested format:
[
GroupName: 'VXYZ',
TabCategories: [
TabCategoryID: 'CHSI1',
TabCategoryName: "Workers' Compensation",
TabCategoryOrder: 0,
Tabs: [
Color: '#065b79',
SortOrder: 0,
TabID: 1,
TabName: 'new',
QuoteCount: 4
]
]
]
Any data in an array can have any number of array items. In the models above, I just use a single instance of each array item.
This is the code I used to format the data
I'm using Typescript and lodash. The API is experimental, and our policy is to just use the any
type for any data coming from experimental APIs. This explains the (Quotes: any)
â it is the data from the API.
public FormatQuoteSummaries(Quotes: any): any
return _(Quotes)
.map(Quote => Quote.GroupName)
.uniq()
.map(UniqueGroupName =>
const GroupName = UniqueGroupName
const AllTabCategories = _.filter(Quotes, (Quote: any) =>
return Quote.GroupName === UniqueGroupName
)
const TabCategories = _(AllTabCategories).map(TabCategory =>
return
TabCategoryID: TabCategory.TabCategoryID,
TabCategoryName: TabCategory.TabCategoryName,
Tabs: _.filter(Quotes, (Quote: any) =>
return Quote.TabCategoryName === TabCategory.TabCategoryName &&
Quote.GroupName === TabCategory.GroupName
)
)
.uniqBy('TabCategoryID')
.value();
return
GroupName,
TabCategories
)
.value();
functional-programming typescript lodash.js
add a comment |Â
up vote
3
down vote
favorite
As a front-end developer, I am given the following result from an API, an array of objects that looks like:
[
Color: "#065b79",
GroupName: "VXYZ",
QuoteCount: 4,
SortOrder: 0,
TabCategoryID: "CHSI1",
TabCategoryName: "Workers' Compensation",
TabCategoryOrder: 0,
TabID: 1,
TabName: "new"
]
I need to display the data in a more hierarchical/nested format:
[
GroupName: 'VXYZ',
TabCategories: [
TabCategoryID: 'CHSI1',
TabCategoryName: "Workers' Compensation",
TabCategoryOrder: 0,
Tabs: [
Color: '#065b79',
SortOrder: 0,
TabID: 1,
TabName: 'new',
QuoteCount: 4
]
]
]
Any data in an array can have any number of array items. In the models above, I just use a single instance of each array item.
This is the code I used to format the data
I'm using Typescript and lodash. The API is experimental, and our policy is to just use the any
type for any data coming from experimental APIs. This explains the (Quotes: any)
â it is the data from the API.
public FormatQuoteSummaries(Quotes: any): any
return _(Quotes)
.map(Quote => Quote.GroupName)
.uniq()
.map(UniqueGroupName =>
const GroupName = UniqueGroupName
const AllTabCategories = _.filter(Quotes, (Quote: any) =>
return Quote.GroupName === UniqueGroupName
)
const TabCategories = _(AllTabCategories).map(TabCategory =>
return
TabCategoryID: TabCategory.TabCategoryID,
TabCategoryName: TabCategory.TabCategoryName,
Tabs: _.filter(Quotes, (Quote: any) =>
return Quote.TabCategoryName === TabCategory.TabCategoryName &&
Quote.GroupName === TabCategory.GroupName
)
)
.uniqBy('TabCategoryID')
.value();
return
GroupName,
TabCategories
)
.value();
functional-programming typescript lodash.js
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
As a front-end developer, I am given the following result from an API, an array of objects that looks like:
[
Color: "#065b79",
GroupName: "VXYZ",
QuoteCount: 4,
SortOrder: 0,
TabCategoryID: "CHSI1",
TabCategoryName: "Workers' Compensation",
TabCategoryOrder: 0,
TabID: 1,
TabName: "new"
]
I need to display the data in a more hierarchical/nested format:
[
GroupName: 'VXYZ',
TabCategories: [
TabCategoryID: 'CHSI1',
TabCategoryName: "Workers' Compensation",
TabCategoryOrder: 0,
Tabs: [
Color: '#065b79',
SortOrder: 0,
TabID: 1,
TabName: 'new',
QuoteCount: 4
]
]
]
Any data in an array can have any number of array items. In the models above, I just use a single instance of each array item.
This is the code I used to format the data
I'm using Typescript and lodash. The API is experimental, and our policy is to just use the any
type for any data coming from experimental APIs. This explains the (Quotes: any)
â it is the data from the API.
public FormatQuoteSummaries(Quotes: any): any
return _(Quotes)
.map(Quote => Quote.GroupName)
.uniq()
.map(UniqueGroupName =>
const GroupName = UniqueGroupName
const AllTabCategories = _.filter(Quotes, (Quote: any) =>
return Quote.GroupName === UniqueGroupName
)
const TabCategories = _(AllTabCategories).map(TabCategory =>
return
TabCategoryID: TabCategory.TabCategoryID,
TabCategoryName: TabCategory.TabCategoryName,
Tabs: _.filter(Quotes, (Quote: any) =>
return Quote.TabCategoryName === TabCategory.TabCategoryName &&
Quote.GroupName === TabCategory.GroupName
)
)
.uniqBy('TabCategoryID')
.value();
return
GroupName,
TabCategories
)
.value();
functional-programming typescript lodash.js
As a front-end developer, I am given the following result from an API, an array of objects that looks like:
[
Color: "#065b79",
GroupName: "VXYZ",
QuoteCount: 4,
SortOrder: 0,
TabCategoryID: "CHSI1",
TabCategoryName: "Workers' Compensation",
TabCategoryOrder: 0,
TabID: 1,
TabName: "new"
]
I need to display the data in a more hierarchical/nested format:
[
GroupName: 'VXYZ',
TabCategories: [
TabCategoryID: 'CHSI1',
TabCategoryName: "Workers' Compensation",
TabCategoryOrder: 0,
Tabs: [
Color: '#065b79',
SortOrder: 0,
TabID: 1,
TabName: 'new',
QuoteCount: 4
]
]
]
Any data in an array can have any number of array items. In the models above, I just use a single instance of each array item.
This is the code I used to format the data
I'm using Typescript and lodash. The API is experimental, and our policy is to just use the any
type for any data coming from experimental APIs. This explains the (Quotes: any)
â it is the data from the API.
public FormatQuoteSummaries(Quotes: any): any
return _(Quotes)
.map(Quote => Quote.GroupName)
.uniq()
.map(UniqueGroupName =>
const GroupName = UniqueGroupName
const AllTabCategories = _.filter(Quotes, (Quote: any) =>
return Quote.GroupName === UniqueGroupName
)
const TabCategories = _(AllTabCategories).map(TabCategory =>
return
TabCategoryID: TabCategory.TabCategoryID,
TabCategoryName: TabCategory.TabCategoryName,
Tabs: _.filter(Quotes, (Quote: any) =>
return Quote.TabCategoryName === TabCategory.TabCategoryName &&
Quote.GroupName === TabCategory.GroupName
)
)
.uniqBy('TabCategoryID')
.value();
return
GroupName,
TabCategories
)
.value();
functional-programming typescript lodash.js
edited Apr 3 at 20:24
200_success
123k14142399
123k14142399
asked Apr 2 at 22:36
149203
184
184
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
First and most importantly, change your policy about using any
for unstable APIs.
Typescript is an incredibly powerful tool for making it possible to work with constantly changing APIs. When you use any
you are throwing away (nearly) all the benefits which Typescript gives you. If you declare an interface for the data being returned by the API, you can simply modify the interface when the format changes and you will be alerted to any code which needs to be updated. If you instead use any
your code will compile without any warnings - and then break in production.
Besides this, there really isn't that much to mention. Good work!
On to the code:
The first thing I did was add types, here are the interfaces I will be using for the rest of the answer:
interface APITabCategory
Color: string;
GroupName: string;
QuoteCount: number;
SortOrder: number;
TabCategoryID: string;
TabCategoryName: string;
TabCategoryOrder: number;
TabID: number;
TabName: string;
interface Tab
Color: string;
SortOrder: number;
TabID: number;
TabName: string;
QuoteCount: number;
interface TabCategory
TabCategoryID: string;
TabCategoryName: string;
TabCategoryOrder: number;
Tabs: Tab
interface TabCategoryCollection
GroupName: string;
TabCategories: TabCategoryIt doesn't do what you think it does. As soon as I added interfaces for your types Typescript yelled at me that
TabCategoryOrder
was missing - this may be intentional as you are now using an array, but it is included in your sample output.The current code includes a bunch of extra data in each
Tab
, this is fine so far as Typescript is concerned, but since this code normalizes the data you may want to consider removing the extra properties.JavaScript has built in
map
andfilter
functions on arrays, I prefer using these to their lodash alternatives where appropriate. In this case, it removes most of your code's dependence on lodash.Avoid double checking conditions. If you save the quotes with the current group name in an array, you can avoid checking the group name when extracting the tabs.
Get a linting program and use it - the current code is inconsistent with whether or not to use semicolons.
Here is how I would implement this function:
function FormatQuoteSummaries(Quotes: APITabCategory): TabCategoryCollection
const UniqueGroupNames = _.uniq(Quotes.map(Quote => Quote.GroupName));
return UniqueGroupNames.map(GroupName =>
const GroupQuotes = Quotes.filter(Quote => Quote.GroupName == GroupName)
const TabCategories: TabCategory = GroupQuotes
.filter(Quote => Quote.GroupName === GroupName)
.map(( TabCategoryID, TabCategoryName, TabCategoryOrder ) =>
return
TabCategoryID,
TabCategoryName,
TabCategoryOrder,
Tabs: GroupQuotes.filter(Quote => Quote.TabCategoryName === TabCategoryName)
;
);
return
GroupName,
TabCategories: _.uniqBy(TabCategories, 'TabCategoryID')
;
);
One last small nitpick, it is fairly standard is JavaScript / TypeScript to use camelCase
as opposed to PascalCase
for local variables and properties. Most JS / TS devs, when seeing Quotes
expect a class / interface / enum / namespace, not an object or array. Feel free to disregard if your team has an established naming convention already.
1
I find your second paragraph somewhat odd and bordering on misleading, particularly the words "immediately discovering incompatibilities", (A) this assumes you are constantly testing production code, not a very practical or affordable way to run a service. (B) type does not protect against data format, ie temperature as a number makes no distinction to the scale, Kelvin, Celsius, or Fahrenheit. Maybe "immediately discovering incompatibilities" would be better as "simplifies the process of discovering incompatibilities"
â Blindman67
Apr 3 at 10:16
@Blindman67 fair point, I decided the rest of the paragraph spoke for itself and just decided to remove that clause.
â Gerrit0
Apr 3 at 18:55
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
First and most importantly, change your policy about using any
for unstable APIs.
Typescript is an incredibly powerful tool for making it possible to work with constantly changing APIs. When you use any
you are throwing away (nearly) all the benefits which Typescript gives you. If you declare an interface for the data being returned by the API, you can simply modify the interface when the format changes and you will be alerted to any code which needs to be updated. If you instead use any
your code will compile without any warnings - and then break in production.
Besides this, there really isn't that much to mention. Good work!
On to the code:
The first thing I did was add types, here are the interfaces I will be using for the rest of the answer:
interface APITabCategory
Color: string;
GroupName: string;
QuoteCount: number;
SortOrder: number;
TabCategoryID: string;
TabCategoryName: string;
TabCategoryOrder: number;
TabID: number;
TabName: string;
interface Tab
Color: string;
SortOrder: number;
TabID: number;
TabName: string;
QuoteCount: number;
interface TabCategory
TabCategoryID: string;
TabCategoryName: string;
TabCategoryOrder: number;
Tabs: Tab
interface TabCategoryCollection
GroupName: string;
TabCategories: TabCategoryIt doesn't do what you think it does. As soon as I added interfaces for your types Typescript yelled at me that
TabCategoryOrder
was missing - this may be intentional as you are now using an array, but it is included in your sample output.The current code includes a bunch of extra data in each
Tab
, this is fine so far as Typescript is concerned, but since this code normalizes the data you may want to consider removing the extra properties.JavaScript has built in
map
andfilter
functions on arrays, I prefer using these to their lodash alternatives where appropriate. In this case, it removes most of your code's dependence on lodash.Avoid double checking conditions. If you save the quotes with the current group name in an array, you can avoid checking the group name when extracting the tabs.
Get a linting program and use it - the current code is inconsistent with whether or not to use semicolons.
Here is how I would implement this function:
function FormatQuoteSummaries(Quotes: APITabCategory): TabCategoryCollection
const UniqueGroupNames = _.uniq(Quotes.map(Quote => Quote.GroupName));
return UniqueGroupNames.map(GroupName =>
const GroupQuotes = Quotes.filter(Quote => Quote.GroupName == GroupName)
const TabCategories: TabCategory = GroupQuotes
.filter(Quote => Quote.GroupName === GroupName)
.map(( TabCategoryID, TabCategoryName, TabCategoryOrder ) =>
return
TabCategoryID,
TabCategoryName,
TabCategoryOrder,
Tabs: GroupQuotes.filter(Quote => Quote.TabCategoryName === TabCategoryName)
;
);
return
GroupName,
TabCategories: _.uniqBy(TabCategories, 'TabCategoryID')
;
);
One last small nitpick, it is fairly standard is JavaScript / TypeScript to use camelCase
as opposed to PascalCase
for local variables and properties. Most JS / TS devs, when seeing Quotes
expect a class / interface / enum / namespace, not an object or array. Feel free to disregard if your team has an established naming convention already.
1
I find your second paragraph somewhat odd and bordering on misleading, particularly the words "immediately discovering incompatibilities", (A) this assumes you are constantly testing production code, not a very practical or affordable way to run a service. (B) type does not protect against data format, ie temperature as a number makes no distinction to the scale, Kelvin, Celsius, or Fahrenheit. Maybe "immediately discovering incompatibilities" would be better as "simplifies the process of discovering incompatibilities"
â Blindman67
Apr 3 at 10:16
@Blindman67 fair point, I decided the rest of the paragraph spoke for itself and just decided to remove that clause.
â Gerrit0
Apr 3 at 18:55
add a comment |Â
up vote
3
down vote
accepted
First and most importantly, change your policy about using any
for unstable APIs.
Typescript is an incredibly powerful tool for making it possible to work with constantly changing APIs. When you use any
you are throwing away (nearly) all the benefits which Typescript gives you. If you declare an interface for the data being returned by the API, you can simply modify the interface when the format changes and you will be alerted to any code which needs to be updated. If you instead use any
your code will compile without any warnings - and then break in production.
Besides this, there really isn't that much to mention. Good work!
On to the code:
The first thing I did was add types, here are the interfaces I will be using for the rest of the answer:
interface APITabCategory
Color: string;
GroupName: string;
QuoteCount: number;
SortOrder: number;
TabCategoryID: string;
TabCategoryName: string;
TabCategoryOrder: number;
TabID: number;
TabName: string;
interface Tab
Color: string;
SortOrder: number;
TabID: number;
TabName: string;
QuoteCount: number;
interface TabCategory
TabCategoryID: string;
TabCategoryName: string;
TabCategoryOrder: number;
Tabs: Tab
interface TabCategoryCollection
GroupName: string;
TabCategories: TabCategoryIt doesn't do what you think it does. As soon as I added interfaces for your types Typescript yelled at me that
TabCategoryOrder
was missing - this may be intentional as you are now using an array, but it is included in your sample output.The current code includes a bunch of extra data in each
Tab
, this is fine so far as Typescript is concerned, but since this code normalizes the data you may want to consider removing the extra properties.JavaScript has built in
map
andfilter
functions on arrays, I prefer using these to their lodash alternatives where appropriate. In this case, it removes most of your code's dependence on lodash.Avoid double checking conditions. If you save the quotes with the current group name in an array, you can avoid checking the group name when extracting the tabs.
Get a linting program and use it - the current code is inconsistent with whether or not to use semicolons.
Here is how I would implement this function:
function FormatQuoteSummaries(Quotes: APITabCategory): TabCategoryCollection
const UniqueGroupNames = _.uniq(Quotes.map(Quote => Quote.GroupName));
return UniqueGroupNames.map(GroupName =>
const GroupQuotes = Quotes.filter(Quote => Quote.GroupName == GroupName)
const TabCategories: TabCategory = GroupQuotes
.filter(Quote => Quote.GroupName === GroupName)
.map(( TabCategoryID, TabCategoryName, TabCategoryOrder ) =>
return
TabCategoryID,
TabCategoryName,
TabCategoryOrder,
Tabs: GroupQuotes.filter(Quote => Quote.TabCategoryName === TabCategoryName)
;
);
return
GroupName,
TabCategories: _.uniqBy(TabCategories, 'TabCategoryID')
;
);
One last small nitpick, it is fairly standard is JavaScript / TypeScript to use camelCase
as opposed to PascalCase
for local variables and properties. Most JS / TS devs, when seeing Quotes
expect a class / interface / enum / namespace, not an object or array. Feel free to disregard if your team has an established naming convention already.
1
I find your second paragraph somewhat odd and bordering on misleading, particularly the words "immediately discovering incompatibilities", (A) this assumes you are constantly testing production code, not a very practical or affordable way to run a service. (B) type does not protect against data format, ie temperature as a number makes no distinction to the scale, Kelvin, Celsius, or Fahrenheit. Maybe "immediately discovering incompatibilities" would be better as "simplifies the process of discovering incompatibilities"
â Blindman67
Apr 3 at 10:16
@Blindman67 fair point, I decided the rest of the paragraph spoke for itself and just decided to remove that clause.
â Gerrit0
Apr 3 at 18:55
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
First and most importantly, change your policy about using any
for unstable APIs.
Typescript is an incredibly powerful tool for making it possible to work with constantly changing APIs. When you use any
you are throwing away (nearly) all the benefits which Typescript gives you. If you declare an interface for the data being returned by the API, you can simply modify the interface when the format changes and you will be alerted to any code which needs to be updated. If you instead use any
your code will compile without any warnings - and then break in production.
Besides this, there really isn't that much to mention. Good work!
On to the code:
The first thing I did was add types, here are the interfaces I will be using for the rest of the answer:
interface APITabCategory
Color: string;
GroupName: string;
QuoteCount: number;
SortOrder: number;
TabCategoryID: string;
TabCategoryName: string;
TabCategoryOrder: number;
TabID: number;
TabName: string;
interface Tab
Color: string;
SortOrder: number;
TabID: number;
TabName: string;
QuoteCount: number;
interface TabCategory
TabCategoryID: string;
TabCategoryName: string;
TabCategoryOrder: number;
Tabs: Tab
interface TabCategoryCollection
GroupName: string;
TabCategories: TabCategoryIt doesn't do what you think it does. As soon as I added interfaces for your types Typescript yelled at me that
TabCategoryOrder
was missing - this may be intentional as you are now using an array, but it is included in your sample output.The current code includes a bunch of extra data in each
Tab
, this is fine so far as Typescript is concerned, but since this code normalizes the data you may want to consider removing the extra properties.JavaScript has built in
map
andfilter
functions on arrays, I prefer using these to their lodash alternatives where appropriate. In this case, it removes most of your code's dependence on lodash.Avoid double checking conditions. If you save the quotes with the current group name in an array, you can avoid checking the group name when extracting the tabs.
Get a linting program and use it - the current code is inconsistent with whether or not to use semicolons.
Here is how I would implement this function:
function FormatQuoteSummaries(Quotes: APITabCategory): TabCategoryCollection
const UniqueGroupNames = _.uniq(Quotes.map(Quote => Quote.GroupName));
return UniqueGroupNames.map(GroupName =>
const GroupQuotes = Quotes.filter(Quote => Quote.GroupName == GroupName)
const TabCategories: TabCategory = GroupQuotes
.filter(Quote => Quote.GroupName === GroupName)
.map(( TabCategoryID, TabCategoryName, TabCategoryOrder ) =>
return
TabCategoryID,
TabCategoryName,
TabCategoryOrder,
Tabs: GroupQuotes.filter(Quote => Quote.TabCategoryName === TabCategoryName)
;
);
return
GroupName,
TabCategories: _.uniqBy(TabCategories, 'TabCategoryID')
;
);
One last small nitpick, it is fairly standard is JavaScript / TypeScript to use camelCase
as opposed to PascalCase
for local variables and properties. Most JS / TS devs, when seeing Quotes
expect a class / interface / enum / namespace, not an object or array. Feel free to disregard if your team has an established naming convention already.
First and most importantly, change your policy about using any
for unstable APIs.
Typescript is an incredibly powerful tool for making it possible to work with constantly changing APIs. When you use any
you are throwing away (nearly) all the benefits which Typescript gives you. If you declare an interface for the data being returned by the API, you can simply modify the interface when the format changes and you will be alerted to any code which needs to be updated. If you instead use any
your code will compile without any warnings - and then break in production.
Besides this, there really isn't that much to mention. Good work!
On to the code:
The first thing I did was add types, here are the interfaces I will be using for the rest of the answer:
interface APITabCategory
Color: string;
GroupName: string;
QuoteCount: number;
SortOrder: number;
TabCategoryID: string;
TabCategoryName: string;
TabCategoryOrder: number;
TabID: number;
TabName: string;
interface Tab
Color: string;
SortOrder: number;
TabID: number;
TabName: string;
QuoteCount: number;
interface TabCategory
TabCategoryID: string;
TabCategoryName: string;
TabCategoryOrder: number;
Tabs: Tab
interface TabCategoryCollection
GroupName: string;
TabCategories: TabCategoryIt doesn't do what you think it does. As soon as I added interfaces for your types Typescript yelled at me that
TabCategoryOrder
was missing - this may be intentional as you are now using an array, but it is included in your sample output.The current code includes a bunch of extra data in each
Tab
, this is fine so far as Typescript is concerned, but since this code normalizes the data you may want to consider removing the extra properties.JavaScript has built in
map
andfilter
functions on arrays, I prefer using these to their lodash alternatives where appropriate. In this case, it removes most of your code's dependence on lodash.Avoid double checking conditions. If you save the quotes with the current group name in an array, you can avoid checking the group name when extracting the tabs.
Get a linting program and use it - the current code is inconsistent with whether or not to use semicolons.
Here is how I would implement this function:
function FormatQuoteSummaries(Quotes: APITabCategory): TabCategoryCollection
const UniqueGroupNames = _.uniq(Quotes.map(Quote => Quote.GroupName));
return UniqueGroupNames.map(GroupName =>
const GroupQuotes = Quotes.filter(Quote => Quote.GroupName == GroupName)
const TabCategories: TabCategory = GroupQuotes
.filter(Quote => Quote.GroupName === GroupName)
.map(( TabCategoryID, TabCategoryName, TabCategoryOrder ) =>
return
TabCategoryID,
TabCategoryName,
TabCategoryOrder,
Tabs: GroupQuotes.filter(Quote => Quote.TabCategoryName === TabCategoryName)
;
);
return
GroupName,
TabCategories: _.uniqBy(TabCategories, 'TabCategoryID')
;
);
One last small nitpick, it is fairly standard is JavaScript / TypeScript to use camelCase
as opposed to PascalCase
for local variables and properties. Most JS / TS devs, when seeing Quotes
expect a class / interface / enum / namespace, not an object or array. Feel free to disregard if your team has an established naming convention already.
edited Apr 3 at 18:54
answered Apr 3 at 3:07
Gerrit0
2,6601518
2,6601518
1
I find your second paragraph somewhat odd and bordering on misleading, particularly the words "immediately discovering incompatibilities", (A) this assumes you are constantly testing production code, not a very practical or affordable way to run a service. (B) type does not protect against data format, ie temperature as a number makes no distinction to the scale, Kelvin, Celsius, or Fahrenheit. Maybe "immediately discovering incompatibilities" would be better as "simplifies the process of discovering incompatibilities"
â Blindman67
Apr 3 at 10:16
@Blindman67 fair point, I decided the rest of the paragraph spoke for itself and just decided to remove that clause.
â Gerrit0
Apr 3 at 18:55
add a comment |Â
1
I find your second paragraph somewhat odd and bordering on misleading, particularly the words "immediately discovering incompatibilities", (A) this assumes you are constantly testing production code, not a very practical or affordable way to run a service. (B) type does not protect against data format, ie temperature as a number makes no distinction to the scale, Kelvin, Celsius, or Fahrenheit. Maybe "immediately discovering incompatibilities" would be better as "simplifies the process of discovering incompatibilities"
â Blindman67
Apr 3 at 10:16
@Blindman67 fair point, I decided the rest of the paragraph spoke for itself and just decided to remove that clause.
â Gerrit0
Apr 3 at 18:55
1
1
I find your second paragraph somewhat odd and bordering on misleading, particularly the words "immediately discovering incompatibilities", (A) this assumes you are constantly testing production code, not a very practical or affordable way to run a service. (B) type does not protect against data format, ie temperature as a number makes no distinction to the scale, Kelvin, Celsius, or Fahrenheit. Maybe "immediately discovering incompatibilities" would be better as "simplifies the process of discovering incompatibilities"
â Blindman67
Apr 3 at 10:16
I find your second paragraph somewhat odd and bordering on misleading, particularly the words "immediately discovering incompatibilities", (A) this assumes you are constantly testing production code, not a very practical or affordable way to run a service. (B) type does not protect against data format, ie temperature as a number makes no distinction to the scale, Kelvin, Celsius, or Fahrenheit. Maybe "immediately discovering incompatibilities" would be better as "simplifies the process of discovering incompatibilities"
â Blindman67
Apr 3 at 10:16
@Blindman67 fair point, I decided the rest of the paragraph spoke for itself and just decided to remove that clause.
â Gerrit0
Apr 3 at 18:55
@Blindman67 fair point, I decided the rest of the paragraph spoke for itself and just decided to remove that clause.
â Gerrit0
Apr 3 at 18:55
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f191105%2ftransforming-data-from-an-api-using-typescript-and-lodash%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password