Skip to content

Commit a3ee55a

Browse files
committed
docs: update alias and fallback options type and description
1 parent ade786e commit a3ee55a

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,15 @@ See [index.d.ts](https://github.com/unrs/unrs-resolver/blob/main/napi/index.d.ts
187187

188188
| Field | Default | Description |
189189
| ---------------- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
190-
| alias | [] | A list of module alias configurations or an object which maps key to value |
190+
| alias | {} | A hash map of module alias configurations |
191191
| aliasFields | [] | A list of alias fields in description files |
192192
| extensionAlias | {} | An object which maps extension to extension aliases |
193193
| conditionNames | [] | A list of exports field condition names |
194194
| descriptionFiles | ["package.json"] | A list of description files to read from |
195195
| enforceExtension | false | Enforce that a extension from extensions must be used |
196196
| exportsFields | ["exports"] | A list of exports fields in description files |
197197
| extensions | [".js", ".json", ".node"] | A list of extensions which should be tried for files |
198-
| fallback | [] | Same as `alias`, but only used if default resolving fails |
198+
| fallback | {} | Same as `alias`, but only used if default resolving fails |
199199
| fileSystem | | The file system which should be used |
200200
| fullySpecified | false | Request passed to resolve is already fully specified and extensions or main files are not resolved for it (they are still resolved for internal requests) |
201201
| mainFields | ["main"] | A list of main fields in description files |

napi/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export interface NapiResolveOptions {
4848
* AliasValue::Path(String)`
4949
* Create aliases to import or require certain modules more easily.
5050
* A trailing $ can also be added to the given object's keys to signify an exact match.
51+
* Default `{}`
5152
*/
5253
alias?: Record<string, Array<string | undefined | null>>
5354
/**
@@ -116,7 +117,7 @@ export interface NapiResolveOptions {
116117
/**
117118
* Redirect module requests when normal resolving fails.
118119
*
119-
* Default `[]`
120+
* Default `{}`
120121
*/
121122
fallback?: Record<string, Array<string | undefined | null>>
122123
/**

napi/src/options.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub struct NapiResolveOptions {
2222
/// AliasValue::Path(String)`
2323
/// Create aliases to import or require certain modules more easily.
2424
/// A trailing $ can also be added to the given object's keys to signify an exact match.
25+
/// Default `{}`
2526
pub alias: Option<HashMap<String, Vec<Option<String>>>>,
2627

2728
/// A list of alias fields in description files.
@@ -84,7 +85,7 @@ pub struct NapiResolveOptions {
8485

8586
/// Redirect module requests when normal resolving fails.
8687
///
87-
/// Default `[]`
88+
/// Default `{}`
8889
pub fallback: Option<HashMap<String, Vec<Option<String>>>>,
8990

9091
/// Request passed to resolve is already fully specified and extensions or main files are not resolved for it (they are still resolved for internal requests).

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//! # Oxc Resolver
1+
//! # UnRS Resolver
22
//!
33
//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution.
44
//!
5-
//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver).
5+
//! Released on [crates.io](https://crates.io/crates/unrs_resolver) and [npm](https://www.npmjs.com/package/unrs-resolver).
66
//!
77
//! A module resolution is the process of finding the file referenced by a module specifier in
88
//! `import "specifier"` or `require("specifier")`.

0 commit comments

Comments
 (0)