karl-common-util
Advanced tools
Comparing version 1.3.3 to 1.3.5
@@ -59,3 +59,3 @@ "use strict"; | ||
var month = this.getMonth() + 1; | ||
var isLeapYear = this.getFullYear(); | ||
var isLeapYear = this.isLeapYear(); | ||
switch (month) { | ||
@@ -81,2 +81,20 @@ case 1: | ||
}; | ||
} | ||
if (!Date.prototype.toMonday) { | ||
Date.prototype.toMonday = function () { | ||
var n = this.getDay(); | ||
n = n === 0 ? 7 : n; | ||
var newDate = this.add({ day: -n + 1 }); | ||
return newDate; | ||
}; | ||
} | ||
if (!Date.prototype.toSunday) { | ||
Date.prototype.toSunday = function () { | ||
var n = this.getDay(); | ||
n = n === 0 ? 7 : n; | ||
var newDate = this.add({ day: -n + 7 }); | ||
return newDate; | ||
}; | ||
} |
@@ -38,3 +38,7 @@ "use strict"; | ||
}, timeout); | ||
headers = Object.assign({}, { 'Content-Type': contentType }, headers); | ||
headers = Object.assign({}, { | ||
"Content-Type": contentType, | ||
"Cache-Control": "no-cache", | ||
"Pragma": "no-cache" | ||
}, headers); | ||
json = { | ||
@@ -41,0 +45,0 @@ method: method, |
{ | ||
"name": "karl-common-util", | ||
"version": "1.3.3", | ||
"version": "1.3.5", | ||
"description": "karl common lib for client and server", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -44,3 +44,3 @@ if (!Date.prototype.add) { | ||
let month = this.getMonth() + 1 | ||
let isLeapYear = this.getFullYear() | ||
let isLeapYear = this.isLeapYear() | ||
switch (month) { | ||
@@ -67,1 +67,19 @@ case 1: | ||
} | ||
if (!Date.prototype.toMonday) { | ||
Date.prototype.toMonday = function () { | ||
let n = this.getDay() | ||
n = n === 0 ? 7 : n | ||
let newDate = this.add({day: -n + 1}) | ||
return newDate | ||
} | ||
} | ||
if (!Date.prototype.toSunday) { | ||
Date.prototype.toSunday = function () { | ||
let n = this.getDay() | ||
n = n === 0 ? 7 : n | ||
let newDate = this.add({day: -n + 7}) | ||
return newDate | ||
} | ||
} |
@@ -9,3 +9,5 @@ import "isomorphic-fetch" | ||
}, timeout) | ||
headers = Object.assign({}, {'Content-Type': contentType}, headers) | ||
headers = Object.assign({}, { | ||
"Content-Type": contentType, | ||
}, headers) | ||
let json = { | ||
@@ -56,3 +58,3 @@ method: method, | ||
//结果类型不为json(例如nginx直接返回404错误) | ||
reject({status: status, message: e}) | ||
reject({status: status, message: responese}) | ||
return | ||
@@ -59,0 +61,0 @@ } |
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
51749
1226