jspsych 8.2.2 → 8.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -61,7 +61,7 @@ Citations help us demonstrate that this library is used and valued, which allows
61
61
  ## Contributors
62
62
 
63
63
  jsPsych is open source project with [numerous contributors](https://github.com/jspsych/jsPsych/graphs/contributors).
64
- The project is currently managed by the core team of Josh de Leeuw ([@jodeleeuw](https://github.com/jodeleeuw)), Becky Gilbert ([@becky-gilbert](https://github.com/becky-gilbert)), Björn Luchterhandt ([@bjoluc](https://github.com/bjoluc)), and Jade ([@jadedelta](https://github.com/jadedelta)).
64
+ The project is currently managed by the core team of Josh de Leeuw ([@jodeleeuw](https://github.com/jodeleeuw)), Becky Gilbert ([@becky-gilbert](https://github.com/becky-gilbert)), Björn Luchterhandt ([@bjoluc](https://github.com/bjoluc)), and Jade ([@jadeddelta](https://github.com/jadeddelta)).
65
65
 
66
66
  jsPsych was created by [Josh de Leeuw](https://www.vassar.edu/faculty/jdeleeuw).
67
67
 
@@ -51,7 +51,7 @@ var jsPsychModule = (function (exports) {
51
51
 
52
52
  var autoBind$1 = /*@__PURE__*/getDefaultExportFromCjs(autoBind);
53
53
 
54
- var version = "8.2.2";
54
+ var version = "8.2.3";
55
55
 
56
56
  class ExtensionManager {
57
57
  constructor(dependencies, extensionsConfiguration) {
@@ -3427,6 +3427,73 @@ var jsPsychModule = (function (exports) {
3427
3427
  }
3428
3428
  }
3429
3429
  });
3430
+ if (!parameterConfig.array && parameterValue !== null) {
3431
+ switch (parameterConfig.type) {
3432
+ case ParameterType.BOOL:
3433
+ if (typeof parameterValue !== "boolean") {
3434
+ const parameterPathString = parameterPathArrayToString(parameterPath);
3435
+ console.warn(
3436
+ `A non-boolean value (\`${parameterValue}\`) was provided for the boolean parameter "${parameterPathString}" in the "${this.pluginInfo.name}" plugin.`
3437
+ );
3438
+ }
3439
+ break;
3440
+ // @ts-ignore falls through
3441
+ case ParameterType.KEYS:
3442
+ if (Array.isArray(parameterValue)) break;
3443
+ case ParameterType.STRING:
3444
+ case ParameterType.HTML_STRING:
3445
+ case ParameterType.KEY:
3446
+ case ParameterType.AUDIO:
3447
+ case ParameterType.VIDEO:
3448
+ case ParameterType.IMAGE:
3449
+ if (typeof parameterValue !== "string") {
3450
+ const parameterPathString = parameterPathArrayToString(parameterPath);
3451
+ console.warn(
3452
+ `A non-string value (\`${parameterValue}\`) was provided for the parameter "${parameterPathString}" in the "${this.pluginInfo.name}" plugin.`
3453
+ );
3454
+ }
3455
+ break;
3456
+ case ParameterType.FLOAT:
3457
+ case ParameterType.INT:
3458
+ if (typeof parameterValue !== "number") {
3459
+ const parameterPathString = parameterPathArrayToString(parameterPath);
3460
+ console.warn(
3461
+ `A non-numeric value (\`${parameterValue}\`) was provided for the numeric parameter "${parameterPathString}" in the "${this.pluginInfo.name}" plugin.`
3462
+ );
3463
+ }
3464
+ break;
3465
+ case ParameterType.FUNCTION:
3466
+ if (typeof parameterValue !== "function") {
3467
+ const parameterPathString = parameterPathArrayToString(parameterPath);
3468
+ console.warn(
3469
+ `A non-function value (\`${parameterValue}\`) was provided for the function parameter "${parameterPathString}" in the "${this.pluginInfo.name}" plugin.`
3470
+ );
3471
+ }
3472
+ break;
3473
+ case ParameterType.SELECT:
3474
+ if (!parameterConfig.options) {
3475
+ const parameterPathString = parameterPathArrayToString(parameterPath);
3476
+ console.warn(
3477
+ `The "options" array is required for the "select" parameter "${parameterPathString}" in the "${this.pluginInfo.name}" plugin.`
3478
+ );
3479
+ }
3480
+ }
3481
+ if (parameterConfig.type === ParameterType.INT && parameterValue % 1 !== 0) {
3482
+ const parameterPathString = parameterPathArrayToString(parameterPath);
3483
+ console.warn(
3484
+ `A float value (\`${parameterValue}\`) was provided for the integer parameter "${parameterPathString}" in the "${this.pluginInfo.name}" plugin. The value will be truncated to an integer.`
3485
+ );
3486
+ parameterValue = Math.trunc(parameterValue);
3487
+ }
3488
+ }
3489
+ if (parameterConfig.type === ParameterType.SELECT) {
3490
+ if (!parameterConfig.options.includes(parameterValue)) {
3491
+ const parameterPathString = parameterPathArrayToString(parameterPath);
3492
+ console.warn(
3493
+ `The value "${parameterValue}" is not a valid option for the parameter "${parameterPathString}" in the "${this.pluginInfo.name}" plugin. Valid options are: ${parameterConfig.options.join(", ")}.`
3494
+ );
3495
+ }
3496
+ }
3430
3497
  if (parameterConfig.array && !Array.isArray(parameterValue)) {
3431
3498
  const parameterPathString = parameterPathArrayToString(parameterPath);
3432
3499
  throw new Error(
@@ -4076,4 +4143,4 @@ var jsPsychModule = (function (exports) {
4076
4143
 
4077
4144
  })({});
4078
4145
  var initJsPsych = jsPsychModule.initJsPsych;
4079
- //# sourceMappingURL=https://unpkg.com/jspsych@8.2.2/dist/index.browser.js.map
4146
+ //# sourceMappingURL=https://unpkg.com/jspsych@8.2.3/dist/index.browser.js.map