Skip to content

Commit f6e6138

Browse files
committed
add js doc
1 parent 3275984 commit f6e6138

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

geonode_mapstore_client/client/js/plugins/CreateDataset/utils/CreateDatasetUtils.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,31 @@ export const DEFAULT_ATTRIBUTE = {
3535
attributes: []
3636
};
3737

38+
/**
39+
* Parse a number string to a number
40+
* @param {string} value - The value to parse
41+
* @returns {number} The parsed number
42+
*/
3843
export const parseNumber = (value) => {
3944
if (value === '') {
4045
return null;
4146
}
4247
return parseFloat(value);
4348
};
4449

50+
/**
51+
* Get the attribute control id
52+
* @param {Object} data - The data to get the attribute control id from
53+
* @param {string} suffix - The suffix to add to the attribute control id
54+
* @returns {string} The attribute control id
55+
*/
4556
export const getAttributeControlId = (data, suffix) =>
4657
`attribute-${data?.id ?? ''}-${suffix}`;
4758

59+
/**
60+
* The JSON schema for the dataset
61+
* @type {Object}
62+
*/
4863
export const validateSchema = {
4964
"type": "object",
5065
"properties": {

0 commit comments

Comments
 (0)