File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,12 @@ import isEmpty from 'lodash/isEmpty';
1010import isFunction from 'lodash/isFunction' ;
1111
1212/**
13- * Returns the object from the JSON-schema node using the key.
14- *
13+ * Shorthand to lookup for keys with `x-jsf-*` preffix.
1514 * @param {Object } node - JSON-schema node
16- * @param {String } key - JSON-schema key name
15+ * @param {"presentation"|"errorMessage" } key - JSON-schema key name
16+ * @example
17+ * pickKey(properties, 'presentation')
18+ * is the same as properties["x-jsf-presentation"]
1719 * @returns {Object }
1820 */
1921export function pickXKey ( node , key ) {
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { convertDiskSizeFromTo } from './utils';
88
99/**
1010 * @typedef {import('./createHeadlessForm').FieldParameters } FieldParameters
11+ * @typedef {import('../createHeadlessForm').JsfConfig } JsfConfig
1112 */
1213
1314export const DEFAULT_DATE_FORMAT = 'yyyy-MM-dd' ;
@@ -297,6 +298,14 @@ function getSchema(fields = [], config) {
297298 return newSchema ;
298299}
299300
301+ /**
302+ * Returns the Yup schema structure of given fields.
303+ * These fields must be the same from
304+ * const { fields } = createHeadlessForm()
305+ * @param {Fields[] } fields - List of fields
306+ * @param {JsfConfig } config - Config
307+ * @returns
308+ */
300309export function buildCompleteYupSchema ( fields , config ) {
301310 return object ( ) . shape ( getSchema ( fields , config ) , getNoSortEdges ( fields ) ) ;
302311}
You can’t perform that action at this time.
0 commit comments