|
1 | | -# [`typed-string-interpolation`](https://www.npmjs.com/package/typed-string-interpolation) |
| 1 | +# `typed-string-interpolation` |
2 | 2 |
|
3 | | -[String interpolation](https://en.wikipedia.org/wiki/String_interpolation) utility that returns the correct type based on passed in variable substitutions. |
| 3 | +[String interpolation](https://en.wikipedia.org/wiki/String_interpolation) utility that returns the correct `TypeScript` type based on passed in variables. |
4 | 4 |
|
5 | 5 | ## Main features |
6 | 6 |
|
|
15 | 15 |
|
16 | 16 | ## Motivation |
17 | 17 |
|
18 | | -String interpolation/variable substitution (i.e. injecting variables within text) is a really common operation when building single and multilingual applications. Existing string interpolation utilities within the most used `i18n` / `l10n` packages like `i18next` and `formatjs` come with massive overhead while lacking proper TypeScript infer support for the interpolation operation. |
| 18 | +String interpolation/variable substitution (i.e. injecting variables within text) is a really common operation when building single and multilingual applications alike. Existing string interpolation utilities within the most used `i18n` / `l10n` packages like `i18next` and `formatjs` come with massive overhead while lacking proper TypeScript infer support for the interpolation operation. |
19 | 19 |
|
20 | | -This package aims to provide a high quality string interpolation "primitive" to use as is or within other localization frameworks and tooling. |
| 20 | +This utility aims to provide a high quality string interpolation "primitive" to use as is or within other localization frameworks and tooling. |
21 | 21 |
|
22 | 22 | ## Getting started |
23 | 23 |
|
@@ -59,7 +59,7 @@ stringInterpolation("hello {{world}} with {{anything}}", { |
59 | 59 |
|
60 | 60 | ## TypeScript support |
61 | 61 |
|
62 | | -If the string can be joined you'll get back a `string` type. Otherwise a ` type within an array is returned based on the passed in variables. |
| 62 | +If the string can be joined you'll get back a `string` type. Otherwise a `union` type within an array is returned based on the passed in variables. |
63 | 63 |
|
64 | 64 | ```ts |
65 | 65 | stringInterpolation("hello {{world}} with number {{number}}", { |
@@ -136,16 +136,15 @@ Easiest way to contribute is to open new issues for API suggestions and bugs. |
136 | 136 |
|
137 | 137 | ### Contributing for a release |
138 | 138 |
|
139 | | -Steps for contributing through a PR: |
| 139 | +Steps for contributing through a pull request: |
140 | 140 |
|
141 | 141 | - Fork `main` on Github and clone fork locally |
142 | | -- `npm ci` to install dependencies |
143 | | -- Make changes while running tests |
144 | | - - Unit test in watch mode: |
145 | | - - `npm run test:unit:watch` |
146 | | - - Unit test for types in watch mode: |
147 | | - - `npm run test:unit:types:watch` |
148 | | -- Once all changes are complete create a new release with [changesets](https://github.com/changesets/changesets) |
| 142 | +- Install dependencies |
| 143 | + - `npm ci` |
| 144 | +- Make changes while running tests in watch mode |
| 145 | + - `npm run test:unit:all:watch` |
| 146 | +- Once all changes are complete, create a new release with [changesets](https://github.com/changesets/changesets) |
149 | 147 | - `npm run changeset` |
150 | 148 | - Commit and push changes to fork |
151 | 149 | - Open a pull request against the fork |
| 150 | +- If the PR needs changes before a merge to `main` can be made, push more changes to the fork until the PR is approved |
0 commit comments