@hudiemon/utils
Advanced tools
| declare const toFormData: (collection?: Record<string, any>) => Record<string, any>; | ||
| export default toFormData; |
| import { isNumber, reduce, toString } from 'lodash-es'; | ||
| var toFormData = function toFormData(collection) { | ||
| return reduce(collection, function (result, value, key) { | ||
| if (value === '') { | ||
| result[key] = undefined; | ||
| } else if (isNumber(value)) { | ||
| result[key] = toString(value); | ||
| } else { | ||
| result[key] = value; | ||
| } | ||
| return result; | ||
| }, {}); | ||
| }; | ||
| export default toFormData; |
+1
-1
@@ -5,3 +5,2 @@ export { default as BigNumber } from './BigNumber'; | ||
| export { default as fen2yuan } from './fen2yuan'; | ||
| export { default as formDataFormat } from './formDataFormat'; | ||
| export { default as isDev } from './isDev'; | ||
@@ -14,2 +13,3 @@ export { default as isPromise } from './isPromise'; | ||
| export { default as sleep } from './sleep'; | ||
| export { default as toFormData } from './toFormData'; | ||
| export { default as toTreeData } from './toTreeData'; | ||
@@ -16,0 +16,0 @@ export { default as tryFunction } from './tryFunction'; |
+1
-1
@@ -5,3 +5,2 @@ export { default as BigNumber } from "./BigNumber"; | ||
| export { default as fen2yuan } from "./fen2yuan"; | ||
| export { default as formDataFormat } from "./formDataFormat"; | ||
| export { default as isDev } from "./isDev"; | ||
@@ -14,2 +13,3 @@ export { default as isPromise } from "./isPromise"; | ||
| export { default as sleep } from "./sleep"; | ||
| export { default as toFormData } from "./toFormData"; | ||
| export { default as toTreeData } from "./toTreeData"; | ||
@@ -16,0 +16,0 @@ export { default as tryFunction } from "./tryFunction"; |
+1
-1
| { | ||
| "name": "@hudiemon/utils", | ||
| "version": "1.0.21", | ||
| "version": "1.0.22", | ||
| "description": "A react library developed with dumi", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
| declare const formDataFormat: (collection?: Record<string, any>) => Record<string, any>; | ||
| export default formDataFormat; |
| import { isNumber, reduce, toString } from 'lodash-es'; | ||
| var formDataFormat = function formDataFormat(collection) { | ||
| return reduce(collection, function (result, value, key) { | ||
| if (value === '') { | ||
| result[key] = undefined; | ||
| } else if (isNumber(value)) { | ||
| result[key] = toString(value); | ||
| } else { | ||
| result[key] = value; | ||
| } | ||
| return result; | ||
| }, {}); | ||
| }; | ||
| export default formDataFormat; |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
57568
-0.06%