jspsych 8.0.0 → 8.0.1
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/dist/index.browser.js +26 -9
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.min.js +5 -5
- package/dist/index.browser.min.js.map +1 -1
- package/dist/index.cjs +25 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/ExtensionManager.spec.ts +1 -3
- package/src/ExtensionManager.ts +26 -7
package/dist/index.browser.js
CHANGED
|
@@ -53,7 +53,7 @@ var jsPsychModule = (function (exports) {
|
|
|
53
53
|
|
|
54
54
|
var _package = {
|
|
55
55
|
name: "jspsych",
|
|
56
|
-
version: "8.0.
|
|
56
|
+
version: "8.0.1",
|
|
57
57
|
description: "Behavioral experiments in a browser",
|
|
58
58
|
type: "module",
|
|
59
59
|
main: "dist/index.cjs",
|
|
@@ -136,9 +136,26 @@ var jsPsychModule = (function (exports) {
|
|
|
136
136
|
}
|
|
137
137
|
async initializeExtensions() {
|
|
138
138
|
await Promise.all(
|
|
139
|
-
this.extensionsConfiguration.map(
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
this.extensionsConfiguration.map(({ type, params = {} }) => {
|
|
140
|
+
this.getExtensionInstanceByClass(type).initialize(params);
|
|
141
|
+
const extensionInfo = type["info"];
|
|
142
|
+
if (!("version" in extensionInfo) && !("data" in extensionInfo)) {
|
|
143
|
+
console.warn(
|
|
144
|
+
extensionInfo["name"],
|
|
145
|
+
"is missing the 'version' and 'data' fields. Please update extension as 'version' and 'data' will be required in v9. See https://www.jspsych.org/latest/developers/extension-development/ for more details."
|
|
146
|
+
);
|
|
147
|
+
} else if (!("version" in extensionInfo)) {
|
|
148
|
+
console.warn(
|
|
149
|
+
extensionInfo["name"],
|
|
150
|
+
"is missing the 'version' field. Please update extension as 'version' will be required in v9. See https://www.jspsych.org/latest/developers/extension-development/ for more details."
|
|
151
|
+
);
|
|
152
|
+
} else if (!("data" in extensionInfo)) {
|
|
153
|
+
console.warn(
|
|
154
|
+
extensionInfo["name"],
|
|
155
|
+
"is missing the 'data' field. Please update extension as 'data' will be required in v9. See https://www.jspsych.org/latest/developers/extension-development/ for more details."
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
})
|
|
142
159
|
);
|
|
143
160
|
}
|
|
144
161
|
onStart(trialExtensionsConfiguration = []) {
|
|
@@ -157,11 +174,11 @@ var jsPsychModule = (function (exports) {
|
|
|
157
174
|
({ type, params }) => Promise.resolve(this.getExtensionInstanceByClass(type)?.on_finish(params))
|
|
158
175
|
)
|
|
159
176
|
);
|
|
160
|
-
const
|
|
161
|
-
extension_type:
|
|
162
|
-
extension_version:
|
|
177
|
+
const extensionInfos = trialExtensionsConfiguration.length ? {
|
|
178
|
+
extension_type: trialExtensionsConfiguration.map(({ type }) => type["info"].name),
|
|
179
|
+
extension_version: trialExtensionsConfiguration.map(({ type }) => type["info"].version)
|
|
163
180
|
} : {};
|
|
164
|
-
results.
|
|
181
|
+
results.unshift(extensionInfos);
|
|
165
182
|
return Object.assign({}, ...results);
|
|
166
183
|
}
|
|
167
184
|
}
|
|
@@ -3083,4 +3100,4 @@ var jsPsychModule = (function (exports) {
|
|
|
3083
3100
|
|
|
3084
3101
|
})({});
|
|
3085
3102
|
var initJsPsych = jsPsychModule.initJsPsych;
|
|
3086
|
-
//# sourceMappingURL=https://unpkg.com/jspsych@8.0.
|
|
3103
|
+
//# sourceMappingURL=https://unpkg.com/jspsych@8.0.1/dist/index.browser.js.map
|