Skip to content

Commit 24045f3

Browse files
committed
docs: update usage example dependencies
Signed-off-by: Lexus Drumgold <[email protected]>
1 parent 2c17225 commit 24045f3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ yarn add @flex-development/export-regex@flex-development/export-regex
6565

6666
Suppose we have the following module:
6767

68-
```typescript
68+
```ts
6969
import * as regexp from '@flex-development/export-regex'
70-
import { omit } from 'radash'
70+
import { at, omit, select, type Times } from '@flex-development/tutils'
7171
import { dedent } from 'ts-dedent'
7272

73-
const code: [string, string, string, string] = [
73+
const code: Times<4, string> = [
7474
dedent`
7575
export { defineBuildConfig, type BuildConfig } from "#src"
7676
export type {
@@ -126,13 +126,13 @@ const code: [string, string, string, string] = [
126126
]
127127

128128
const print = (matches: IterableIterator<RegExpMatchArray>): void => {
129-
console.debug([...matches].map(match => omit(match, ['input'])))
129+
console.debug(select([...matches], null, match => omit(match, ['input'])))
130130
}
131131

132-
print(code[0].matchAll(regexp.EXPORT_AGGREGATE_REGEX))
133-
print(code[1].matchAll(regexp.EXPORT_DECLARATION_REGEX))
134-
print(code[2].matchAll(regexp.EXPORT_DEFAULT_REGEX))
135-
print(code[3].matchAll(regexp.EXPORT_LIST_REGEX))
132+
print(at(code, 0).matchAll(regexp.EXPORT_AGGREGATE_REGEX))
133+
print(at(code, 1).matchAll(regexp.EXPORT_DECLARATION_REGEX))
134+
print(at(code, 2).matchAll(regexp.EXPORT_DEFAULT_REGEX))
135+
print(at(code, 3).matchAll(regexp.EXPORT_LIST_REGEX))
136136
```
137137

138138
...running that yields:

0 commit comments

Comments
 (0)