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

Library reexport #79

Open
ivan-kleshnin opened this issue May 15, 2023 · 0 comments
Open

Library reexport #79

ivan-kleshnin opened this issue May 15, 2023 · 0 comments

Comments

@ivan-kleshnin
Copy link

ivan-kleshnin commented May 15, 2023

Hi Marcin! How hard would it be to update the build pipeline to make namespaces extendable? I mean this:

lib/string.ts (reexport + extra helpers)

export * from "@mobily/ts-belt/String"
// TS2307: Cannot find module '@mobily/ts-belt/String' or its corresponding type declarations.

export function capitalize(str: string): string {
  return str.charAt(0).toUpperCase() + str.slice(1)
}

index.ts (import original + custom helpers under the same namespace)

import * as S from "./lib/string"

console.log(S.trim) // original method
console.log(S.capitalize) // custom method

Would be a great feature, more ergonomic than exporting extra custom hepers under A2, D2, S2 prefixes 😨
Or manual reexport via enumerating every original function:

// ...
export const isNotEmpty = S.isNotEmpty
export const split = S.split
export const trim = S.trim
// ...
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

No branches or pull requests

1 participant