@amplitude/analytics-client-common 2.2.2 → 2.2.3
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/lib/cjs/global-scope.d.ts.map +1 -1
- package/lib/cjs/global-scope.js +6 -0
- package/lib/cjs/global-scope.js.map +1 -1
- package/lib/cjs/types/global.d.ts +2 -0
- package/lib/cjs/types/global.d.ts.map +1 -0
- package/lib/cjs/types/global.js +3 -0
- package/lib/cjs/types/global.js.map +1 -0
- package/lib/esm/global-scope.d.ts.map +1 -1
- package/lib/esm/global-scope.js +6 -0
- package/lib/esm/global-scope.js.map +1 -1
- package/lib/esm/types/global.d.ts +2 -0
- package/lib/esm/types/global.d.ts.map +1 -0
- package/lib/esm/types/global.js +4 -0
- package/lib/esm/types/global.js.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-scope.d.ts","sourceRoot":"","sources":["../../src/global-scope.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,QAAO,iBAAiB,GAAG,
|
|
1
|
+
{"version":3,"file":"global-scope.d.ts","sourceRoot":"","sources":["../../src/global-scope.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,QAAO,iBAAiB,GAAG,SAoBrD,CAAC"}
|
package/lib/cjs/global-scope.js
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.getGlobalScope = void 0;
|
|
5
5
|
var getGlobalScope = function () {
|
|
6
|
+
// This should only be used for integrations with Amplitude that are not running in a browser environment
|
|
7
|
+
// We need to specify the name of the global variable as a string to prevent it from being minified
|
|
8
|
+
var ampIntegrationContextName = 'ampIntegrationContext';
|
|
9
|
+
if (typeof globalThis !== 'undefined' && typeof globalThis[ampIntegrationContextName] !== 'undefined') {
|
|
10
|
+
return globalThis[ampIntegrationContextName];
|
|
11
|
+
}
|
|
6
12
|
if (typeof globalThis !== 'undefined') {
|
|
7
13
|
return globalThis;
|
|
8
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-scope.js","sourceRoot":"","sources":["../../src/global-scope.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,6DAA6D;;;AAEtD,IAAM,cAAc,GAAG;IAC5B,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE;QACrC,OAAO,UAAU,CAAC;KACnB;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAC/B,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"global-scope.js","sourceRoot":"","sources":["../../src/global-scope.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,6DAA6D;;;AAEtD,IAAM,cAAc,GAAG;IAC5B,yGAAyG;IACzG,qGAAqG;IACrG,IAAM,yBAAyB,GAAG,uBAAkD,CAAC;IACrF,IAAI,OAAO,UAAU,KAAK,WAAW,IAAI,OAAO,UAAU,CAAC,yBAAyB,CAAC,KAAK,WAAW,EAAE;QACrG,OAAO,UAAU,CAAC,yBAAyB,CAAsB,CAAC;KACnE;IACD,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE;QACrC,OAAO,UAAU,CAAC;KACnB;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAC/B,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AApBW,QAAA,cAAc,kBAoBzB","sourcesContent":["/* eslint-disable no-restricted-globals */\n/* Only file allowed to access to globalThis, window, self */\n\nexport const getGlobalScope = (): typeof globalThis | undefined => {\n // This should only be used for integrations with Amplitude that are not running in a browser environment\n // We need to specify the name of the global variable as a string to prevent it from being minified\n const ampIntegrationContextName = 'ampIntegrationContext' as keyof typeof globalThis;\n if (typeof globalThis !== 'undefined' && typeof globalThis[ampIntegrationContextName] !== 'undefined') {\n return globalThis[ampIntegrationContextName] as typeof globalThis;\n }\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n return undefined;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/types/global.ts"],"names":[],"mappings":"AAEA,eAAO,IAAI,qBAAqB,EAAE,OAAO,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.js","sourceRoot":"","sources":["../../../src/types/global.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable no-restricted-globals */\n// eslint-disable-next-line no-var\nexport var ampIntegrationContext: typeof globalThis;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-scope.d.ts","sourceRoot":"","sources":["../../src/global-scope.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,QAAO,iBAAiB,GAAG,
|
|
1
|
+
{"version":3,"file":"global-scope.d.ts","sourceRoot":"","sources":["../../src/global-scope.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,QAAO,iBAAiB,GAAG,SAoBrD,CAAC"}
|
package/lib/esm/global-scope.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/* eslint-disable no-restricted-globals */
|
|
2
2
|
/* Only file allowed to access to globalThis, window, self */
|
|
3
3
|
export var getGlobalScope = function () {
|
|
4
|
+
// This should only be used for integrations with Amplitude that are not running in a browser environment
|
|
5
|
+
// We need to specify the name of the global variable as a string to prevent it from being minified
|
|
6
|
+
var ampIntegrationContextName = 'ampIntegrationContext';
|
|
7
|
+
if (typeof globalThis !== 'undefined' && typeof globalThis[ampIntegrationContextName] !== 'undefined') {
|
|
8
|
+
return globalThis[ampIntegrationContextName];
|
|
9
|
+
}
|
|
4
10
|
if (typeof globalThis !== 'undefined') {
|
|
5
11
|
return globalThis;
|
|
6
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-scope.js","sourceRoot":"","sources":["../../src/global-scope.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,6DAA6D;AAE7D,MAAM,CAAC,IAAM,cAAc,GAAG;IAC5B,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE;QACrC,OAAO,UAAU,CAAC;KACnB;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAC/B,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["/* eslint-disable no-restricted-globals */\n/* Only file allowed to access to globalThis, window, self */\n\nexport const getGlobalScope = (): typeof globalThis | undefined => {\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n return undefined;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"global-scope.js","sourceRoot":"","sources":["../../src/global-scope.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,6DAA6D;AAE7D,MAAM,CAAC,IAAM,cAAc,GAAG;IAC5B,yGAAyG;IACzG,qGAAqG;IACrG,IAAM,yBAAyB,GAAG,uBAAkD,CAAC;IACrF,IAAI,OAAO,UAAU,KAAK,WAAW,IAAI,OAAO,UAAU,CAAC,yBAAyB,CAAC,KAAK,WAAW,EAAE;QACrG,OAAO,UAAU,CAAC,yBAAyB,CAAsB,CAAC;KACnE;IACD,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE;QACrC,OAAO,UAAU,CAAC;KACnB;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAC/B,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["/* eslint-disable no-restricted-globals */\n/* Only file allowed to access to globalThis, window, self */\n\nexport const getGlobalScope = (): typeof globalThis | undefined => {\n // This should only be used for integrations with Amplitude that are not running in a browser environment\n // We need to specify the name of the global variable as a string to prevent it from being minified\n const ampIntegrationContextName = 'ampIntegrationContext' as keyof typeof globalThis;\n if (typeof globalThis !== 'undefined' && typeof globalThis[ampIntegrationContextName] !== 'undefined') {\n return globalThis[ampIntegrationContextName] as typeof globalThis;\n }\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n return undefined;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/types/global.ts"],"names":[],"mappings":"AAEA,eAAO,IAAI,qBAAqB,EAAE,OAAO,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.js","sourceRoot":"","sources":["../../../src/types/global.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,kCAAkC;AAClC,MAAM,CAAC,IAAI,qBAAwC,CAAC","sourcesContent":["/* eslint-disable no-restricted-globals */\n// eslint-disable-next-line no-var\nexport var ampIntegrationContext: typeof globalThis;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amplitude/analytics-client-common",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Amplitude Inc",
|
|
6
6
|
"homepage": "https://github.com/amplitude/Amplitude-TypeScript",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"files": [
|
|
44
44
|
"lib"
|
|
45
45
|
],
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "58f78b288db20dec13ef0c4381d14916ad4d4811"
|
|
47
47
|
}
|