Compare commits

..

No commits in common. "3049271aa56f3e45eefc7fd67ea626c5418fe04a" and "a41e7734eb6186f59da2aae772b66d1aa35d53ea" have entirely different histories.

3 changed files with 914 additions and 1194 deletions

View File

@ -1,8 +1,7 @@
import { isDef, isNumber, isPlainObject, isPromise } from './validator';
import { canIUseGroupSetData, canIUseNextTick, getSystemInfoSync } from './version';
import { canIUseGroupSetData, canIUseNextTick } from './version';
export { isDef } from './validator';
export { getSystemInfoSync } from './version';
export function range(num: number, min: number, max: number) {
return Math.min(Math.max(num, min), max);
@ -18,6 +17,15 @@ export function nextTick(cb: (...args: any[]) => void) {
}
}
let systemInfo: WechatMiniprogram.SystemInfo;
export function getSystemInfoSync() {
if (systemInfo == null) {
systemInfo = wx.getSystemInfoSync();
}
return systemInfo;
}
export function addUnit(value?: string | number): string | undefined {
if (!isDef(value)) {
return undefined;

View File

@ -1,11 +1,4 @@
let systemInfo: WechatMiniprogram.SystemInfo;
export function getSystemInfoSync() {
if (systemInfo == null) {
systemInfo = wx.getSystemInfoSync();
}
return systemInfo;
}
import { getSystemInfoSync } from './utils';
function compareVersion(v1, v2) {
v1 = v1.split('.');
@ -57,11 +50,7 @@ export function canIUseGroupSetData() {
}
export function canIUseNextTick() {
try {
return wx.canIUse('nextTick');
} catch (e) {
return gte('2.7.1');
}
return wx.canIUse('nextTick');
}
export function canIUseCanvas2d() {

2081
yarn.lock

File diff suppressed because it is too large Load Diff