-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Extracting Typegen utils (plus test utils) into a new `utils` package * Fixing author name * Adding changeset * Renaming file and method * Fixing remaining outdagted/broken refs * Moving utilities around * Moving test-utilities around * Adding new output variable and renaming existing one * Returning also the hexilified version of Forc projects’ `.bin` file * Fixing broken file path in `package.json` * Fixing another broken file path in `package.json` * Fixing outdated refs * Adjusting package configs * Update packages/utils/src/test-utils/safeExec.test.ts Co-authored-by: Dhaiwat <dhaiwatpandya@gmail.com> * Undo unrelated change * Renaming `normalize` method, reviewing docs, updating refs * Undo unrelated changes * Updating refs --------- Co-authored-by: Dhaiwat <dhaiwatpandya@gmail.com>
- Loading branch information
Showing
30 changed files
with
419 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@fuel-ts/abi-typegen": patch | ||
"fuels": patch | ||
"@fuel-ts/utils": patch | ||
--- | ||
|
||
Extracting Typegen utils (plus test utils) into a new package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# `@fuel-ts/utils` | ||
|
||
**@fuel-ts/utils** is a sub-module for interacting with **Fuel**. | ||
|
||
It's a collection of utilities and test utilities that may be useful in other places. | ||
|
||
# Table of contents | ||
|
||
- [Documentation](#documentation) | ||
- [Usage](#usage) | ||
- [Installation](#installation) | ||
- [Full SDK Installation](#full-sdk-installation) | ||
- [Contributing](#contributing) | ||
- [Changelog](#changelog) | ||
- [License](#license) | ||
|
||
## Documentation | ||
|
||
See [Fuel-ts Documentation](https://fuellabs.github.io/fuels-ts/packages/fuel-ts-utils/) | ||
|
||
## Installation | ||
|
||
```sh | ||
yarn add @fuel-ts/utils | ||
# or | ||
npm add @fuel-ts/utils | ||
``` | ||
|
||
### Utilities | ||
|
||
```ts | ||
import { normalizeString } from "@fuel-ts/utils"; | ||
|
||
console.log(normalizeString("fuel-labs")); | ||
// FuelLabs | ||
``` | ||
|
||
### Test Utilities | ||
|
||
```ts | ||
import { safeExec } from "@fuel-ts/utils/test"; // note the `test` suffix | ||
|
||
console.log(safeExec(() => 123)); | ||
// { error: null, result: 123 } | ||
|
||
console.log( | ||
safeExec(() => { | ||
throw new Error("Some error"); | ||
}) | ||
); | ||
// { error: (Error: 'Some error'), result: null } | ||
``` | ||
|
||
## Contributing | ||
|
||
In order to contribute to `@fuel-ts/utils`, please see the main [fuels-ts](https://github.com/FuelLabs/fuels-ts) monorepo. | ||
|
||
## Changelog | ||
|
||
The `@fuel-ts/utils` changelog can be found at [CHANGELOG](./CHANGELOG.md). | ||
|
||
## License | ||
|
||
The primary license for `@fuel-ts/utils` is `Apache 2.0`, see [LICENSE](./LICENSE). |
Oops, something went wrong.