Skip to content

Commit

Permalink
Merge pull request #128 from JoshuaKGoldberg/typescript
Browse files Browse the repository at this point in the history
feat: convert to TypeScript
  • Loading branch information
omnidan authored May 18, 2023
2 parents 44800f9 + 424981b commit ff34dce
Show file tree
Hide file tree
Showing 37 changed files with 433 additions and 110 deletions.
14 changes: 14 additions & 0 deletions .github/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,17 @@ You can run with [Jest's `--watch` mode](https://jestjs.io/docs/cli#--watch) to
```shell
npm run test -- --watch
```

## Type Checking

Separately from building, [TypeScript](https://typescriptlang.org)'s compiler can be used to type check code:

```shell
npm run compile
```

You can run with with [TypeScript's `-w`/`--watch` mode](https://www.typescriptlang.org/docs/handbook/compiler-options.html) to continuously rerun the type checker as you make changes:

```shell
npm run compile -- -w
```
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Replace the emojis in a string.
Parameters:

- **`input`** (`string`): The input string.
- **`replacement`** (`string | (emoji: string, index: number, string: InputValueType) => string`): The character to replace the emoji with. Can be either a string or a callback that returns a string.
- **`replacement`** (`string | (emoji: string, index: number, string: string) => string`): The character to replace the emoji with. Can be either a string or a callback that returns a string.

```js
import * as emoji from 'node-emoji'
Expand Down Expand Up @@ -203,13 +203,15 @@ console.log(emoji.unemojify('The 🦄 is a fictitious animal.'))
// 'The :unicorn: is a fictitious animal.'
```

### emoji.which(emoji)
### emoji.which(emoji, options?)

Get an emoji name from an emoji.

Parameters:

1. **`emoji`** (`string`): The emoji to get the name of.
1. **`options`** _(optional)_:
- **`markdown`** (`boolean`; default: `false`): Whether to return a `":emoji:"` string instead of `"emoji"`

```js
import * as emoji from 'node-emoji'
Expand Down
4 changes: 3 additions & 1 deletion jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
"statements": 100
}
},
"transform": {}
"transform": {
"src.+\\.(t|j)s$": "@swc/jest"
}
}
Loading

0 comments on commit ff34dce

Please sign in to comment.