UNPKG

kdesign-ui

Version:

kd is from company of klx, it provide quickly genarator company inner business front structure

23 lines (22 loc) 805 B
#!/usr/bin/env node "use strict"; var semver = require('semver'); var chalk = require('chalk'); module.exports = { checkVersion: function (wanted) { if (semver.lt(process.version, wanted)) { console.log(chalk.red('您所用的Node版本为:' + process.version + ', kd脚手架需要Node' + wanted + '.\n请切换Node版本,或者更新Node版本')); process.exit(1); } }, isPrimitive: function (value) { return (typeof value === 'string' || typeof value === 'number' || // $flow-disable-line typeof value === 'symbol' || typeof value === 'boolean'); }, getType: function (sup) { return (sup.toString().match(/function\s*(\w+)\s*\(\)/) || [])[1]; } };