Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

audio-context

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

audio-context - npm Package Compare versions

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"

@@ -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()
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc