audio-context
Advanced tools
Comparing version 1.0.1 to 1.0.2
10
index.js
'use strict' | ||
var window = require('global/window') | ||
var OfflineContext = window.OfflineAudioContext || window.webkitOfflineAudioContext | ||
var Context = window.AudioContext || window.webkitAudioContext | ||
var cache = {} | ||
module.exports = function getContext (options) { | ||
if (typeof window === 'undefined') return null | ||
var OfflineContext = window.OfflineAudioContext || window.webkitOfflineAudioContext | ||
var Context = window.AudioContext || window.webkitAudioContext | ||
if (!Context) return null | ||
@@ -12,0 +12,0 @@ |
{ | ||
"name": "audio-context", | ||
"description": "A WebAudio Context singleton", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"scripts": { | ||
"test": "browserify test.js | tape-run" | ||
"test": "browserify test.js | tape-run && node test" | ||
}, | ||
@@ -13,7 +13,3 @@ "repository": { | ||
"homepage": "https://github.com/audiojs/audio-context", | ||
"dependencies": { | ||
"global": "^4.3.1" | ||
}, | ||
"devDependencies": { | ||
"browserify": "^14.3.0", | ||
"is-browser": "^2.0.1", | ||
@@ -26,2 +22,3 @@ "tape": "*", | ||
"audio", | ||
"audiojs", | ||
"context", | ||
@@ -28,0 +25,0 @@ "singleton" |
17
test.js
@@ -66,1 +66,18 @@ 'use strict'; | ||
// Non-browser test, returns null | ||
!isBrowser && test('returns null in non-browser env', function(t){ | ||
var ctx = createContext() | ||
t.is(ctx, null) | ||
t.end() | ||
}) | ||
isBrowser && test('new Context', function (t) { | ||
var ctx = new createContext() | ||
var ctx2 = new createContext() | ||
t.equal(ctx, ctx2) | ||
t.ok(ctx.sampleRate) | ||
t.end() | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8017
0
3
137
7
- Removedglobal@^4.3.1
- Removeddom-walk@0.1.2(transitive)
- Removedglobal@4.4.0(transitive)
- Removedmin-document@2.19.0(transitive)
- Removedprocess@0.11.10(transitive)