UNPKG

@aplus-frontend/ui

Version:

2 lines (1 loc) 1.02 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../interface.js");function p(y,e){if(y===!0){if(typeof e=="string")return[{path:e,fileName:e}];if(Array.isArray(e))return e.map(t=>({path:t?.[r.ApNeedNameKeyDefault.pathKey]??t,fileName:t?.[r.ApNeedNameKeyDefault.nameKey]??t}));if(typeof e=="object")return[{path:e?.[r.ApNeedNameKeyDefault.pathKey],fileName:e?.[r.ApNeedNameKeyDefault.nameKey]}]}else if(typeof y=="object"){if(typeof e=="string")return[{path:e,fileName:e}];if(Array.isArray(e))return e.map(t=>({path:t?.[y?.pathKey||r.ApNeedNameKeyDefault.pathKey]??t,fileName:t?.[y?.nameKey||r.ApNeedNameKeyDefault.nameKey]??t}));if(typeof e=="object")return[{path:e?.[y?.pathKey||r.ApNeedNameKeyDefault.pathKey],fileName:e?.[y?.nameKey||r.ApNeedNameKeyDefault.nameKey]}]}else{if(typeof e=="string")return[{path:e,fileName:e}];if(Array.isArray(e))return e.map(t=>typeof t=="string"?{path:t,fileName:t}:t);if(typeof e=="object")return[e]}return[]}exports.getFileInfo=p;