Skip to content

Commit

Permalink
Add commonJS support. Fix jshint warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuLoutre committed Apr 13, 2014
1 parent c37cf3b commit 9e84e00
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lscache.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
* limitations under the License.
*/

/*jshint undef:true, browser:true */
/*global define */
/* jshint undef:true, browser:true, node:true */
/* global define */

(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof module !== "undefined" && module.exports) {
// CommonJS/Node module
module.exports = factory();
} else {
// Browser globals
root.lscache = factory();
Expand Down Expand Up @@ -117,7 +120,7 @@

function warn(message, err) {
if (!warnings) return;
if (!'console' in window || typeof window.console.warn !== 'function') return;
if (!('console' in window) || typeof window.console.warn !== 'function') return;
window.console.warn("lscache - " + message);
if (err) window.console.warn("lscache - The error was: " + err.message);
}
Expand Down

0 comments on commit 9e84e00

Please sign in to comment.