[improvement] rename packages dir to src (#3659)

This commit is contained in:
neverland
2019-06-27 11:25:57 +08:00
committed by GitHub
parent 8489918dca
commit 75c79b7044
619 changed files with 21 additions and 21 deletions
+3
View File
@@ -0,0 +1,3 @@
export function range(num: number, min: number, max: number): number {
return Math.min(Math.max(num, min), max);
}
+9
View File
@@ -0,0 +1,9 @@
const camelizeRE = /-(\w)/g;
export function camelize(str: string): string {
return str.replace(camelizeRE, (_, c) => c.toUpperCase());
}
export function padZero(num: number | string): string {
return (num < 10 ? '0' : '') + num;
}
+11
View File
@@ -0,0 +1,11 @@
import { isDef } from '..';
import { isNumber } from '../validate/number';
export function suffixPx(value?: string | number): string | undefined {
if (!isDef(value)) {
return undefined;
}
value = String(value);
return isNumber(value) ? `${value}px` : value;
}