syntax highlighting
This commit is contained in:
parent
c617241c52
commit
9b930a09aa
|
@ -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
|
||||||
---
|
---
|
||||||
|
|
Loading…
Reference in New Issue