syntax highlighting

This commit is contained in:
AJ ONeal 2014-03-01 10:19:38 -06:00
parent c617241c52
commit 9b930a09aa
1 changed files with 28 additions and 24 deletions

View File

@ -11,6 +11,7 @@ This is meant for the purpose of being able to run unit-tests and such for brows
Usage Usage
---- ----
```javascript
var Storage = require('dom-storage') var Storage = require('dom-storage')
// in-file, doesn't call `String(val)` on values (default) // in-file, doesn't call `String(val)` on values (default)
@ -28,6 +29,7 @@ Usage
// use JSON to stringify / parse when using strict w3c compliance // use JSON to stringify / parse when using strict w3c compliance
sessionStorage.setItem('myKey', JSON.stringify(myValue)); sessionStorage.setItem('myKey', JSON.stringify(myValue));
myValue = JSON.parse(localStorage.getItem('myKey')); myValue = JSON.parse(localStorage.getItem('myKey'));
```
API API
--- ---
@ -42,6 +44,7 @@ API
Tests Tests
--- ---
```javascript
0 === localStorage.length; 0 === localStorage.length;
null === localStorage.getItem('doesn't exist'); null === localStorage.getItem('doesn't exist');
undefined === localStorage['doesn't exist']; undefined === localStorage['doesn't exist'];
@ -58,6 +61,7 @@ Tests
localStorage.clear(); localStorage.clear();
0 === localStorage.length; 0 === localStorage.length;
```
Notes Notes
--- ---