function gatherInformation() {
  var prefixProperties = { };
  browsers.forEach(function(browser) {
    prefixProperties[browser] = { };
  })

  var search;
  for (search in searchMap) {
    var properties = searchMap[search];
    var versions = caniuse.getSupport(search, true);
    if (properties instanceof Array !== true) {
      properties = [ properties ];
    }
    properties.forEach(function(prop) {
      var prefix;
      for (prefix in prefixProperties) {
        if (versions[prefix].x >= browserConfig[prefix]) {
          prefixProperties[prefix][prop] = versions[prefix].x;
        }
      }
    })
  }

  // remove flexprops from IE
  var flexPropsIE = [ 'alignContent', 'alignSelf', 'alignItems', 'justifyContent', 'order', 'flexGrow', 'flexShrink', 'flexBasis' ];

  prefixProperties.ie = assign({ }, prefixProperties.ie, prefixProperties.ie_mob);
  delete prefixProperties.ie_mob;
  flexPropsIE.forEach(function(prop) {
    delete prefixProperties.ie[prop]
  })
  return 'export default ' + JSON.stringify(prefixProperties);
}
Beispiel #2
0
    function (session, results) {

        var res = caniuse.getSupport(results.response.entity, true);

        // Can I useの結果を表示
        //        console.log(res);
        session.endDialog(result_format(session, results.response.entity, res));

}]);
  Object.keys(searchMap).forEach(searchKey => {
    const versions = caniuse.getSupport(searchKey, true)
    const properties = [ ].concat(searchMap[searchKey])

    properties.forEach(prop => {
      if (versions[browser].x >= config[browser]) {
        out[prefix].add(prop)
      }
    })
  })
Beispiel #4
0
    function (session) {

        // クエリーを成型
        var query = session.message.text.replace(/^@\w+:\s+/, "").replace(/\s/g, "");

        // クエリーの文字数が3字以下ならばエラー
        if(query.length < 3){
            session.endDialog("Plz enter more than 3 characters! XP");
        }

        // 検索して候補を取得
        console.log(session.message.text);
        var search_res = caniuse.find(query); // ヒット数が複数or0の場合、配列が。1つだけヒットの場合、文字型が返される。

        console.log(search_res);
        console.log(Array.isArray(search_res));
        console.log("\nlengh:" + search_res.length);

        //debug用
        //session.send("query:"+query + ", search_res:"+search_res );

        // 候補の数を調べる
        if (Array.isArray(search_res) === false) {

            // ****候補が1つだけの時****

            // Can I useの結果を表示
            var res = caniuse.getSupport(query, true);
            session.endDialog(result_format(session, query, res));


        } else if (search_res.length >= 2) {

            // ****候補が複数ある時****

            // 候補を表示。選択肢を提示
            //            console.log(search_res);
            builder.Prompts.choice(session, "pick one.", search_res);

        } else {

            // ****候補が0の時****

            // 見つかりませんでした... XP
            session.endDialog("sorry, not found... XP");

        }

},
Beispiel #5
0
function SendInfoToUser(prop){
    var support = caniuse.getSupport(prop, true);

    var result_text = "Browser Support information:\n";

  for (var key in support) {
      if (support.hasOwnProperty(key)) {

          if( 'y' in support[key] ){
              result_text += browser[key] + ": >= " + support[key].y +"\n";
          }else if( 'a' in support[key] ){
              result_text += browser[key] + ": " + support[key].a +" (with partial support)\n";
          }

      }
  }

    PostToUser(result_text);
}
function gatherInformation() {
  var supportData = { };
  var search;
  for (search in searchMap) {
    var properties = searchMap[search];
    var versions = caniuse.getSupport(search, true);
    if (properties instanceof Array !== true) {
      properties = [ properties ];
    }
    properties.forEach(function(prop) {
      if (!supportData[prop]) {
        supportData[prop] = { }
      }
      var browser;
      for (browser in versions) {
        supportData[prop][browser] = versions[browser].n || 0
      }
    })
  }
  return 'var partialSupport = ' + JSON.stringify(supportData) + '; module.exports = partialSupport';
}
Beispiel #7
0
 supportCall() {
   return caniuse.getSupport(this.name);
 }