Page MenuHomeSealhub

shortid.ts
No OneTemporary

Authored By
Unknown
Size
472 B
Referenced Files
None
Subscribers
None

shortid.ts

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

Mime Type
application/javascript
Expires
Fri, Nov 27, 20:05 (6 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1182923
Default Alt Text
shortid.ts (472 B)

Event Timeline