Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
19 lines
567 B
Plaintext
19 lines
567 B
Plaintext
import { deepCopyObjectSimple } from '../utilities/deepCopyObject.js';
|
|
export const getDefaultValue = async ({ defaultValue, locale, req, user, value })=>{
|
|
if (typeof value !== 'undefined') {
|
|
return value;
|
|
}
|
|
if (defaultValue && typeof defaultValue === 'function') {
|
|
return await defaultValue({
|
|
locale,
|
|
req,
|
|
user
|
|
});
|
|
}
|
|
if (typeof defaultValue === 'object') {
|
|
return deepCopyObjectSimple(defaultValue);
|
|
}
|
|
return defaultValue;
|
|
};
|
|
|
|
//# sourceMappingURL=getDefaultValue.js.map |