Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F969767
uuid.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
915 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"
;
async
hasIndex
()
:
Promise
<
boolean
>
{
return
true
;
}
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
Sat, Nov 23, 17:32 (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
548011
Default Alt Text
uuid.ts (915 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment