Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22394961
prettier.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
514 B
Referenced Files
None
Subscribers
None
prettier.ts
View Options
import
Prettier
from
"prettier"
;
import
{
Options
}
from
"prettier"
;
import
_locreq
from
"locreq"
;
const
target_locreq
=
_locreq
(
process
.
cwd
());
export
async
function
getPrettierConfig
(
parser
=
"typescript"
)
:
Promise
<
Options
>
{
return
{
...(
await
Prettier
.
resolveConfig
(
target_locreq
.
resolve
(
"src/back/routes"
)
)),
parser
,
};
}
export
async
function
formatWithPrettier
(
content
:
string
,
lang
=
"typescript"
)
:
Promise
<
string
>
{
return
Prettier
.
format
(
content
,
await
getPrettierConfig
(
lang
));
}
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Fri, Nov 27, 16:22 (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1192000
Default Alt Text
prettier.ts (514 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline