build: update CI

This commit is contained in:
Qiuxia Fan
2021-12-21 14:56:38 +08:00
parent cccab0f5fb
commit 48037cb290
2 changed files with 7 additions and 3 deletions

View File

@@ -14,14 +14,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const requireComponent = require.context('../../assets', false, /\.png$/);
const requireComponent = require.context("../../assets", false, /\.png$/);
const result = {};
function capitalizeFirstLetter(str) {
return str.toUpperCase();
}
function validateFileName(str) {
return /^\S+\.png$/.test(str) && str.replace(/^\S+\/(\w+)\.png$/, (rs, $1) => capitalizeFirstLetter($1));
return (
/^\S+\.png$/.test(str) &&
str.replace(/^\S+\/(\w+)\.png$/, (rs, $1) => capitalizeFirstLetter($1))
);
}
requireComponent.keys().forEach((filePath) => {
const componentConfig = requireComponent(filePath);