New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

typedconverter

Package Overview
Dependencies
Maintainers
1
Versions
193
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typedconverter - npm Package Compare versions

Comparing version 2.3.6 to 2.3.7-canary.kbwv88am.0

21

package.json
{
"name": "typedconverter",
"version": "2.3.6",
"version": "2.3.7-canary.kbwv88am.0+078d37d",
"description": "Convert object into classes match with TypeScript type annotation",

@@ -13,3 +13,3 @@ "main": "lib/index.js",

"test": "jest",
"prepublish": "tsc -p tsconfig.build.json",
"compile": "tsc -p tsconfig.build.json",
"gen": "ts-node src/generator.ts",

@@ -23,5 +23,5 @@ "clean": "rm -rf src/*.js && rm -rf test/*.js && rm -rf lib",

"@types/validator": "^13.0.0",
"tinspector": "^3.1.0",
"tinspector": "3.2.3-canary.kbwv88am.0+078d37d",
"tslib": "^2.0.0",
"validator": "^13.0.0"
"validator": "^13.1.1"
},

@@ -31,5 +31,5 @@ "devDependencies": {

"@types/ejs": "^3.0.4",
"@types/hapi__joi": "^17.1.0",
"@types/jest": "^25.2.3",
"@types/lodash": "^4.14.153",
"@types/hapi__joi": "^17.1.2",
"@types/jest": "^26.0.0",
"@types/lodash": "^4.14.156",
"coveralls": "^3.1.0",

@@ -39,5 +39,5 @@ "ejs": "^3.1.3",

"lodash": "^4.17.15",
"ts-jest": "^26.0.0",
"ts-jest": "^26.1.1",
"ts-node": "^8.10.2",
"typescript": "^3.9.3"
"typescript": "^3.9.5"
},

@@ -49,3 +49,4 @@ "bugs": {

"url": "https://github.com/plumier/typedconverter"
}
},
"gitHead": "078d37d1ba9e002ea2272403880fab107a8c1817"
}

@@ -1,15 +0,34 @@

/**
* This module will serialize function as [typeof: <Function Name>] instead of [Function]
*/
function extractValues(date) {
return {
year: date.getFullYear(),
month: date.getMonth(),
date: date.getDate()
}
}
function isToday(date) {
var today = extractValues(new Date());
var value = extractValues(date);
if (
today.year !== value.year ||
today.month !== value.month ||
today.date !== value.date
) {
return false;
}
return true;
}
module.exports = {
test(val) {
return val instanceof Date;
return val && typeof val === 'object' && 'getFullYear' in val
},
print(d) {
return [
d.getFullYear(),
('0' + (d.getMonth() + 1)).slice(-2),
('0' + d.getDate()).slice(-2)
].join('-');
print(val) {
if(isToday(val)) return "DATE NOW"
var d = extractValues(val);
return [d.year, d.month, d.date].join('-');
},
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc