{"id":"../node_modules/@pushrocks/smarttime/dist/smarttime.classes.timestamp.js","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/smarttime/ts/smarttime.classes.timestamp.ts","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/package.json","includedInParent":true,"mtime":1545395695572},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/smarttime/package.json","includedInParent":true,"mtime":1545395356342}],"generated":{"js":"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * TimeStamp\n * smart timestamp\n */\nclass TimeStamp {\n constructor(creatorArg) {\n /**\n * if derived from another TimeStamp points out the change in milliseconds\n */\n this.change = null;\n if (!creatorArg) {\n this.date = new Date();\n }\n else if (typeof creatorArg === 'number') {\n this.date = new Date(creatorArg);\n }\n this.milliSeconds = this.date.getTime();\n this.epochtime = Math.floor(this.milliSeconds / 1000);\n }\n /**\n * returns new TimeStamp from milliseconds\n */\n static fromMilliSeconds(milliSecondsArg) {\n return new TimeStamp(milliSecondsArg);\n }\n /**\n * returns new TimeStamp for now with change set\n * @param timeStampArg\n */\n static fromTimeStamp(timeStampArg) {\n const localTimeStamp = new TimeStamp();\n localTimeStamp.change = localTimeStamp.milliSeconds - timeStampArg.milliSeconds;\n return localTimeStamp;\n }\n /**\n * Is the current instance older than the argument\n * @param TimeStampArg\n */\n isOlderThan(TimeStampArg, tresholdTimeArg = 0) {\n if (this.milliSeconds + tresholdTimeArg < TimeStampArg.milliSeconds) {\n return true;\n }\n else {\n return false;\n }\n }\n isYoungerThanOtherTimeStamp(TimeStampArg, tresholdTimeArg = 0) {\n if (this.milliSeconds > TimeStampArg.milliSeconds + tresholdTimeArg) {\n return true;\n }\n else {\n return false;\n }\n }\n isYoungerThanMilliSeconds(millisecondArg) {\n const nowTimeStamp = new TimeStamp();\n const compareEpochTime = nowTimeStamp.epochtime - millisecondArg;\n const compareTimeStamp = new TimeStamp(compareEpochTime);\n return this.isYoungerThanOtherTimeStamp(compareTimeStamp);\n }\n}\nexports.TimeStamp = TimeStamp;\n","map":{"version":3,"file":"smarttime.classes.timestamp.js","sourceRoot":"","sources":["../ts/smarttime.classes.timestamp.ts"],"names":[],"mappings":";;AAEA;;;GAGG;AACH,MAAa,SAAS;IAuCpB,YAAY,UAAmB;QAL/B;;WAEG;QACI,WAAM,GAAW,IAAI,CAAC;QAG3B,IAAI,CAAC,UAAU,EAAE;YACf,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;SACxB;aAAM,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;YACzC,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;SAClC;QACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACxC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IACxD,CAAC;IA9CD;;OAEG;IACI,MAAM,CAAC,gBAAgB,CAAC,eAAe;QAC5C,OAAO,IAAI,SAAS,CAAC,eAAe,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,aAAa,CAAC,YAAuB;QACjD,MAAM,cAAc,GAAG,IAAI,SAAS,EAAE,CAAC;QACvC,cAAc,CAAC,MAAM,GAAG,cAAc,CAAC,YAAY,GAAG,YAAY,CAAC,YAAY,CAAC;QAChF,OAAO,cAAc,CAAC;IACxB,CAAC;IAiCD;;;OAGG;IACI,WAAW,CAAC,YAAuB,EAAE,kBAA0B,CAAC;QACrE,IAAI,IAAI,CAAC,YAAY,GAAG,eAAe,GAAG,YAAY,CAAC,YAAY,EAAE;YACnE,OAAO,IAAI,CAAC;SACb;aAAM;YACL,OAAO,KAAK,CAAC;SACd;IACH,CAAC;IAEM,2BAA2B,CAAC,YAAuB,EAAE,kBAA0B,CAAC;QACrF,IAAI,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC,YAAY,GAAG,eAAe,EAAE;YACnE,OAAO,IAAI,CAAC;SACb;aAAM;YACL,OAAO,KAAK,CAAC;SACd;IACH,CAAC;IAEM,yBAAyB,CAAC,cAAsB;QACrD,MAAM,YAAY,GAAG,IAAI,SAAS,EAAE,CAAC;QACrC,MAAM,gBAAgB,GAAG,YAAY,CAAC,SAAS,GAAG,cAAc,CAAC;QACjE,MAAM,gBAAgB,GAAG,IAAI,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC,2BAA2B,CAAC,gBAAgB,CAAC,CAAC;IAC5D,CAAC;CACF;AA3ED,8BA2EC","sourcesContent":["import * as plugins from './smarttime.plugins';\n\n/**\n * TimeStamp\n * smart timestamp\n */\nexport class TimeStamp {\n /**\n * returns new TimeStamp from milliseconds\n */\n public static fromMilliSeconds(milliSecondsArg) {\n return new TimeStamp(milliSecondsArg);\n }\n\n /**\n * returns new TimeStamp for now with change set\n * @param timeStampArg\n */\n public static fromTimeStamp(timeStampArg: TimeStamp) {\n const localTimeStamp = new TimeStamp();\n localTimeStamp.change = localTimeStamp.milliSeconds - timeStampArg.milliSeconds;\n return localTimeStamp;\n }\n\n /**\n * The standard JavaScript Date\n */\n public date: Date;\n\n /**\n * The time as linux time (milliseconds, not seconds though)\n * good for comparison\n */\n public milliSeconds: number;\n\n /**\n * The standard epoch time in seconds\n */\n public epochtime: number;\n\n /**\n * if derived from another TimeStamp points out the change in milliseconds\n */\n public change: number = null;\n\n constructor(creatorArg?: number) {\n if (!creatorArg) {\n this.date = new Date();\n } else if (typeof creatorArg === 'number') {\n this.date = new Date(creatorArg);\n }\n this.milliSeconds = this.date.getTime();\n this.epochtime = Math.floor(this.milliSeconds / 1000);\n }\n\n /**\n * Is the current instance older than the argument\n * @param TimeStampArg\n */\n public isOlderThan(TimeStampArg: TimeStamp, tresholdTimeArg: number = 0) {\n if (this.milliSeconds + tresholdTimeArg < TimeStampArg.milliSeconds) {\n return true;\n } else {\n return false;\n }\n }\n\n public isYoungerThanOtherTimeStamp(TimeStampArg: TimeStamp, tresholdTimeArg: number = 0) {\n if (this.milliSeconds > TimeStampArg.milliSeconds + tresholdTimeArg) {\n return true;\n } else {\n return false;\n }\n }\n\n public isYoungerThanMilliSeconds(millisecondArg: number) {\n const nowTimeStamp = new TimeStamp();\n const compareEpochTime = nowTimeStamp.epochtime - millisecondArg;\n const compareTimeStamp = new TimeStamp(compareEpochTime);\n return this.isYoungerThanOtherTimeStamp(compareTimeStamp);\n }\n}\n"]}},"hash":"5e4f1a8ccde303e7f6e21e199277d399","cacheData":{"env":{}}}