@synatic/type-magic
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -1,4 +0,5 @@ | ||
const $check = require('check-types'); | ||
const $moment = require('moment'); | ||
const $numeral = require('numeral'); | ||
const $check = require('check-types'); | ||
$moment.suppressDeprecationWarnings = true; | ||
@@ -350,2 +351,5 @@ const _conversionMatrix = { | ||
} | ||
if ($moment.isMoment(val)) { | ||
return 'date'; | ||
} | ||
if ($check.boolean(val)) { | ||
@@ -393,2 +397,8 @@ return 'boolean'; | ||
} | ||
} else if ($moment.isMoment(val)) { | ||
if (format) { | ||
return $moment(val).format(format); | ||
} else { | ||
return val.toISOString(); | ||
} | ||
} else if ($check.integer(val)) { | ||
@@ -395,0 +405,0 @@ if (format) { |
{ | ||
"name": "@synatic/type-magic", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Utilities for checking and converting javascript types", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14164
412