提交 55bdf71c 编写于 作者: Q qiang

feat: 增加API:uni.base64ToArrayBuffer、uni.arrayBufferToBase64

上级 53bd3bd2
......@@ -22,6 +22,7 @@
"@vue/test-utils": "^1.0.0-beta.25",
"babel-eslint": "^10.0.1",
"babylon": "^6.18.0",
"base64-arraybuffer": "^0.2.0",
"browserslist": "^4.4.2",
"caniuse-lite": "^1.0.30000940",
"chai": "^4.1.2",
......@@ -60,7 +61,7 @@
"App": true,
"Page": true,
"Component": true,
"Behavior":true,
"Behavior": true,
"getApp": true,
"getCurrentPages": true,
"plus": true,
......@@ -77,7 +78,7 @@
"__VERSION__": true,
"__GLOBAL__": true,
"__PLATFORM_TITLE__": true,
"__PLATFORM_PREFIX__":true
"__PLATFORM_PREFIX__": true
},
"rules": {
"no-tabs": 0,
......
......@@ -2,7 +2,7 @@ import {
isFn
} from 'uni-shared'
const SYNC_API_RE = /subNVue|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$/
const SYNC_API_RE = /subNVue|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
const CONTEXT_API_RE = /^create|Manager$/
......
export const base64ToArrayBuffer = [{
name: 'base64',
type: String,
required: true
}]
export const arrayBufferToBase64 = [{
name: 'arrayBuffer',
type: [ArrayBuffer, Uint8Array],
required: true
}]
import { encode, decode } from 'base64-arraybuffer'
export const base64ToArrayBuffer = decode
export const arrayBufferToBase64 = encode
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册