File tree Expand file tree Collapse file tree
packages/traceo-sdk-node-core/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { INodeClient } from "./types" ;
21import * as os from "os" ;
3- import { TraceoIncomingMessage , Platform } from "./types" ;
2+ import * as v8 from "v8" ;
3+
4+ import { Dictionary , INodeClient } from "./types" ;
5+ import { TraceoIncomingMessage } from "./types" ;
46
57export const getIp = ( req : TraceoIncomingMessage ) : string | string [ ] | undefined => {
68 return req . headers [ "x-forwarded-for" ] || req . socket . remoteAddress ;
@@ -10,12 +12,14 @@ export const getProtocol = (req: TraceoIncomingMessage): string => {
1012 return req . protocol === "https" || req . secure ? "https" : "http" ;
1113} ;
1214
13- export const getOsDetails = ( ) : Platform => {
15+ export const getOsDetails = ( ) : Dictionary < string | number > => {
1416 return {
1517 arch : os . arch ( ) ,
1618 platform : os . platform ( ) ,
17- release : os . release ( )
18- // version: os.version(),
19+ name : os . release ( ) ,
20+ machine : os . machine ( ) ,
21+ node : process . versions [ "node" ] ,
22+ v8 : process . versions [ "v8" ]
1923 } ;
2024} ;
2125
You can’t perform that action at this time.
0 commit comments