File tree Expand file tree Collapse file tree 4 files changed +59
-0
lines changed
Expand file tree Collapse file tree 4 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 2525 "./dist-esm/src/util/runtimeInfo.js" : " ./dist-esm/src/util/runtimeInfo.browser.js" ,
2626 "buffer" : " buffer"
2727 },
28+ "react-native" : {
29+ "./dist/index.js" : " dist-esm/src/index.js" ,
30+ "./dist-esm/src/util/runtimeInfo.js" : " ./dist-esm/src/util/runtimeInfo.native.js"
31+ },
2832 "files" : [
2933 " dist/" ,
3034 " dist-esm/src/" ,
Original file line number Diff line number Diff line change 1+ // Copyright (c) Microsoft Corporation.
2+ // Licensed under the MIT license.
3+
4+ /*
5+ * NOTE: When moving this file, please update "react-native" section in package.json.
6+ */
7+ const { Platform } = require ( "react-native" ) ; // eslint-disable-line import/no-extraneous-dependencies, @typescript-eslint/no-require-imports
8+
9+ /**
10+ * Returns information about the platform this function is being run on.
11+ * @internal
12+ */
13+ export function getPlatformInfo ( ) : string {
14+ return `(${ Platform . OS } -${ Platform . Version } )` ;
15+ }
16+
17+ /**
18+ * Returns information about Node.js this function is being run on.
19+ * @internal
20+ */
21+ export function getFrameworkInfo ( ) : string {
22+ const { major, minor, patch } = Platform . constants . reactNativeVersion ;
23+ return `react-native/${ major } .${ minor } .${ patch } ` ;
24+ }
Original file line number Diff line number Diff line change 2525 "buffer" : " buffer" ,
2626 "./dist-esm/src/util/runtimeInfo.js" : " ./dist-esm/src/util/runtimeInfo.browser.js"
2727 },
28+ "react-native" : {
29+ "./dist/index.js" : " dist-esm/src/index.js" ,
30+ "./dist-esm/src/util/runtimeInfo.js" : " ./dist-esm/src/util/runtimeInfo.native.js"
31+ },
2832 "types" : " ./types/latest/service-bus.d.ts" ,
2933 "typesVersions" : {
3034 "<3.6" : {
Original file line number Diff line number Diff line change 1+ // Copyright (c) Microsoft Corporation.
2+ // Licensed under the MIT license.
3+
4+ /*
5+ * NOTE: When moving this file, please update "react-native" section in package.json.
6+ */
7+ const { Platform } = require ( "react-native" ) ; // eslint-disable-line import/no-extraneous-dependencies, @typescript-eslint/no-require-imports
8+
9+ /**
10+ * Returns information about the platform this function is being run on.
11+ * @hidden
12+ * @internal
13+ */
14+ export function getRuntimeInfo ( ) : string {
15+ const { major, minor, patch } = Platform . constants . reactNativeVersion ;
16+ const runtimeInfo = {
17+ key : "react-native" ,
18+ value : `${ major } .${ minor } .${ patch } ` ,
19+ } ;
20+
21+ const osInfo = {
22+ key : "OS" ,
23+ value : `${ Platform . OS } -${ Platform . Version } ` ,
24+ } ;
25+
26+ return `${ runtimeInfo . key } /${ runtimeInfo . value } ${ osInfo . key } /${ osInfo . value } ` ;
27+ }
You can’t perform that action at this time.
0 commit comments