Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanga-Ganapathy committed Apr 12, 2024
1 parent 261f861 commit 7192cd5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,23 @@ Let’s explore some of the library’s capabilities:
```js
import { isNum } from "@opentf/std";

console.log(isNum(NaN)); //=> false
isNum(NaN); //=> false
```

2. Converting Strings to PascalCase:

```js
import { pascalCase } from "@opentf/std";

console.log(pascalCase("pascal case")); //=> PascalCase
pascalCase("pascal case"); //=> PascalCase
```

3. Sorting an Array in Descending Order:

```js
import { sort } from "@opentf/std";

console.log(sort([1, 10, 21, 2], "desc")); //=> [21, 10, 2, 1]
sort([1, 10, 21, 2], "desc"); //=> [21, 10, 2, 1]
```

4. Deep Cloning an Object:
Expand All @@ -84,7 +84,7 @@ console.log(sort([1, 10, 21, 2], "desc")); //=> [21, 10, 2, 1]
import { clone } from "@opentf/std";

const obj = { a: 1, b: "abc", c: new Map([["key", "val"]]) };
console.log(clone(obj)); // Deeply cloned value
clone(obj); // Returns deeply cloned value
```

5. Checking Equality of Objects & Arrays:
Expand All @@ -100,9 +100,9 @@ const mapB = new Map([
["b", 2],
["a", 1],
]);
console.log(isEql(mapA, mapB)); //=> false
isEql(mapA, mapB); //=> false

console.log(isEqlArr([1, 2, 3], [2, 3, 1])); //=> true
isEqlArr([1, 2, 3], [2, 3, 1]); //=> true
```

6. Adding a Delay (1 second) with sleep:
Expand Down
26 changes: 9 additions & 17 deletions packages/std/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,25 @@ deno add @opentf/std
Let’s explore some of the library’s capabilities:

1. Checking if a Value is Numeric:

```js
import { isNum } from "@opentf/std";

console.log(isNum(NaN)); //=> false
isNum(NaN); //=> false
```

2. Converting Strings to PascalCase:

```js
import { pascalCase } from "@opentf/std";

console.log(pascalCase("pascal case")); //=> PascalCase
pascalCase("pascal case"); //=> PascalCase
```

3. Sorting an Array in Descending Order:

```js
import { sort } from "@opentf/std";

console.log(sort([1, 10, 21, 2], "desc")); //=> [21, 10, 2, 1]
sort([1, 10, 21, 2], "desc"); //=> [21, 10, 2, 1]
```

4. Deep Cloning an Object:
Expand All @@ -84,25 +82,19 @@ console.log(sort([1, 10, 21, 2], "desc")); //=> [21, 10, 2, 1]
import { clone } from "@opentf/std";

const obj = { a: 1, b: "abc", c: new Map([["key", "val"]]) };
console.log(clone(obj)); // Deeply cloned value
clone(obj); // Returns deeply cloned value
```

5. Checking Equality of Objects & Arrays:

```js
import { isEql, isEqlArr } from "@opentf/std";

const mapA = new Map([
["a", 1],
["b", 2],
]);
const mapB = new Map([
["b", 2],
["a", 1],
]);
console.log(isEql(mapA, mapB)); //=> false

console.log(isEqlArr([1, 2, 3], [2, 3, 1])); //=> true
const mapA = new Map([["a", 1], ["b", 2]]);
const mapB = new Map([["b", 2], ["a", 1]]);
isEql(mapA, mapB); //=> false

isEqlArr([1, 2, 3], [2, 3, 1]); //=> true
```

6. Adding a Delay (1 second) with sleep:
Expand Down

0 comments on commit 7192cd5

Please sign in to comment.