Socket
Socket
Sign inDemoInstall

@episodehunter/utils

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.3

coverage/clover.xml

2

dist/index.d.ts

@@ -0,2 +1,4 @@

export * from './arrary';
export * from './episode';
export * from './gql';
export * from './time';

@@ -6,4 +6,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./arrary"));
__export(require("./episode"));
__export(require("./gql"));
__export(require("./time"));
//# sourceMappingURL=index.js.map
export declare function unixTimestamp(): number;
export declare function createDateString(date: Date): string;
export declare function daysAgoOnFormatYYYYMMDD(n: number, now?: Date): string;

@@ -7,2 +7,14 @@ "use strict";

exports.unixTimestamp = unixTimestamp;
function createDateString(date) {
const year = String(date.getFullYear());
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
exports.createDateString = createDateString;
function daysAgoOnFormatYYYYMMDD(n, now = new Date()) {
now.setDate(now.getDate() - n);
return createDateString(now);
}
exports.daysAgoOnFormatYYYYMMDD = daysAgoOnFormatYYYYMMDD;
//# sourceMappingURL=time.js.map

12

package.json
{
"name": "@episodehunter/utils",
"version": "1.0.1",
"version": "1.0.3",
"description": "Util functions for episodehunter",

@@ -8,3 +8,4 @@ "main": "dist/index.js",

"build": "tsc",
"prepare": "npm run build"
"prepare": "npm run build",
"test": "jest"
},

@@ -26,3 +27,6 @@ "repository": {

"devDependencies": {
"typescript": "^3.5.3"
"@types/jest": "24.0.17",
"jest": "24.9.0",
"ts-jest": "24.0.2",
"typescript": "3.5.3"
},

@@ -32,3 +36,3 @@ "prettier": {

},
"gitHead": "bb6c459cb823c856d674ae25c036647d07f2252c"
"gitHead": "9f7ed2a30ffb94331c63af6b8af9d0a4fce2b069"
}

@@ -0,2 +1,4 @@

export * from './arrary';
export * from './episode';
export * from './gql';
export * from './time';
export function unixTimestamp() {
return (Date.now() / 1000) | 0;
}
export function createDateString(date: Date) {
const year = String(date.getFullYear());
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
export function daysAgoOnFormatYYYYMMDD(n: number, now = new Date()) {
now.setDate(now.getDate() - n);
return createDateString(now);
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc