Compare commits
	
		
			3 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 2e4745b189 | |||
| 21098984f1 | |||
| b2fdf0aba2 | 
							
								
								
									
										21
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								README.md
									
									
									
									
									
								
							| @ -11,7 +11,7 @@ Bower (Browser) | |||||||
| ```bash | ```bash | ||||||
| bower install json-storage | bower install json-storage | ||||||
| # or | # or | ||||||
| wget https://raw2.github.com/coolaj86/json-storage-js/master/json-storage.js | wget https://git.coolaj86.com/coolaj86/json-storage.js/raw/branch/master/json-storage.js | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Node.JS (Server) | Node.JS (Server) | ||||||
| @ -35,7 +35,7 @@ var localStorage = require('localStorage') | |||||||
|     } |     } | ||||||
|   ; |   ; | ||||||
| 
 | 
 | ||||||
| store.set('myKey', myValue);  | store.set('myKey', myValue); | ||||||
| myValue = store.get('myKey'); | myValue = store.get('myKey'); | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| @ -97,6 +97,23 @@ null === store.get('non-existant-key'); | |||||||
| 
 | 
 | ||||||
| The special case of `null` as `"null"`, aka `"\"null\""`: | The special case of `null` as `"null"`, aka `"\"null\""`: | ||||||
| 
 | 
 | ||||||
|  | ``` | ||||||
|  | typeof null        // object | ||||||
|  | typeof "null"      // string | ||||||
|  | typeof "\"null\""  // string | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
| `null`, and `"null"` both parse as `null` the "object", instead of one being the string (which would be `"\"null\""`). | `null`, and `"null"` both parse as `null` the "object", instead of one being the string (which would be `"\"null\""`). | ||||||
| 
 | 
 | ||||||
|  | ``` | ||||||
|  | JSON.parse(null)       // null (object) | ||||||
|  | JSON.parse("null")     // null (object) | ||||||
|  | JSON.parse("\"null\"") // 'null' (string) | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
| Objects containing `null`, however, parse as expected `{ "foo": null, "bar": "null" }` will parse as `foo` being `null` but `bar` being `"null"`, much unlike the value `"null"` being parsed on its own. | Objects containing `null`, however, parse as expected `{ "foo": null, "bar": "null" }` will parse as `foo` being `null` but `bar` being `"null"`, much unlike the value `"null"` being parsed on its own. | ||||||
|  | 
 | ||||||
|  | ``` | ||||||
|  | JSON.parse('{ "foo": null }')    // { foo: null } | ||||||
|  | JSON.parse('{ "foo": "null" }')  // { foo: 'null' } | ||||||
|  | ``` | ||||||
| @ -52,7 +52,7 @@ | |||||||
|     // complicated to figure it out
 |     // complicated to figure it out
 | ||||||
|     this._namespace = delim; |     this._namespace = delim; | ||||||
|     this._namespace += (namespace || 'jss'); |     this._namespace += (namespace || 'jss'); | ||||||
|     if (false === this._namespace) { |     if (false === namespace) { | ||||||
|       this._namespace = ''; |       this._namespace = ''; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -3,10 +3,10 @@ | |||||||
|   "name": "json-storage", |   "name": "json-storage", | ||||||
|   "description": "A wrapper for storage engines which use the W3C Storage API", |   "description": "A wrapper for storage engines which use the W3C Storage API", | ||||||
|   "keywords": ["dom", "storage", "json", "w3c", "localStorage", "sessionStorage", "globalStorage", "Storage"], |   "keywords": ["dom", "storage", "json", "w3c", "localStorage", "sessionStorage", "globalStorage", "Storage"], | ||||||
|   "version": "2.1.0", |   "version": "2.1.2", | ||||||
|   "repository": { |   "repository": { | ||||||
|     "type": "git", |     "type": "git", | ||||||
|     "url": "git://github.com/coolaj86/json-storage-js.git" |     "url": "git://git.coolaj86.com/coolaj86/json-storage.js.git" | ||||||
|   }, |   }, | ||||||
|   "engines": { |   "engines": { | ||||||
|     "node": ">= v0.2.0" |     "node": ">= v0.2.0" | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user