Comparing version 1.1.0 to 1.1.1
1.1.1 / 2014-03-24 | ||
================== | ||
* Merge pull request #9 from TassosD/unicodetrim | ||
* Fix payload trim for unicode alert text | ||
* Merge pull request #8 from jonasrauber/master | ||
* Travis SVG badge | ||
* Merge pull request #7 from jonasrauber/master | ||
* removed incorrect parentheses and added missing dash in documentation | ||
1.1.0 / 2014-03-11 | ||
@@ -3,0 +13,0 @@ ================== |
@@ -11,3 +11,3 @@ /*! | ||
exports.version = '1.1.0'; | ||
exports.version = '1.1.1'; | ||
@@ -14,0 +14,0 @@ /*! |
@@ -25,7 +25,7 @@ /*! | ||
/** | ||
* Trim a string to a specific length. It is | ||
* expected that the string is longer than len. | ||
* Trim a string to a specific bytes length. It is | ||
* expected that the string bytes is longer than len. | ||
* | ||
* @param {String} string to trim | ||
* @param {Number} number of characters to include. | ||
* @param {Number} number of bytes to include. | ||
* @return {String} | ||
@@ -36,4 +36,10 @@ * @api public | ||
exports.trim = function (str, len) { | ||
var res = str.substr(0, len - 3); | ||
res = res.substr(0, Math.min(res.length, res.lastIndexOf(' '))); | ||
var origLen = Buffer.byteLength(str) | ||
, expLen = len - 3 | ||
, words = str.split(' ') | ||
, res = words.shift(); | ||
while (Buffer.byteLength(res + words[0]) < expLen - 2) { | ||
res += ' ' + words.shift(); | ||
} | ||
return res + '...'; | ||
@@ -40,0 +46,0 @@ }; |
{ | ||
"name": "apnagent" | ||
, "version": "1.1.0" | ||
, "version": "1.1.1" | ||
, "description": "Node adapter for Apple Push Notification (APN) service." | ||
@@ -5,0 +5,0 @@ , "author": "Jake Luer <jake@qualiancy.com> (http://qualiancy.com)" |
@@ -1,2 +0,2 @@ | ||
# APN Agent [![Build Status](https://travis-ci.org/qualiancy/apnagent.png?branch=master)](https://travis-ci.org/qualiancy/apnagent) | ||
# APN Agent [![Build Status](https://travis-ci.org/qualiancy/apnagent.svg?branch=master)](https://travis-ci.org/qualiancy/apnagent) | ||
@@ -3,0 +3,0 @@ > Node adapater for Apple Push Notification (APN) service. |
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
68986
2250