MCPcopy Create free account
hub / github.com/Barrior/JParticles / setOptions

Method setOptions

src/wave.ts:348–368  ·  view source on GitHub ↗

* 动态设置 options 选项值

(
    newOptions: Partial<Pick<Options, ComplexOptions | PlainOptions>>
  )

Source from the content-addressed store, hash-verified

346 * 动态设置 options 选项值
347 */
348 setOptions(
349 newOptions: Partial<Pick<Options, ComplexOptions | PlainOptions>>
350 ): void {
351 if (!this.isRunningSupported || !isPlainObject(newOptions)) return
352
353 for (const property in newOptions) {
354 if (Object.hasOwnProperty.call(newOptions, property)) {
355 if (plainOptions.indexOf(property as never) !== -1) {
356 this.updatePlainOptions(
357 property as PlainOptions,
358 newOptions[property as PlainOptions]
359 )
360 } else if (complexOptions.indexOf(property as never) !== -1) {
361 this.updateComplexOptions(
362 property as ComplexOptions,
363 newOptions[property as ComplexOptions]
364 )
365 }
366 }
367 }
368 }
369}

Callers

nothing calls this directly

Calls 3

updatePlainOptionsMethod · 0.95
updateComplexOptionsMethod · 0.95
isPlainObjectFunction · 0.90

Tested by

no test coverage detected