From ee4e0b76269076cd0f566713d0f6b3419ff47a39 Mon Sep 17 00:00:00 2001 From: Ricardo Devis Agullo Date: Wed, 3 May 2023 15:20:18 +0200 Subject: [PATCH] support script type=module imports --- src/oc-client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/oc-client.js b/src/oc-client.js index 8c0c880..27a9934 100644 --- a/src/oc-client.js +++ b/src/oc-client.js @@ -1,8 +1,8 @@ -/* globals define, exports, require */ +/* globals define, exports, require, globalThis */ /* eslint no-var: 'off' */ /* eslint prefer-arrow-callback: 'off' */ -var oc = oc || {}; +var oc = typeof globalThis !== 'undefined' ? globalThis.oc || {} : oc || {}; (function (root, factory) { 'use strict'; @@ -22,7 +22,7 @@ var oc = oc || {}; // Browser globals factory((root.oc = oc), root.$, root.ljs, root.document, root.window); } -})(this, function (exports, $, ljs, $document, $window) { +})(this || globalThis, function (exports, $, ljs, $document, $window) { 'use strict'; // jshint ignore:line // public variables