prototypes
Advanced tools
Comparing version 1.5.0 to 2.0.0
@@ -154,3 +154,3 @@ 'use strict'; | ||
return self; | ||
} | ||
}; | ||
@@ -157,0 +157,0 @@ /** |
@@ -229,3 +229,3 @@ 'use strict'; | ||
{ | ||
return escape(this).replaceAll('+', '%2B'); | ||
return escape(this).replaceAll('+', '%2B').replaceAll('/', '%2F'); | ||
}; | ||
@@ -239,3 +239,3 @@ | ||
{ | ||
return unescape(this.replaceAll('%2b', '+')); | ||
return unescape(this.replaceAllIgnoreCase('%2b', '+').replaceAllIgnoreCase('%2f', '/')); | ||
}; | ||
@@ -242,0 +242,0 @@ |
{ | ||
"name": "prototypes", | ||
"version": "1.5.0", | ||
"version": "2.0.0", | ||
"description": "Some common prototypes for node.js: string.startsWith(), object.countProperties() and more. Facilities for functional programming with objects: object.forEach(), object.filter(). Functions are added safely using Object.defineProperty().", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/alexfernandez/prototypes", |
@@ -188,3 +188,3 @@ [![Build Status](https://secure.travis-ci.org/alexfernandez/prototypes.png)](http://travis-ci.org/alexfernandez/prototypes) | ||
Web safe escape. Escapes everything that escape does and the plus sign. | ||
Web safe escape. Escapes everything that escape does, and also the plus sign and slash. | ||
Example: | ||
@@ -199,3 +199,3 @@ | ||
Unescapes everything that unescape does plus "+", | ||
Unescapes everything that unescape does, and also "+" and "/", | ||
and can also be applied on the result more than once without generating `URIError: | ||
@@ -207,3 +207,3 @@ URI malformed` as `decodeURIComponent()` does. | ||
'Hi%2C%20my%20name%20is%20Pep%EDto'.unescapeForWeb(); | ||
\=> 'Hi, my name is Pepíto' | ||
//=> 'Hi, my name is Pepíto' | ||
``` | ||
@@ -217,7 +217,18 @@ | ||
``` | ||
```js | ||
'Hi, my name is Pepíto'.hashCode(); | ||
\=> 1239770349 | ||
//=> 1239770349 | ||
``` | ||
### string.pad() | ||
Pads a string to the desired length, | ||
with the given character. | ||
Example: | ||
```js | ||
'8'.pad(2, '0'); | ||
//=> '08' | ||
``` | ||
## Object Prototypes | ||
@@ -224,0 +235,0 @@ |
28956
584