UNPKG

chameleon-linter

Version:

cml规范校验工具

14 lines (13 loc) 266 B
module.exports.flatArray = function(arr) { let tempArr = []; if (Array.isArray(arr)) { arr.forEach((item) => { if (Array.isArray(item)) { tempArr.push(...item); } else { tempArr.push(item); } }); } return tempArr; }