@umituz/react-native-validation 1.3.0 → 1.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-validation",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Comprehensive validation and sanitization utilities for React Native forms",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
package/src/index.ts CHANGED
@@ -49,6 +49,7 @@ export {
49
49
  } from './infrastructure/utils/mime-types.constants';
50
50
 
51
51
  export {
52
+ getFileExtension,
52
53
  getMimeTypeFromExtension,
53
54
  getMimeTypeFromDataUrl,
54
55
  validateImageMimeType,
@@ -9,11 +9,19 @@ import {
9
9
  EXTENSION_TO_MIME_TYPE,
10
10
  } from './mime-types.constants';
11
11
 
12
+ /**
13
+ * Get file extension from URI
14
+ */
15
+ export function getFileExtension(uri: string): string | null {
16
+ const match = uri.match(/\.([a-z0-9]+)(?:\?|$)/i);
17
+ return match ? match[1].toLowerCase() : null;
18
+ }
19
+
12
20
  /**
13
21
  * Get MIME type from file extension
14
22
  */
15
23
  export function getMimeTypeFromExtension(uri: string): string | null {
16
- const extension = uri.toLowerCase().split('.').pop();
24
+ const extension = getFileExtension(uri);
17
25
  if (!extension) {
18
26
  return null;
19
27
  }