@gx-design-vue/pro-utils 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +25 -1
- package/dist/index.js +26 -0
- package/dist/utils/index.d.ts +14 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2561,6 +2561,30 @@ function getRandomNumber() {
|
|
|
2561
2561
|
}
|
|
2562
2562
|
};
|
|
2563
2563
|
}
|
|
2564
|
+
/**
|
|
2565
|
+
* @Author gaoxiang
|
|
2566
|
+
* @DateTime 2020/11/13
|
|
2567
|
+
* @lastTime 2020/11/13
|
|
2568
|
+
* @description 截取视频时间戳
|
|
2569
|
+
*/
|
|
2570
|
+
function getVideoFileUrl(url = '') {
|
|
2571
|
+
const index = url.indexOf('?');
|
|
2572
|
+
return index > 0 ? `${url.substring(0, index)}` : url;
|
|
2573
|
+
}
|
|
2574
|
+
/**
|
|
2575
|
+
* @Author gaoxiang
|
|
2576
|
+
* @DateTime 2020/11/13
|
|
2577
|
+
* @lastTime 2020/11/13
|
|
2578
|
+
* @description 获取文件后缀名
|
|
2579
|
+
*/
|
|
2580
|
+
function getFileSuffix(url = '') {
|
|
2581
|
+
url = getVideoFileUrl(url);
|
|
2582
|
+
const index = url.lastIndexOf('.');
|
|
2583
|
+
return index > 0 ?
|
|
2584
|
+
`${url.substring(index).split('?')[0]}`.split('.')[1]
|
|
2585
|
+
:
|
|
2586
|
+
'';
|
|
2587
|
+
}
|
|
2564
2588
|
|
|
2565
2589
|
const toString = Object.prototype.toString;
|
|
2566
2590
|
const noop = () => { };
|
|
@@ -2607,4 +2631,4 @@ function isFunction(func) {
|
|
|
2607
2631
|
return (typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]');
|
|
2608
2632
|
}
|
|
2609
2633
|
|
|
2610
|
-
export { arrayRepeat, compareToMax, deepCopy, genColumnKey, getRandomNumber, getSortIndex, handleCurrentPage, handleFormDefaultValue, handleShowIndex, hanndleField, is, isArray, isBoolean, isFunction, isNumber, isObject, isString, noop, runFunction };
|
|
2634
|
+
export { arrayRepeat, compareToMax, deepCopy, genColumnKey, getFileSuffix, getRandomNumber, getSortIndex, getVideoFileUrl, handleCurrentPage, handleFormDefaultValue, handleShowIndex, hanndleField, is, isArray, isBoolean, isFunction, isNumber, isObject, isString, noop, runFunction };
|
package/dist/index.js
CHANGED
|
@@ -2565,6 +2565,30 @@ function getRandomNumber() {
|
|
|
2565
2565
|
}
|
|
2566
2566
|
};
|
|
2567
2567
|
}
|
|
2568
|
+
/**
|
|
2569
|
+
* @Author gaoxiang
|
|
2570
|
+
* @DateTime 2020/11/13
|
|
2571
|
+
* @lastTime 2020/11/13
|
|
2572
|
+
* @description 截取视频时间戳
|
|
2573
|
+
*/
|
|
2574
|
+
function getVideoFileUrl(url = '') {
|
|
2575
|
+
const index = url.indexOf('?');
|
|
2576
|
+
return index > 0 ? `${url.substring(0, index)}` : url;
|
|
2577
|
+
}
|
|
2578
|
+
/**
|
|
2579
|
+
* @Author gaoxiang
|
|
2580
|
+
* @DateTime 2020/11/13
|
|
2581
|
+
* @lastTime 2020/11/13
|
|
2582
|
+
* @description 获取文件后缀名
|
|
2583
|
+
*/
|
|
2584
|
+
function getFileSuffix(url = '') {
|
|
2585
|
+
url = getVideoFileUrl(url);
|
|
2586
|
+
const index = url.lastIndexOf('.');
|
|
2587
|
+
return index > 0 ?
|
|
2588
|
+
`${url.substring(index).split('?')[0]}`.split('.')[1]
|
|
2589
|
+
:
|
|
2590
|
+
'';
|
|
2591
|
+
}
|
|
2568
2592
|
|
|
2569
2593
|
const toString = Object.prototype.toString;
|
|
2570
2594
|
const noop = () => { };
|
|
@@ -2615,8 +2639,10 @@ exports.arrayRepeat = arrayRepeat;
|
|
|
2615
2639
|
exports.compareToMax = compareToMax;
|
|
2616
2640
|
exports.deepCopy = deepCopy;
|
|
2617
2641
|
exports.genColumnKey = genColumnKey;
|
|
2642
|
+
exports.getFileSuffix = getFileSuffix;
|
|
2618
2643
|
exports.getRandomNumber = getRandomNumber;
|
|
2619
2644
|
exports.getSortIndex = getSortIndex;
|
|
2645
|
+
exports.getVideoFileUrl = getVideoFileUrl;
|
|
2620
2646
|
exports.handleCurrentPage = handleCurrentPage;
|
|
2621
2647
|
exports.handleFormDefaultValue = handleFormDefaultValue;
|
|
2622
2648
|
exports.handleShowIndex = handleShowIndex;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -77,3 +77,17 @@ export declare function getRandomNumber(): {
|
|
|
77
77
|
uuidString(): string;
|
|
78
78
|
uuidCompact(): string;
|
|
79
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
* @Author gaoxiang
|
|
82
|
+
* @DateTime 2020/11/13
|
|
83
|
+
* @lastTime 2020/11/13
|
|
84
|
+
* @description 截取视频时间戳
|
|
85
|
+
*/
|
|
86
|
+
export declare function getVideoFileUrl(url?: string): string;
|
|
87
|
+
/**
|
|
88
|
+
* @Author gaoxiang
|
|
89
|
+
* @DateTime 2020/11/13
|
|
90
|
+
* @lastTime 2020/11/13
|
|
91
|
+
* @description 获取文件后缀名
|
|
92
|
+
*/
|
|
93
|
+
export declare function getFileSuffix(url?: string): string;
|