feat(parser): add Resource.cwd() static method
All checks were successful
Actions / Build and Push Documentation (push) Successful in 18s

this method creates a `Resource` instance using the output of
`process.cwd()`
This commit is contained in:
cswimr 2025-02-13 10:01:55 -06:00
parent 95f8e358dd
commit 3ec07c7235
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087
2 changed files with 9 additions and 1 deletions

View file

@ -1,7 +1,7 @@
{
"name": "@packwizjs/parser",
"module": "src/index.ts",
"version": "1.1.2",
"version": "1.2.0",
"type": "module",
"description": "A simple library for parsing Packwiz TOML files",
"author": {

View file

@ -155,4 +155,12 @@ export class Resource {
}
return new Resource(path.join(this.path, ...segments));
}
/**
* Creates a new Resource instance with the current working directory.
* @returns A new Resource instance with the current working directory.
*/
static cwd(): Resource {
return new Resource(process.cwd());
}
}