Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): add docs about new helpers #109

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/getting-started/athennarc-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ resolve the paths of your application:
"logs": "storage/logs",
"tests": "tests",
"stubs": "tests/stubs",
"fixtures": "tests/fixtures",
}
}
```
Expand Down
36 changes: 36 additions & 0 deletions docs/the-basics/helpers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2338,6 +2338,22 @@ import { Is } from '@athenna/common'
Is.Windows() // true
```

#### `Is::Module()`

Validate if a path or `File` instance is a module:

```typescript
import { Is, File } from '@athenna/common'

Is.Module('./hello.js') // true
Is.Module('./hello.ts') // true
Is.Module('./hello.json') // false

Is.Module(new File('./hello.js')) // true
Is.Module(new File('./hello.ts')) // true
Is.Module(new File('./hello.json')) // false
```

#### `Is::Uuid()`

Validate if the value is a valid UUID v4:
Expand Down Expand Up @@ -3969,6 +3985,26 @@ import { Path } from '@athenna/common'
Path.setStubs('stubs/app')
```

#### `Path::fixtures()`

Merge the project root path with `Path.dirs.fixtures`:

```typescript
import { Path } from '@athenna/common'

console.log(Path.fixtures()) // /home/user/athenna-project/tests/fixtures
```

#### `Path::setFixtures()`

Set the `Path.dirs.fixtures` value:

```typescript
import { Path } from '@athenna/common'

Path.setFixtures('fixtures/app')
```

#### `Path::http()`

Merge the project root path with `Path.dirs.http`:
Expand Down
Loading