mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-05 12:25:10 +02:00
cf4d7d4e6c
* chore: adjust prettier config, .gitignore and use taplo to format toml files This brings the plugins-workspace repository to the same code style of the main tauri repo * format toml * ignore examples gen dir * add .vscode/extensions.json * remove packageManager field * fmt * fix audit * taplo ignore permissions autogenerated files * remove create dummy dist * fix prettier workflow * install fmt in prettier workflow --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
16 lines
473 B
JavaScript
16 lines
473 B
JavaScript
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
export function arrayBufferToBase64(buffer, callback) {
|
|
const blob = new Blob([buffer], {
|
|
type: 'application/octet-binary'
|
|
})
|
|
const reader = new FileReader()
|
|
reader.onload = function (evt) {
|
|
const dataurl = evt.target.result
|
|
callback(dataurl.substr(dataurl.indexOf(',') + 1))
|
|
}
|
|
reader.readAsDataURL(blob)
|
|
}
|