brianc / node-pg-types

Type parsing for node-postgres
268 stars 55 forks source link

update TS definitions to be in sync with implementation #99

Closed stekycz closed 5 years ago

stekycz commented 5 years ago

Fixes #98

codecov-io commented 5 years ago

Codecov Report

Merging #99 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #99   +/-   ##
=======================================
  Coverage   80.33%   80.33%           
=======================================
  Files           5        5           
  Lines         300      300           
=======================================
  Hits          241      241           
  Misses         59       59

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e00fa8e...3905539. Read the comment docs.

stekycz commented 5 years ago

There is one remaining issue I know about related to the array parser. The array parser might parse recursive array with the expected type in leaves. However, the depth of the array recursiveness depends on the input string. That is why multidimensional array will be typed as single-dimensional.

Do you have some suggestion on how to type it? I do not want to use ReadonlyArray<any> and using generic recursivity breaks typing for the most common usage (IMO) - single-dimensional array.

bendrucker commented 5 years ago

Thanks! I have minimal TypeScript experience so I can't give you much guidance about the nested array question.

stekycz commented 5 years ago

No problem. I will think about it more and I will send another PR if I will came with something.

bendrucker commented 5 years ago

Is this ok to merge as is? Wasn't sure based on your question.

stekycz commented 5 years ago

Yes, feel free to merge it 👍