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

chore: Code organization #45

Merged
merged 2 commits into from
Oct 6, 2023
Merged

chore: Code organization #45

merged 2 commits into from
Oct 6, 2023

Conversation

gustavoguichard
Copy link
Owner

This PR is just organizing code following this logic:

  • deep key transformations are in their own file apart from shallow key transformations
  • type tests will have their own file, so for some-file.ts we have some-file.test.ts and some-file.types.test.ts
  • methods or types that are not public will be in the src/internals.ts
  • created couple more files for constants

>
}
export const weirdString =
' someWeird-cased$*String1986Foo [Bar] W_FOR_WUMBO...' as const
Copy link
Owner Author

Choose a reason for hiding this comment

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

Added [ and ] for better testing of the new separators

Comment on lines 39 to 51
test('toUpperCase', () => {
const expected = ' SOMEWEIRD-CASED$*STRING1986FOO BAR W_FOR_WUMBO' as const
const expected =
' SOMEWEIRD-CASED$*STRING1986FOO [BAR] W_FOR_WUMBO...' as const
const result = subject.toUpperCase(weirdString)
expect(result).toEqual(expected)
type test = Expect<Equal<typeof result, typeof expected>>
})

test('toLowerCase', () => {
const expected = ' someweird-cased$*string1986foo bar w_for_wumbo' as const
const expected =
' someweird-cased$*string1986foo [bar] w_for_wumbo...' as const
const result = subject.toLowerCase(weirdString)
expect(result).toEqual(expected)
Copy link
Owner Author

Choose a reason for hiding this comment

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

Now it is clear that these functions act differently

@gustavoguichard gustavoguichard merged commit 3331ce9 into main Oct 6, 2023
1 check passed
@gustavoguichard gustavoguichard deleted the organization branch October 6, 2023 15:37
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.

1 participant