@screeb/sdk-browser 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/index.d.ts +1 -1
- package/dist/es/index.js +4 -4
- package/docs/README.md +2 -2
- package/package.json +1 -1
package/dist/es/index.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export declare const init: (websiteId: string, userId?: string, userProperties?:
|
|
|
63
63
|
* console.log(Screeb.isLoaded()); // true
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
|
-
export declare const isLoaded: () => boolean;
|
|
66
|
+
export declare const isLoaded: () => boolean | undefined;
|
|
67
67
|
/**
|
|
68
68
|
* Shutdowns current Screeb session.
|
|
69
69
|
*
|
package/dist/es/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var SCREEB_TAG_ENDPOINT = "https://t.screeb.app/tag.js";
|
|
2
|
-
var _window = window;
|
|
2
|
+
var _window = typeof window === "undefined" ? undefined : window;
|
|
3
3
|
var callScreebCommand = function () {
|
|
4
4
|
var args = [];
|
|
5
5
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6
6
|
args[_i] = arguments[_i];
|
|
7
7
|
}
|
|
8
|
-
if (_window.$screeb) {
|
|
8
|
+
if (_window === null || _window === void 0 ? void 0 : _window.$screeb) {
|
|
9
9
|
return _window.$screeb.apply(_window.$screeb, args);
|
|
10
10
|
}
|
|
11
11
|
return Promise.reject("[Screeb] Screeb.load() must be called before any other function.");
|
|
@@ -42,7 +42,7 @@ var load = function (options) {
|
|
|
42
42
|
}
|
|
43
43
|
return new Promise(function (a, b) {
|
|
44
44
|
var _a;
|
|
45
|
-
if (_window.$screeb) {
|
|
45
|
+
if (_window === null || _window === void 0 ? void 0 : _window.$screeb) {
|
|
46
46
|
return (_window.$screeb.q = (_a = _window.$screeb.q) !== null && _a !== void 0 ? _a : []).push({
|
|
47
47
|
args: args,
|
|
48
48
|
ko: b,
|
|
@@ -117,7 +117,7 @@ var init = function (websiteId, userId, userProperties, hooks) {
|
|
|
117
117
|
* ```
|
|
118
118
|
*/
|
|
119
119
|
var isLoaded = function () {
|
|
120
|
-
return
|
|
120
|
+
return (_window === null || _window === void 0 ? void 0 : _window.$screeb) && typeof _window.$screeb === "function";
|
|
121
121
|
};
|
|
122
122
|
/**
|
|
123
123
|
* Shutdowns current Screeb session.
|
package/docs/README.md
CHANGED
|
@@ -477,13 +477,13 @@ ___
|
|
|
477
477
|
|
|
478
478
|
### isLoaded
|
|
479
479
|
|
|
480
|
-
▸ **isLoaded**(): `boolean`
|
|
480
|
+
▸ **isLoaded**(): `undefined` \| `boolean`
|
|
481
481
|
|
|
482
482
|
Checks if Screeb tag has been loaded.
|
|
483
483
|
|
|
484
484
|
#### Returns
|
|
485
485
|
|
|
486
|
-
`boolean`
|
|
486
|
+
`undefined` \| `boolean`
|
|
487
487
|
|
|
488
488
|
**`Example`**
|
|
489
489
|
|