encodeurl 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/HISTORY.md +5 -0
  2. package/index.js +1 -1
  3. package/package.json +1 -1
package/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ 1.0.1 / 2016-06-09
2
+ ==================
3
+
4
+ * Fix encoding unpaired surrogates at start/end of string
5
+
1
6
  1.0.0 / 2016-06-08
2
7
  ==================
3
8
 
package/index.js CHANGED
@@ -26,7 +26,7 @@ var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\
26
26
  * @private
27
27
  */
28
28
 
29
- var UNMATCHED_SURROGATE_PAIR_REGEXP = /([^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF])/g
29
+ var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g
30
30
 
31
31
  /**
32
32
  * String to replace unmatched surrogate pair with.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "encodeurl",
3
3
  "description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "contributors": [
6
6
  "Douglas Christopher Wilson <doug@somethingdoug.com>"
7
7
  ],