/**
 * Created by meathill on 14/11/5.
 */

'use strict';

function compile(msg, extra) {
  return msg.replace(/{{(\w+)}}/g, function (match, key) {
    return extra[key];
  })
}

function isString(obj) {
  return Object.prototype.toString.call(obj) === '[object String]';
}

function createReg(accept) {
  accept = accept.replace(/,\s*/g, '|'); // 多个扩展名适配
  return new RegExp(accept.replace(/\*/g, '(.*)'), 'i');
}