angular-localForage icon indicating copy to clipboard operation
angular-localForage copied to clipboard

Add support for ArrayBuffer

Open qa2gr opened this issue 11 years ago • 1 comments

When dealing with binary types, angular-localForage seems to have trouble handling 'ArrayBuffer' type. The vanilla localForage lib doesn't have this problem.

To reproduce the problem, just try to cache an ArrayBuffer & then retrieve it. The resulting object is empty.

So far, with only a simple change on line 123, I managed to solve it : From localCopy = typeof Blob !== 'undefined' && value instanceof Blob ? value : angular.copy(value); To localCopy = typeof Blob !== 'undefined' && typeof ArrayBuffer !== 'undefined' && (value instanceof Blob || value instanceof ArrayBuffer) ? value : angular.copy(value);

However, I cannot run the test suite because of

'Failed to start Sauce Connect'.

I may however have missed something special for dealing with ArrayBuffer with angular-localForage.

qa2gr avatar Jul 31 '15 10:07 qa2gr

Yeah sauce labs only works when I'm the one who submits the commit, no idea why :-/ Thanks for the PR though ! :)

ocombe avatar Jul 31 '15 11:07 ocombe