silverwolf-x's picture
download
raw
785 Bytes
'use server'
import { db } from 'database'
export const createItem = async (title) => {
return new Promise((resolve, reject) => {
db.serialize(() => {
db.run(
`INSERT INTO items (title) VALUES ($title)`,
{ $title: title },
function () {
// arguments is allowed here
const [err] = arguments
if (err) {
reject(err)
}
// this is allowed here
resolve(this.lastID)
}
)
})
})
}
export async function test() {
const MyClass = class {
x = 1
foo() {
// this is allowed here
return this.x
}
bar = () => {
// this is allowed here
return this.x
}
}
const myObj = new MyClass()
return myObj.foo() + myObj.bar()
}

Xet Storage Details

Size:
785 Bytes
·
Xet hash:
0a204058ae45d57509581ec8db20466ce965ca73fd5115d8058e4eadd2ac6749

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.