Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#256] Add schemata-ts Newtypes #259

Merged
merged 7 commits into from
Feb 14, 2023
Merged

[#256] Add schemata-ts Newtypes #259

merged 7 commits into from
Feb 14, 2023

Conversation

jacob-alford
Copy link
Owner

@jacob-alford jacob-alford commented Feb 12, 2023

Adds:

  1. brand module: brand reexport, and schemata-ts Branding (backwards compatible)
  2. newtype module: schemata-ts specific newtypes (backwards compatible)
  3. iso module: schemata-ts isomorphisms (compatible with monocle-ts experimental)

Closes #256

@coveralls
Copy link
Collaborator

coveralls commented Feb 13, 2023

Pull Request Test Coverage Report for Build 4169205174

  • 30 of 30 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 4149048534: 0.0%
Covered Lines: 2242
Relevant Lines: 2242

💛 - Coveralls

export const instanceComment: (
module: SchemableTypeclasses[0],
version: SchemableTypeclasses[3],
) => ts.JSDoc = (module, verision) =>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment on lines +194 to +196
`* ${
typeclassName === 'Type' ? '@deprecated\n' : ''
}@since ${version}\n\n@category Model`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't this produce a comment like

/**
 * @deprecated
@since 1.4.0

?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it gets fixed by prettier. I'm not sure if there's a way around that 🤔

src/brand.ts Outdated
* @since 1.4.0
* @category Model
*/
export const fromRefinement =
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to remove this, it doesn't make much sense to have

@jacob-alford jacob-alford force-pushed the ja/256/newtypes branch 2 times, most recently from 41fe693 to b7a524d Compare February 13, 2023 23:50
@jacob-alford jacob-alford merged commit 40ce1bc into main Feb 14, 2023
@jacob-alford jacob-alford deleted the ja/256/newtypes branch February 14, 2023 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Newtype Schema
3 participants