@datadog/mobile-react-native 2.3.4 → 2.3.5
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/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
- package/ios/Sources/SdkVersion.swift +1 -1
- package/lib/commonjs/utils/time-provider/TimeProvider.js +5 -1
- package/lib/commonjs/utils/time-provider/TimeProvider.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/utils/time-provider/TimeProvider.js +5 -1
- package/lib/module/utils/time-provider/TimeProvider.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/utils/time-provider/TimeProvider.tsx +6 -1
- package/src/version.ts +1 -1
|
@@ -38,7 +38,11 @@ class TimeProvider {
|
|
|
38
38
|
now() {
|
|
39
39
|
const timestamp = this.getTimestamp();
|
|
40
40
|
|
|
41
|
-
if (timestamp.reactNative
|
|
41
|
+
if (timestamp.reactNative != null && this.baseOffset === 0) {
|
|
42
|
+
this.baseOffset = timestamp.unix - timestamp.reactNative;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (timestamp.reactNative == null || this.baseOffset === 0) {
|
|
42
46
|
return timestamp.unix;
|
|
43
47
|
} else {
|
|
44
48
|
return this.baseOffset + timestamp.reactNative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["TimeProvider.tsx"],"names":["TimeProvider","constructor","timestamp","getTimestamp","reactNative","baseOffset","unix","now"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AASA;AACA;AACA;AACA;AACO,MAAeA,YAAf,CAA4B;AAC/B;AAGAC,EAAAA,WAAW,GAAG;AAAA;;AACV,UAAMC,SAAS,GAAG,KAAKC,YAAL,EAAlB;;AACA,QAAID,SAAS,CAACE,WAAV,IAAyB,IAA7B,EAAmC;AAC/B,WAAKC,UAAL,GAAkB,CAAlB;AACH,KAFD,MAEO;AACH,WAAKA,UAAL,GAAkBH,SAAS,CAACI,IAAV,GAAiBJ,SAAS,CAACE,WAA7C;AACH;AACJ;;AAIDG,EAAAA,GAAG,GAAW;AACV,UAAML,SAAS,GAAG,KAAKC,YAAL,EAAlB;;
|
|
1
|
+
{"version":3,"sources":["TimeProvider.tsx"],"names":["TimeProvider","constructor","timestamp","getTimestamp","reactNative","baseOffset","unix","now"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AASA;AACA;AACA;AACA;AACO,MAAeA,YAAf,CAA4B;AAC/B;AAGAC,EAAAA,WAAW,GAAG;AAAA;;AACV,UAAMC,SAAS,GAAG,KAAKC,YAAL,EAAlB;;AACA,QAAID,SAAS,CAACE,WAAV,IAAyB,IAA7B,EAAmC;AAC/B,WAAKC,UAAL,GAAkB,CAAlB;AACH,KAFD,MAEO;AACH,WAAKA,UAAL,GAAkBH,SAAS,CAACI,IAAV,GAAiBJ,SAAS,CAACE,WAA7C;AACH;AACJ;;AAIDG,EAAAA,GAAG,GAAW;AACV,UAAML,SAAS,GAAG,KAAKC,YAAL,EAAlB;;AAEA,QAAID,SAAS,CAACE,WAAV,IAAyB,IAAzB,IAAiC,KAAKC,UAAL,KAAoB,CAAzD,EAA4D;AACxD,WAAKA,UAAL,GAAkBH,SAAS,CAACI,IAAV,GAAiBJ,SAAS,CAACE,WAA7C;AACH;;AAED,QAAIF,SAAS,CAACE,WAAV,IAAyB,IAAzB,IAAiC,KAAKC,UAAL,KAAoB,CAAzD,EAA4D;AACxD,aAAOH,SAAS,CAACI,IAAjB;AACH,KAFD,MAEO;AACH,aAAO,KAAKD,UAAL,GAAkBH,SAAS,CAACE,WAAnC;AACH;AACJ;;AA3B8B","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\n/**\n * A Timestamp structure holding the\n */\nexport type Timestamp = {\n // Result of Date API. Unix timestamp in ms.\n unix: number;\n // Result of performance.now API. Timestamp in ms (with microsecond precision)\n // since JS context start.\n reactNative: number | null;\n};\n\n/**\n * Simple class providing timestamps in milliseconds.\n * If available, it will use the `performance.now()` method, and will fallback on `Date.now()` otherwise.\n */\nexport abstract class TimeProvider {\n /** Keeps an average offset between the unix time and the provided timestamp. */\n protected baseOffset: number;\n\n constructor() {\n const timestamp = this.getTimestamp();\n if (timestamp.reactNative == null) {\n this.baseOffset = 0;\n } else {\n this.baseOffset = timestamp.unix - timestamp.reactNative;\n }\n }\n\n abstract getTimestamp(): Timestamp;\n\n now(): number {\n const timestamp = this.getTimestamp();\n\n if (timestamp.reactNative != null && this.baseOffset === 0) {\n this.baseOffset = timestamp.unix - timestamp.reactNative;\n }\n\n if (timestamp.reactNative == null || this.baseOffset === 0) {\n return timestamp.unix;\n } else {\n return this.baseOffset + timestamp.reactNative;\n }\n }\n}\n"]}
|
package/lib/commonjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '2.3.
|
|
1
|
+
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '2.3.5';\n"]}
|
|
@@ -31,7 +31,11 @@ export class TimeProvider {
|
|
|
31
31
|
now() {
|
|
32
32
|
const timestamp = this.getTimestamp();
|
|
33
33
|
|
|
34
|
-
if (timestamp.reactNative
|
|
34
|
+
if (timestamp.reactNative != null && this.baseOffset === 0) {
|
|
35
|
+
this.baseOffset = timestamp.unix - timestamp.reactNative;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (timestamp.reactNative == null || this.baseOffset === 0) {
|
|
35
39
|
return timestamp.unix;
|
|
36
40
|
} else {
|
|
37
41
|
return this.baseOffset + timestamp.reactNative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["TimeProvider.tsx"],"names":["TimeProvider","constructor","timestamp","getTimestamp","reactNative","baseOffset","unix","now"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA,OAAO,MAAeA,YAAf,CAA4B;AAC/B;AAGAC,EAAAA,WAAW,GAAG;AAAA;;AACV,UAAMC,SAAS,GAAG,KAAKC,YAAL,EAAlB;;AACA,QAAID,SAAS,CAACE,WAAV,IAAyB,IAA7B,EAAmC;AAC/B,WAAKC,UAAL,GAAkB,CAAlB;AACH,KAFD,MAEO;AACH,WAAKA,UAAL,GAAkBH,SAAS,CAACI,IAAV,GAAiBJ,SAAS,CAACE,WAA7C;AACH;AACJ;;AAIDG,EAAAA,GAAG,GAAW;AACV,UAAML,SAAS,GAAG,KAAKC,YAAL,EAAlB;;
|
|
1
|
+
{"version":3,"sources":["TimeProvider.tsx"],"names":["TimeProvider","constructor","timestamp","getTimestamp","reactNative","baseOffset","unix","now"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA,OAAO,MAAeA,YAAf,CAA4B;AAC/B;AAGAC,EAAAA,WAAW,GAAG;AAAA;;AACV,UAAMC,SAAS,GAAG,KAAKC,YAAL,EAAlB;;AACA,QAAID,SAAS,CAACE,WAAV,IAAyB,IAA7B,EAAmC;AAC/B,WAAKC,UAAL,GAAkB,CAAlB;AACH,KAFD,MAEO;AACH,WAAKA,UAAL,GAAkBH,SAAS,CAACI,IAAV,GAAiBJ,SAAS,CAACE,WAA7C;AACH;AACJ;;AAIDG,EAAAA,GAAG,GAAW;AACV,UAAML,SAAS,GAAG,KAAKC,YAAL,EAAlB;;AAEA,QAAID,SAAS,CAACE,WAAV,IAAyB,IAAzB,IAAiC,KAAKC,UAAL,KAAoB,CAAzD,EAA4D;AACxD,WAAKA,UAAL,GAAkBH,SAAS,CAACI,IAAV,GAAiBJ,SAAS,CAACE,WAA7C;AACH;;AAED,QAAIF,SAAS,CAACE,WAAV,IAAyB,IAAzB,IAAiC,KAAKC,UAAL,KAAoB,CAAzD,EAA4D;AACxD,aAAOH,SAAS,CAACI,IAAjB;AACH,KAFD,MAEO;AACH,aAAO,KAAKD,UAAL,GAAkBH,SAAS,CAACE,WAAnC;AACH;AACJ;;AA3B8B","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\n/**\n * A Timestamp structure holding the\n */\nexport type Timestamp = {\n // Result of Date API. Unix timestamp in ms.\n unix: number;\n // Result of performance.now API. Timestamp in ms (with microsecond precision)\n // since JS context start.\n reactNative: number | null;\n};\n\n/**\n * Simple class providing timestamps in milliseconds.\n * If available, it will use the `performance.now()` method, and will fallback on `Date.now()` otherwise.\n */\nexport abstract class TimeProvider {\n /** Keeps an average offset between the unix time and the provided timestamp. */\n protected baseOffset: number;\n\n constructor() {\n const timestamp = this.getTimestamp();\n if (timestamp.reactNative == null) {\n this.baseOffset = 0;\n } else {\n this.baseOffset = timestamp.unix - timestamp.reactNative;\n }\n }\n\n abstract getTimestamp(): Timestamp;\n\n now(): number {\n const timestamp = this.getTimestamp();\n\n if (timestamp.reactNative != null && this.baseOffset === 0) {\n this.baseOffset = timestamp.unix - timestamp.reactNative;\n }\n\n if (timestamp.reactNative == null || this.baseOffset === 0) {\n return timestamp.unix;\n } else {\n return this.baseOffset + timestamp.reactNative;\n }\n }\n}\n"]}
|
package/lib/module/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '2.3.
|
|
1
|
+
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '2.3.5';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.3.
|
|
1
|
+
export declare const version = "2.3.5";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/mobile-react-native",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.5",
|
|
4
4
|
"description": "A client-side React Native module to interact with Datadog",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datadog",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"javaPackageName": "com.datadog.reactnative"
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "d80e122e5f06e6d126f9e271f641b3cec9e21832"
|
|
101
101
|
}
|
|
@@ -36,7 +36,12 @@ export abstract class TimeProvider {
|
|
|
36
36
|
|
|
37
37
|
now(): number {
|
|
38
38
|
const timestamp = this.getTimestamp();
|
|
39
|
-
|
|
39
|
+
|
|
40
|
+
if (timestamp.reactNative != null && this.baseOffset === 0) {
|
|
41
|
+
this.baseOffset = timestamp.unix - timestamp.reactNative;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (timestamp.reactNative == null || this.baseOffset === 0) {
|
|
40
45
|
return timestamp.unix;
|
|
41
46
|
} else {
|
|
42
47
|
return this.baseOffset + timestamp.reactNative;
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export const version = '2.3.
|
|
2
|
+
export const version = '2.3.5';
|