jspsych 7.2.0 → 7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jspsych",
3
- "version": "7.2.0",
3
+ "version": "7.2.3",
4
4
  "description": "Behavioral experiments in a browser",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -47,9 +47,8 @@
47
47
  },
48
48
  "devDependencies": {
49
49
  "@fontsource/open-sans": "4.5.3",
50
- "@jspsych/config": "^1.2.0",
50
+ "@jspsych/config": "^1.3.1",
51
51
  "@types/dom-mediacapture-record": "^1.0.11",
52
- "@types/seedrandom": "^3.0.1",
53
52
  "base64-inline-loader": "^2.0.1",
54
53
  "css-loader": "^6.6.0",
55
54
  "mini-css-extract-plugin": "^2.5.3",
package/src/JsPsych.ts CHANGED
@@ -242,7 +242,7 @@ export class JsPsych {
242
242
  this.data.write(data);
243
243
 
244
244
  // get back the data with all of the defaults in
245
- const trial_data = this.data.get().filter({ trial_index: this.global_trial_index });
245
+ const trial_data = this.data.getLastTrialData();
246
246
 
247
247
  // for trial-level callbacks, we just want to pass in a reference to the values
248
248
  // of the DataCollection, for easy access and editing.
package/src/index.ts CHANGED
@@ -1,3 +1,5 @@
1
+ // __rollup-babel-import-regenerator-runtime__
2
+
1
3
  import { JsPsych } from "./JsPsych";
2
4
  import { MigrationError } from "./migration";
3
5
 
@@ -1,5 +1,5 @@
1
1
  import rw from "random-words";
2
- import seedrandom from "seedrandom";
2
+ import seedrandom from "seedrandom/lib/alea";
3
3
 
4
4
  /**
5
5
  * Uses the `seedrandom` package to replace Math.random() with a seedable PRNG.
@@ -7,12 +7,8 @@ import seedrandom from "seedrandom";
7
7
  * @param seed An optional seed. If none is given, a random seed will be generated.
8
8
  * @returns The seed value.
9
9
  */
10
- export function setSeed(seed?: string) {
11
- if (!seed) {
12
- const prng = seedrandom();
13
- seed = prng.int32().toString();
14
- }
15
- seedrandom(seed, { global: true });
10
+ export function setSeed(seed: string = Math.random().toString()) {
11
+ Math.random = seedrandom(seed);
16
12
  return seed;
17
13
  }
18
14