Skip to content

Commit 3b53888

Browse files
committed
Update the doc in README.md
1 parent 34828ca commit 3b53888

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

README.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,53 @@ yarn add @mfederczuk/deeptools
2525

2626
## Usage ##
2727

28-
### [`deepCopy`](./src/deepCopy.js) ###
28+
### [`deepCopy`](./src/deepCopy.ts) ###
2929

3030
```ts
3131
function deepCopy<T>(obj: T): T;
3232
```
3333

3434
Creates a deep copy of **obj**.
3535

36-
### [`deepEquals`](./src/deepEquals.js) ###
36+
### [`deepEquals`](./src/deepEquals.ts) ###
3737

3838
```ts
39-
function deepEquals(obj1: any, obj2: any): boolean;
39+
function deepEquals(obj1: unknown, obj2: unknown): boolean;
4040
```
4141

4242
Checks if **obj1** and **obj2** are equal by recursing through their properties.
4343

44-
### [`deepFreeze`](./src/deepFreeze.js) ###
44+
### [`deepFreeze`](./src/deepFreeze.ts) ###
45+
46+
```ts
47+
function deepFreeze<T>(arr: T[][]): readonly (readonly Readonly<T>[])[];
48+
```
49+
50+
Recursively freezes **arr**, all of **arr**'s items and all items of **arr**'s items.
51+
52+
```ts
53+
function deepFreeze<T>(arr: T[]): readonly Readonly<T>[];
54+
```
55+
56+
Recursively freezes **arr** and all of its items.
4557

4658
```ts
47-
function deepFreeze<T>(arr: T[]): ReadonlyArray<T>;
48-
function deepFreeze<T extends Function>(fun: T): T;
4959
function deepFreeze<T>(obj: T): Readonly<T>;
5060
```
5161

52-
Recursively freezes **obj** with all of its properties.
62+
Recursively freezes **obj** and all of its properties.
63+
64+
### [`safeCopy`](./src/safeCopy.ts) ###
65+
66+
```ts
67+
function safeCopy<T>(arr: T[][]): readonly (readonly Readonly<T>[])[];
68+
function safeCopy<T>(arr: T[]): readonly Readonly<T>[];
69+
```
5370

54-
### [`safeCopy`](./src/safeCopy.js) ###
71+
Creates a safe copy of **arr** by creating a deep frozen copy of it.
5572

5673
```ts
57-
function safeCopy<T>(obj: T): T;
74+
function safeCopy<T>(obj: T): Readonly<T>;
5875
```
5976

6077
Creates a safe copy of **obj** by creating a deep frozen copy of it.

0 commit comments

Comments
 (0)