open-index/open-npm huggingface dataset:
npm package: @koine/i18n
Description: The compiled output allows to easily manage multile applications and their translations independently within the same monorepo.
Latest version: 2.0.0-beta.217

# @koine/i18n

## Features

## Co-locate multiple internationalised projects within the same monorepo

The compiled output allows to easily manage multile applications and their translations independently within the same monorepo.

**Further reading**

This was achieved preferring types compilation (the `I18n` namespace) rather than relying on [module augmentation](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation) where interface merging of possibly exported shared types from `@koine/i18n` could have achieved the same (see [`i18next` approach](https://www.i18next.com/overview/typescript#create-a-declaration-file)). That in fact would have not allow types to be scoped to the specific i18n compiled project, especially important within a monorepo. It was taken into consideration even a class based approach possibly achieved by something like this:

```ts
// in `@koine/i18n/types.ts`:
export class I18nClass<Locales extends {}, ...all other configurable interfaces as generics> {
  public Locale: keyof Locales;

  constructor(locales: Locales) {
    this.Locale = Object.keys(locales)[0] as keyof Locales;
  }
}

// somewhere in the project using @koine/i18n
import { I18n } from "@/i18n";

const myLocale: I18n["Locale"] = "";

```

This was discarded for a better _dx_ as using `I18n["Locale"]` is not as nice as using the namespace form of this `I18n.Locale`.
For a better _dx_ it was also decided not to export any `I18n` namespace from `@koine/i18n` to avoid amibguity in the IDE autocomplete feature as the same namespace is always exported from the compiled output.
npm package: @koine/utils
Description: Libraries to encapsulate and re-export from here, the selection is based on:
Latest version: 2.0.0-beta.217

# @koine/utils

Libraries to encapsulate and re-export from here, the selection is based on:

- [x] full typescript support
- [x] treeshake-ability
- [x] docs in source comments

- [dhmk-utils](https://github.com/dhmk083/dhmk-utils)
- [mesqueeb/merge-anything](https://github.com/mesqueeb/merge-anything)
- [mesqueeb/filter-anything](https://github.com/mesqueeb/filter-anything)
- [mesqueeb/case-anything](https://github.com/mesqueeb/case-anything)
- [mesqueeb/nestify-anything](https://github.com/mesqueeb/nestify-anything)
- [mesqueeb/fast-sort (fork)](https://github.com/mesqueeb/fast-sort "fork")
- [mesqueeb/compare-anything](https://github.com/mesqueeb/compare-anything)
- [mesqueeb/copy-anything](https://github.com/mesqueeb/copy-anything)
- [mesqueeb/flatten-anything](https://github.com/mesqueeb/flatten-anything)

To consider:

- [dlv](https://www.npmjs.com/package/dlv)
- [lukeed/dset](https://github.com/lukeed/dset)
- [angus-c/just](https://github.com/angus-c/just)

About ts utilities types @see:

- [sindresorhus/type-fest](https://github.com/sindresorhus/type-fest)
- [millsp/ts-toolbelt](https://github.com/millsp/ts-toolbelt)
- [ts-essentials](https://github.com/ts-essentials/ts-essentials)

For inspiration look at [1loc.dev](https://1loc.dev).

About utilities useful examples @see:

- [chakra-ui](https://github.com/chakra-ui/chakra-ui/blob/main/packages/utils/src)

TODO: check typescript utilities in [TypeScript core](https://github.com/microsoft/TypeScript/blob/main/src/compiler/core.ts)

## Code

- Transformative functions like `truncate` or `titleCase` should allow for nullable inputs as much as possible, acceptin both `undefined` and `null`.