Skip to content

Commit 29071f1

Browse files
committed
Refactor types to use readonly
1 parent d5e0dcd commit 29071f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import {color as colorDefault} from '#conditional-color'
88

9-
/** @type {Options} */
9+
/** @type {Readonly<Options>} */
1010
const emptyOptions = {}
1111

1212
// To do: next major (?): use `Object.hasOwn`.
@@ -17,7 +17,7 @@ const own = {}.hasOwnProperty
1717
*
1818
* @param {unknown} tree
1919
* Tree to inspect.
20-
* @param {Options | null | undefined} [options]
20+
* @param {Readonly<Options> | null | undefined} [options]
2121
* Configuration.
2222
* @returns {string}
2323
* Pretty printed `tree`.
@@ -48,7 +48,7 @@ export function inspect(tree, options) {
4848
* Use `inspect` instead, with `color: false`.
4949
* @param {unknown} tree
5050
* Tree to inspect.
51-
* @param {Omit<Options, 'color'> | null | undefined} [options]
51+
* @param {Readonly<Omit<Options, 'color'>> | null | undefined} [options]
5252
* Configuration.
5353
* @returns {string}
5454
* Pretty printed `tree`.
@@ -65,7 +65,7 @@ export function inspectNoColor(tree, options) {
6565
* Use `inspect` instead, with `color: true`.
6666
* @param {unknown} tree
6767
* Tree to inspect.
68-
* @param {Omit<Options, 'color'> | null | undefined} [options]
68+
* @param {Readonly<Omit<Options, 'color'>> | null | undefined} [options]
6969
* Configuration (optional).
7070
* @returns {string}
7171
* Pretty printed `tree`.

0 commit comments

Comments
 (0)