Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F3010268
uuid.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
858 B
Referenced Files
None
Subscribers
None
uuid.ts
View Options
import
{
v4
as
uuid
}
from
"uuid"
;
import
Field
,
{
ValidationResult
}
from
"../../../chip-types/field.js"
;
import
type
Context
from
"../../../context.js"
;
export
class
Uuid
extends
Field
<
string
>
{
typeName
=
"uuid"
;
isOldValueSensitive
=
()
:
boolean
=>
true
;
async
isProperValue
()
:
Promise
<
ValidationResult
>
{
return
Field
.
valid
();
}
async
encode
(
_
:
Context
,
__
:
unknown
,
old_value
:
string
)
:
Promise
<
string
>
{
const
ret
=
old_value
?
old_value
:
uuid
();
return
ret
;
}
async
getMatchQueryValue
(
context
:
Context
,
filter
:
string
)
:
Promise
<
string
>
{
return
filter
;
}
async
decode
(
_
:
Context
,
value
:
string
)
:
Promise
<
string
>
{
return
value
;
}
async
filterToQuery
(
_
:
Context
,
filter
:
unknown
)
:
Promise
<
{
$eq
:
unknown
;
}
>
{
return
{
$eq
:
filter
};
}
async
getDefaultValue
()
:
Promise
<
string
>
{
return
uuid
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Wed, May 7, 19:39 (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
642523
Default Alt Text
uuid.ts (858 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment