Skip to content

Commit

Permalink
chore: curent changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
tabaktoni committed May 6, 2024
2 parents 3a58b84 + ba35b6c commit 933220a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ If you want to contribute but don’t know what to do, take a look at these two

_[Use GitHub interface](https://blog.sapegin.me/all/open-source-for-everyone/) for simple documentation changes, otherwise follow the steps below._

> :warning: IMPORTANT NOTE :warning:
>
> All contributions are expected to be of the highest possible quality! That means the PR is thoroughly tested and documented, and without blindly generated ChatGPT code and documentation! We will not consider nor merge PR-s that do not comply to these rules!
## Prerequisites

- If it’s your first pull request, watch [this amazing course](http://makeapullrequest.com/) by [Kent C. Dodds](https://twitter.com/kentcdodds).
- Fork the repository and clone your fork.
- Checkout to the `develop` branch.
- Install dependencies: `npm install`.

## Development workflow
Expand All @@ -34,8 +39,9 @@ Or run tests in watch mode:
npm test --watch
```

By default the tests are executed in your local Devnet. If you want to use a specific
RPC node, you have to set some global variables before executing the tests:
By default the tests are executed in your local Devnet and everything should run automatically.

If you want to use a specific RPC node, you have to set some global variables before executing the tests:

```bash
export TEST_RPC_URL=http://192.168.1.44:9545/rpc/v0.5 # example of a Pathfinder node located in your local network
Expand Down
16 changes: 16 additions & 0 deletions src/utils/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ const nonLocalhostDomainRE = /^[^\s.]+\.\S{2,}$/;

/**
* Loosely validate a URL `string`.
*
* @param {string} s - The URL to check for
* @return {boolean} `true` if url is valid, `false` otherwise
* @example
* ```typescript
* const s = "https://starknetjs.com/docs";
* const result = isUrl(s);
* // result == true
*/
export function isUrl(s?: string): boolean {
if (!s) {
Expand Down Expand Up @@ -53,6 +61,14 @@ export function isUrl(s?: string): boolean {
* @param {string} defaultPath - The default path to use if no URL or path is provided.
* @param {string} [urlOrPath] - The optional URL or path to append to the base URL.
* @return {string} The built URL.
* @example
* ```typescript
* const baseUrl = "https://starknetjs.com";
* const defaultPath = "/";
* const urlOrPath = "/docs";
* const result = buildUrl(baseUrl, defaultPath, urlOrPath);
*
* result = "https://starknetjs.com/docs"
*/
export function buildUrl(baseUrl: string, defaultPath: string, urlOrPath?: string) {
return isUrl(urlOrPath) ? urlOrPath! : urljoin(baseUrl, urlOrPath ?? defaultPath);
Expand Down

0 comments on commit 933220a

Please sign in to comment.