mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-30 01:03:58 +00:00
SYNC: Merge branch 'feature/firestore'
This commit is contained in:
committed by
Diflow
parent
b12587626d
commit
ca145967dc
@@ -1,26 +1,3 @@
|
||||
/**
|
||||
* @template [T = any]
|
||||
* @typedef {Object} FileParseResultSuccess
|
||||
* @property {true} success
|
||||
* @property {T} data
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} FileParseResultError
|
||||
* @property {false} success
|
||||
* @property {string} error
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template [T = any]
|
||||
* @typedef {FileParseResultSuccess<T> | FileParseResultError} FileParseResult
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template [T = any]
|
||||
* @param {File} file
|
||||
* @returns {Promise<FileParseResult<T>>}
|
||||
*/
|
||||
export async function parseFileAsJson(file) {
|
||||
try {
|
||||
const text = await file.text();
|
||||
|
||||
Reference in New Issue
Block a user