/*! * @gameworker/jst v0.1.5 * https://github.com/gameworker/jst.git * Copyright (c) 2017 gameworker * Licensed MIT */ var JST={};!function(_jst){_jst.isNode=function(){return"undefined"!=typeof global&&"[object global]"==={}.toString.call(global)},_jst.isBrowser=function(){return"undefined"!=typeof window&&"[object Window]"==={}.toString.call(window)},_jst.isOnline=function(_host,_callback){return this.isNode()?_host&&_callback?void require("dns").resolve(_host,function(err){err?(console.warn("JST.isOnline() : false -> No connection to "+_host),_callback.call(this,!1)):(console.log("JST.isOnline() : true -> "+_host,"is reachable."),_callback.call(this,!0))}):(console.warn("isOnline() needs host parameter and a callback function to pass true/false in Node.js environment!"),!1):window.navigator.onLine},Object.freeze(_jst)}(JST||{});