mirror of
https://github.com/Tonejs/Tone.js
synced 2024-12-27 03:53:07 +00:00
make sure the defaults belong to the template
This commit is contained in:
parent
caff06106b
commit
a78fba072a
2 changed files with 5 additions and 5 deletions
|
@ -55,8 +55,8 @@ export class Recorder extends ToneAudioNode<RecorderOptions> {
|
|||
constructor(options?: Partial<RecorderOptions>);
|
||||
constructor() {
|
||||
|
||||
super(optionsFromArguments(Recorder.getDefaults(), arguments, ["gain", "units"]));
|
||||
const options = optionsFromArguments(Recorder.getDefaults(), arguments, ["gain", "units"]);
|
||||
super(optionsFromArguments(Recorder.getDefaults(), arguments));
|
||||
const options = optionsFromArguments(Recorder.getDefaults(), arguments);
|
||||
|
||||
this.input = new Gain({
|
||||
context: this.context
|
||||
|
|
|
@ -56,10 +56,10 @@ export function deepEquals(arrayA: number[] | string[], arrayB: number[] | strin
|
|||
export function optionsFromArguments<T extends object>(
|
||||
defaults: T,
|
||||
argsArray: IArguments,
|
||||
keys: string[] = [],
|
||||
objKey?: string,
|
||||
keys: Array<keyof T> = [],
|
||||
objKey?: keyof T,
|
||||
): T {
|
||||
const opts: any = {};
|
||||
const opts: Partial<T> = {};
|
||||
const args = Array.from(argsArray);
|
||||
// if the first argument is an object and has an object key
|
||||
if (isObject(args[0]) && objKey && !Reflect.has(args[0], objKey)) {
|
||||
|
|
Loading…
Reference in a new issue