clean up code and logs (#1809)

abstract base64 functions and clean up console logs
This commit is contained in:
Matt Hill
2022-09-19 12:59:41 -06:00
committed by GitHub
parent f04b90d9c6
commit 1150f4c438
13 changed files with 27 additions and 32 deletions

View File

@@ -46,6 +46,7 @@ export * from './types/url'
export * from './types/workspace-config'
export * from './util/copy-to-clipboard'
export * from './util/base-64'
export * from './util/get-pkg-id'
export * from './util/misc.util'
export * from './util/rpc.util'

View File

@@ -11,7 +11,6 @@ export class DownloadHTMLService {
.join(';')
const styleString = entries ? `<style>html{${entries}}></style>` : ''
console.log('STYLES', styleString)
html = styleString + html
const elem = this.document.createElement('a')

View File

@@ -0,0 +1,9 @@
import * as Base64 from 'base64-js'
export function encodeBase64(text: string) {
return Base64.fromByteArray(new TextEncoder().encode(text))
}
export function decodeBase64(encoded: string) {
return new TextDecoder().decode(Base64.toByteArray(encoded))
}