"ieee754": "~1.1.1"
},
"devDependencies": {
- "benchmark": "1.x",
- "browserify": "3.x",
- "tape": "2.x"
+ "benchmark": "^1.0.0",
+ "browserify": "^3.46.0",
+ "tape": "^2.12.3",
+ "useragent": "^2.0.8"
},
"homepage": "http://feross.org",
"keywords": [
--- /dev/null
+var B = require('../').Buffer
+var test = require('tape')
+var useragent = require('useragent')
+
+test('expected browsers get Uint8Array implementation', function (t) {
+ if (typeof navigator === 'undefined') {
+ t.pass('Not running in a browser -- skip this test')
+ t.end()
+ return
+ }
+ var agent = useragent.parse(navigator.userAgent)
+ console.log('Family: ' + agent.family)
+ console.log('Version: ' + agent.major + '.' + agent.minor)
+
+ if ((agent.family === 'Chrome' && agent.major >= 7) ||
+ (agent.family === 'Internet Explorer' && agent.major >= 10) ||
+ (agent.family === 'Firefox' && agent.major >= 30) ||
+ (agent.family === 'Opera' && agent.major >= 12) ||
+ (agent.family === 'Safari' && agent.major === 5 && agent.minor === 1) ||
+ (agent.family === 'Safari' && agent.major === 6)) {
+ t.ok(B._useTypedArrays)
+ } else {
+ t.ok(!B._useTypedArrays)
+ }
+ t.end()
+})