@settlemint/sdk-utils 2.6.2-predd71073 → 2.6.2-pref5d7103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -458,7 +458,7 @@ const baseUrl = extractBaseUrlBeforeSegment("https://example.com/api/v1/subgraph
|
|
|
458
458
|
|
|
459
459
|
#### extractJsonObject()
|
|
460
460
|
|
|
461
|
-
> **extractJsonObject**\<`T`\>(`value`): `
|
|
461
|
+
> **extractJsonObject**\<`T`\>(`value`): `T` \| `null`
|
|
462
462
|
|
|
463
463
|
Defined in: [sdk/utils/src/json.ts:50](https://github.com/settlemint/sdk/blob/v2.6.2/sdk/utils/src/json.ts#L50)
|
|
464
464
|
|
|
@@ -478,7 +478,7 @@ Extracts a JSON object from a string.
|
|
|
478
478
|
|
|
479
479
|
##### Returns
|
|
480
480
|
|
|
481
|
-
`
|
|
481
|
+
`T` \| `null`
|
|
482
482
|
|
|
483
483
|
The parsed JSON object, or null if no JSON object is found
|
|
484
484
|
|
|
@@ -570,7 +570,7 @@ console.log(packages); // Output: ["/path/to/your/project/packages/core", "/path
|
|
|
570
570
|
|
|
571
571
|
#### findMonoRepoRoot()
|
|
572
572
|
|
|
573
|
-
> **findMonoRepoRoot**(`startDir`): `Promise`\<`
|
|
573
|
+
> **findMonoRepoRoot**(`startDir`): `Promise`\<`string` \| `null`\>
|
|
574
574
|
|
|
575
575
|
Defined in: [sdk/utils/src/filesystem/mono-repo.ts:19](https://github.com/settlemint/sdk/blob/v2.6.2/sdk/utils/src/filesystem/mono-repo.ts#L19)
|
|
576
576
|
|
|
@@ -584,7 +584,7 @@ Finds the root directory of a monorepo
|
|
|
584
584
|
|
|
585
585
|
##### Returns
|
|
586
586
|
|
|
587
|
-
`Promise`\<`
|
|
587
|
+
`Promise`\<`string` \| `null`\>
|
|
588
588
|
|
|
589
589
|
The root directory of the monorepo or null if not found
|
|
590
590
|
|
|
@@ -1404,7 +1404,7 @@ const truncated = truncate("Hello, world!", 10);
|
|
|
1404
1404
|
|
|
1405
1405
|
#### tryParseJson()
|
|
1406
1406
|
|
|
1407
|
-
> **tryParseJson**\<`T`\>(`value`, `defaultValue`): `
|
|
1407
|
+
> **tryParseJson**\<`T`\>(`value`, `defaultValue`): `T` \| `null`
|
|
1408
1408
|
|
|
1409
1409
|
Defined in: [sdk/utils/src/json.ts:23](https://github.com/settlemint/sdk/blob/v2.6.2/sdk/utils/src/json.ts#L23)
|
|
1410
1410
|
|
|
@@ -1421,11 +1421,11 @@ Attempts to parse a JSON string into a typed value, returning a default value if
|
|
|
1421
1421
|
| Parameter | Type | Default value | Description |
|
|
1422
1422
|
| ------ | ------ | ------ | ------ |
|
|
1423
1423
|
| `value` | `string` | `undefined` | The JSON string to parse |
|
|
1424
|
-
| `defaultValue` | `
|
|
1424
|
+
| `defaultValue` | `T` \| `null` | `null` | The value to return if parsing fails or results in null/undefined |
|
|
1425
1425
|
|
|
1426
1426
|
##### Returns
|
|
1427
1427
|
|
|
1428
|
-
`
|
|
1428
|
+
`T` \| `null`
|
|
1429
1429
|
|
|
1430
1430
|
The parsed JSON value as type T, or the default value if parsing fails
|
|
1431
1431
|
|
package/package.json
CHANGED