Skip to content

Commit

Permalink
feat: 注释补齐
Browse files Browse the repository at this point in the history
  • Loading branch information
huangguang1999 committed Sep 21, 2023
1 parent 63d13b1 commit 51dce8c
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 31,665 deletions.
29,291 changes: 42 additions & 29,249 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/arcodesign/components/_helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export * from './type';
* @desc {en} Get style with browser vendor prefix
* @param {CSSProperties} style 原始样式
* @param {CSSProperties} style {en} Original style
* @return {CSSProperties} newStyle 添加了浏览器前缀的新样式
* @return {CSSProperties} newStyle {en} New style with browser vendor prefix
* @returns {CSSProperties} newStyle 添加了浏览器前缀的新样式
* @returns {CSSProperties} newStyle {en} New style with browser vendor prefix
*/
export function getStyleWithVendor(style: CSSProperties): CSSProperties {
const allowReg = /(transform|transition|animation)/i;
Expand Down
17 changes: 1 addition & 16 deletions packages/common-widgets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions packages/common-widgets/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export * from './validator';
* @desc {en} Add the unit of px to the number, and return it directly if there is a unit.
* @param {number | string} value 需要设置的值
* @param {number | string} value {en} The value that needs to be set
* @return {string} 返回带有单位的值
* @return {string} {en} Returns a value with units
* @returns {string} 返回带有单位的值
* @returns {string} {en} Returns a value with units
*/
export function handleUnit(value: number | string) {
return typeof value === 'number' || !isNaN(Number(value)) ? `${value}px` : value;
Expand All @@ -34,8 +34,8 @@ export function handleUnit(value: number | string) {
* @param {Function} filterFn {en} filter function
* @param {Object} options 可选对象
* @param {Object} options {en} Optional object
* @return {string} 过滤后的数组
* @return {string} filtered array
* @returns {string} 过滤后的数组
* @returns {string} filtered array
*/
export function arrayTreeFilter<T>(
data: T[],
Expand Down Expand Up @@ -77,8 +77,8 @@ export function arrayTreeFilter<T>(
* @param {number} amountOfChange {en} coefficient of variation
* @param {number} duration 持续时间
* @param {number} duration {en} duration
* @return {number} 返回在给定时间内根据缓动函数计算得到的新值
* @return {number} {en} Returns the new value calculated from the easing function within the given time
* @returns {number} 返回在给定时间内根据缓动函数计算得到的新值
* @returns {number} {en} Returns the new value calculated from the easing function within the given time
*/
export function easeOutCubic(
elapsed: number,
Expand Down Expand Up @@ -109,8 +109,8 @@ export function nextTick(func: () => void) {
* @param {number} x {en} element displacement
* @param {[number, number] | number} damping 阻尼参数
* @param {[number, number] | number} damping {en} Damping parameters
* @return {number} 返回需要滑动的距离
* @return {number} {en} Return the distance required to slide
* @returns {number} 返回需要滑动的距离
* @returns {number} {en} Return the distance required to slide
*/
export function fingerDisToLabelDis(x: number, damping?: [number, number] | number) {
const dampArr = typeof damping === 'number' ? [damping] : damping;
Expand Down
40 changes: 20 additions & 20 deletions packages/common-widgets/utils/is.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const opt = Object.prototype.toString;
* @desc {en} Whether it is an array
* @param {any} obj 入参
* @param {any} obj {en} Entering
* @return {boolean} 返回是否为数组类型
* @return {boolean} {en} Returns whether it is an array type
* @returns {boolean} 返回是否为数组类型
* @returns {boolean} {en} Returns whether it is an array type
*/
export function isArray(obj: any): obj is any[] {
return opt.call(obj) === '[object Array]';
Expand All @@ -17,8 +17,8 @@ export function isArray(obj: any): obj is any[] {
* @desc {en} Whether it is an object
* @param {any} obj 入参
* @param {any} obj {en} Entering
* @return {boolean} 返回是否为对象类型
* @return {boolean} {en} Returns whether it is an object type
* @returns {boolean} 返回是否为对象类型
* @returns {boolean} {en} Returns whether it is an object type
*/
export function isObject(obj: any): obj is { [key: string]: any } {
return opt.call(obj) === '[object Object]';
Expand All @@ -29,8 +29,8 @@ export function isObject(obj: any): obj is { [key: string]: any } {
* @desc {en} Whether it is an string
* @param {any} obj 入参
* @param {any} obj {en} Entering
* @return {boolean} 返回是否为字符串类型
* @return {boolean} {en} Returns whether it is an string type
* @returns {boolean} 返回是否为字符串类型
* @returns {boolean} {en} Returns whether it is an string type
*/
export function isString(obj: any): obj is string {
return opt.call(obj) === '[object String]';
Expand All @@ -43,8 +43,8 @@ export function isString(obj: any): obj is string {
* @param {T} value {en} value to check
* @param {T[]} validList 有效值列表
* @param {T[]} validList {en} List of valid values
* @return {boolean} 返回要检查的值是否在有效值列表中
* @return {boolean} {en} Returns whether the value to be checked is in the list of valid values
* @returns {boolean} 返回要检查的值是否在有效值列表中
* @returns {boolean} {en} Returns whether the value to be checked is in the list of valid values
*/
export function isOneOf<T>(value: T, validList: T[]) {
return validList.indexOf(value) !== -1;
Expand All @@ -55,8 +55,8 @@ export function isOneOf<T>(value: T, validList: T[]) {
* @desc {en} Check if a value is null
* @param {any} obj 入参
* @param {any} obj {en} Entering
* @return {boolean} 返回该值是否为空值
* @return {boolean} {en} Returns whether the value is null
* @returns {boolean} 返回该值是否为空值
* @returns {boolean} {en} Returns whether the value is null
*/
export function isEmptyValue(obj: any): boolean {
return obj === undefined || obj === null || obj === '';
Expand All @@ -67,8 +67,8 @@ export function isEmptyValue(obj: any): boolean {
* @desc {en} Check if a value is function
* @param {unknown} obj 入参
* @param {unknown} obj {en} Entering
* @return {boolean} 返回该值是否为函数
* @return {boolean} {en} Returns whether the value is function
* @returns {boolean} 返回该值是否为函数
* @returns {boolean} {en} Returns whether the value is function
*/
export function isFunction(obj: unknown): boolean {
return Object.prototype.toString.call(obj).toLowerCase() === '[object function]';
Expand All @@ -79,8 +79,8 @@ export function isFunction(obj: unknown): boolean {
* @desc {en} Check if a value is null
* @param {unknown} obj 入参
* @param {unknown} obj {en} Entering
* @return {boolean} 返回该值是否为 null
* @return {boolean} {en} Returns whether the value is null
* @returns {boolean} 返回该值是否为 null
* @returns {boolean} {en} Returns whether the value is null
*/
export function isNull(obj: unknown): boolean {
return Object.prototype.toString.call(obj).toLowerCase() === '[object null]';
Expand All @@ -91,8 +91,8 @@ export function isNull(obj: unknown): boolean {
* @desc {en} Check if a value is undefined
* @param {unknown} obj 入参
* @param {unknown} obj {en} Entering
* @return {boolean} 返回该值是否为 undefined
* @return {boolean} {en} Returns whether the value is undefined
* @returns {boolean} 返回该值是否为 undefined
* @returns {boolean} {en} Returns whether the value is undefined
*/
export function isUndefined(obj: unknown): boolean {
return Object.prototype.toString.call(obj).toLowerCase() === '[object undefined]';
Expand All @@ -103,8 +103,8 @@ export function isUndefined(obj: unknown): boolean {
* @desc {en} Check if a value is an empty array
* @param {Array<unknown>} obj 入参
* @param {Array<unknown>} obj {en} Entering
* @return {boolean} 返回该值是否为空数组
* @return {boolean} {en} Returns whether the value is an empty array
* @returns {boolean} 返回该值是否为空数组
* @returns {boolean} {en} Returns whether the value is an empty array
*/
export function isEmptyArray(obj: Array<unknown>): boolean {
return isArray(obj) && !obj?.length;
Expand All @@ -117,8 +117,8 @@ export function isEmptyArray(obj: Array<unknown>): boolean {
* @param {any} obj {en} the first object to compare
* @param {any} obj 要比较的第二个对象
* @param {any} obj {en} the second object to be compared
* @return {boolean} 返回两个对象是否相等
* @return {boolean} {en} Returns whether two objects are equal
* @returns {boolean} 返回两个对象是否相等
* @returns {boolean} {en} Returns whether two objects are equal
*/
export function isDeepEqual(obj: any, sub: any): boolean {
if (typeof obj !== 'object' || typeof sub !== 'object' || obj === null || sub === null) {
Expand Down
Loading

0 comments on commit 51dce8c

Please sign in to comment.