Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22420502
shortid.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
472 B
Referenced Files
None
Subscribers
None
shortid.ts
View Options
import
{
Field
}
from
"../../../main.js"
;
import
{
OpenApiTypes
}
from
"../../../schemas/open-api-types.js"
;
import
{
nanoid
}
from
"nanoid"
;
export
default
class
ShortID
extends
Field
<
string
>
{
typeName
=
"shortid"
;
open_api_type
=
OpenApiTypes
.
STR
;
hasIndex
=
async
()
=>
true
;
async
isProperValue
()
{
return
Field
.
valid
();
}
async
encode
(
_
:
any
,
input
:
string
|
null
)
{
if
(
input
===
null
)
{
return
null
;
}
return
input
?
input
:
nanoid
();
}
}
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Sat, Nov 28, 02:44 (15 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1182923
Default Alt Text
shortid.ts (472 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline