ebaoferc 0.3.2 → 0.3.3-beta.1

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.
@@ -54,9 +54,7 @@ export default function FlexRowCol(props) {
54
54
  });
55
55
  var count = 0;
56
56
  // 处理子元素,计算 hidden 属性
57
- var processedChildren = Children.toArray(children).filter(function (child) {
58
- return /*#__PURE__*/isValidElement(child);
59
- }).map(function (child, index) {
57
+ var processedChildren = Children.toArray(children).map(function (child, index) {
60
58
  if (! /*#__PURE__*/isValidElement(child) || child.props.hidden) return child;
61
59
  count++;
62
60
  var childColProps = child.props.colProps || _colProps;
@@ -0,0 +1 @@
1
+ export declare const validateFileType: (fileName: string, accept: string) => boolean;
@@ -0,0 +1,15 @@
1
+ export var validateFileType = function validateFileType(fileName, accept) {
2
+ var _fileName$split$pop;
3
+ if (!accept) return true;
4
+
5
+ // 获取文件扩展名(转换为小写)
6
+ var fileExtension = (_fileName$split$pop = fileName.split('.').pop()) === null || _fileName$split$pop === void 0 ? void 0 : _fileName$split$pop.toLowerCase();
7
+
8
+ // 将 accept 字符串转换为数组,并处理每个扩展名(转换为小写)
9
+ var acceptedTypes = accept.split(',').map(function (type) {
10
+ return type.trim().toLowerCase().replace('.', '');
11
+ });
12
+
13
+ // 检查文件扩展名是否在接受的类型列表中
14
+ return acceptedTypes.includes(fileExtension);
15
+ };
@@ -1 +1,2 @@
1
1
  export * from './download';
2
+ export * from './file-upload';
@@ -1 +1,2 @@
1
- export * from "./download";
1
+ export * from "./download";
2
+ export * from "./file-upload";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ebaoferc",
3
- "version": "0.3.2",
3
+ "version": "0.3.3-beta.1",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",