compileprofile-spacetests 0.2.0 → 0.2.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.
@@ -1,10 +1,10 @@
1
- interface EmotionResults {
1
+ interface EmotionResultsStructure {
2
2
  n: number;
3
3
  avg_rt: number;
4
4
  avg_acc: number;
5
5
  performance: number;
6
6
  }
7
- declare const emotion_calculate_results: (obj: any[]) => EmotionResults;
8
- declare const emotion_results: (obj: any[]) => EmotionResults;
7
+ declare const emotion_calculate_results: (obj: any[]) => EmotionResultsStructure;
8
+ declare const emotion_results: (obj: any[]) => EmotionResultsStructure;
9
9
  declare const emotion_extract_trials: (obj: any[]) => any[];
10
- export { emotion_calculate_results, emotion_extract_trials, emotion_results };
10
+ export { EmotionResultsStructure, emotion_calculate_results, emotion_extract_trials, emotion_results };
@@ -1,10 +1,10 @@
1
- interface GonogoResults {
1
+ interface GonogoResultsStructure {
2
2
  n: number;
3
3
  avg_rt: number;
4
4
  avg_acc: number;
5
5
  performance: number;
6
6
  }
7
- declare const gonogo_calculate_results: (data: any[]) => GonogoResults;
7
+ declare const gonogo_calculate_results: (data: any[]) => GonogoResultsStructure;
8
8
  declare const gonogo_extract_trials: (obj: any[]) => any[];
9
- declare const gonogo_results: (data: any[]) => GonogoResults;
10
- export { gonogo_calculate_results, gonogo_extract_trials, gonogo_results };
9
+ declare const gonogo_results: (data: any[]) => GonogoResultsStructure;
10
+ export { GonogoResultsStructure, gonogo_calculate_results, gonogo_extract_trials, gonogo_results };
@@ -1,5 +1,9 @@
1
- import { NBackResults } from './nback';
2
- import { SpatialResults } from './spatial-cognition';
3
- declare const NbackResults: (obj: any[]) => NBackResults;
4
- declare const SpatialCognitionResults: (obj: any[]) => SpatialResults;
5
- export { NbackResults, SpatialCognitionResults };
1
+ import { NbackResultsStructure } from './nback';
2
+ import { SpatialResultsStructure } from './spatial-cognition';
3
+ import { GonogoResultsStructure } from './gonogo';
4
+ import { EmotionResultsStructure } from './emotions';
5
+ declare const NbackResults: (obj: any[]) => NbackResultsStructure;
6
+ declare const SpatialCognitionResults: (obj: any[]) => SpatialResultsStructure;
7
+ declare const GonogoResults: (obj: any[]) => GonogoResultsStructure;
8
+ declare const EmotionResults: (obj: any[]) => EmotionResultsStructure;
9
+ export { NbackResults, SpatialCognitionResults, EmotionResults, GonogoResults };
package/dist/cjs/index.js CHANGED
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SpatialCognitionResults = exports.NbackResults = void 0;
3
+ exports.GonogoResults = exports.EmotionResults = exports.SpatialCognitionResults = exports.NbackResults = void 0;
4
4
  var nback_1 = require("./nback");
5
5
  var spatial_cognition_1 = require("./spatial-cognition");
6
+ var gonogo_1 = require("./gonogo");
7
+ var emotions_1 = require("./emotions");
6
8
  var NbackResults = function (obj) {
7
9
  return (0, nback_1.nback_calculate_results)(obj);
8
10
  };
@@ -11,3 +13,11 @@ var SpatialCognitionResults = function (obj) {
11
13
  return (0, spatial_cognition_1.spatial_calculate_results)(obj);
12
14
  };
13
15
  exports.SpatialCognitionResults = SpatialCognitionResults;
16
+ var GonogoResults = function (obj) {
17
+ return (0, gonogo_1.gonogo_calculate_results)(obj);
18
+ };
19
+ exports.GonogoResults = GonogoResults;
20
+ var EmotionResults = function (obj) {
21
+ return (0, emotions_1.emotion_calculate_results)(obj);
22
+ };
23
+ exports.EmotionResults = EmotionResults;
@@ -1,15 +1,15 @@
1
- declare const nback_calculate_results: (obj: any[]) => NBackResults;
1
+ declare const nback_calculate_results: (obj: any[]) => NbackResultsStructure;
2
2
  declare const nback_extract_trials: (obj: any[]) => any[];
3
- interface NbackTrialResults {
3
+ interface NbackTrialResultsStructure {
4
4
  n: number;
5
5
  avg_rt: number;
6
6
  avg_acc: number;
7
7
  }
8
- interface NBackResults {
9
- total_trials: NbackTrialResults;
10
- target_trials: NbackTrialResults;
11
- non_target_trials: NbackTrialResults;
8
+ interface NbackResultsStructure {
9
+ total_trials: NbackTrialResultsStructure;
10
+ target_trials: NbackTrialResultsStructure;
11
+ non_target_trials: NbackTrialResultsStructure;
12
12
  performance: number;
13
13
  }
14
- declare const nback_results: (trials: any[]) => NBackResults;
15
- export { nback_extract_trials, nback_results, nback_calculate_results, NBackResults };
14
+ declare const nback_results: (trials: any[]) => NbackResultsStructure;
15
+ export { nback_extract_trials, nback_results, nback_calculate_results, NbackResultsStructure };
@@ -1,11 +1,11 @@
1
- interface SpatialResults {
1
+ interface SpatialResultsStructure {
2
2
  n: number;
3
3
  avg_rt: number;
4
4
  avg_acc: number;
5
5
  performance: number;
6
6
  }
7
- declare const spatial_calculate_results: (obj: any[]) => SpatialResults;
7
+ declare const spatial_calculate_results: (obj: any[]) => SpatialResultsStructure;
8
8
  declare const spatial_extract_trials: (obj: any[]) => any[];
9
- declare const spatial_results: (obj: any[]) => SpatialResults;
9
+ declare const spatial_results: (obj: any[]) => SpatialResultsStructure;
10
10
  declare const spatial_extract_image_info: (obj: any[]) => any[];
11
- export { spatial_extract_image_info, spatial_extract_trials, spatial_results, spatial_calculate_results, SpatialResults };
11
+ export { spatial_extract_image_info, spatial_extract_trials, spatial_results, spatial_calculate_results, SpatialResultsStructure };
@@ -1,10 +1,10 @@
1
- interface EmotionResults {
1
+ interface EmotionResultsStructure {
2
2
  n: number;
3
3
  avg_rt: number;
4
4
  avg_acc: number;
5
5
  performance: number;
6
6
  }
7
- declare const emotion_calculate_results: (obj: any[]) => EmotionResults;
8
- declare const emotion_results: (obj: any[]) => EmotionResults;
7
+ declare const emotion_calculate_results: (obj: any[]) => EmotionResultsStructure;
8
+ declare const emotion_results: (obj: any[]) => EmotionResultsStructure;
9
9
  declare const emotion_extract_trials: (obj: any[]) => any[];
10
- export { emotion_calculate_results, emotion_extract_trials, emotion_results };
10
+ export { EmotionResultsStructure, emotion_calculate_results, emotion_extract_trials, emotion_results };
@@ -1,10 +1,10 @@
1
- interface GonogoResults {
1
+ interface GonogoResultsStructure {
2
2
  n: number;
3
3
  avg_rt: number;
4
4
  avg_acc: number;
5
5
  performance: number;
6
6
  }
7
- declare const gonogo_calculate_results: (data: any[]) => GonogoResults;
7
+ declare const gonogo_calculate_results: (data: any[]) => GonogoResultsStructure;
8
8
  declare const gonogo_extract_trials: (obj: any[]) => any[];
9
- declare const gonogo_results: (data: any[]) => GonogoResults;
10
- export { gonogo_calculate_results, gonogo_extract_trials, gonogo_results };
9
+ declare const gonogo_results: (data: any[]) => GonogoResultsStructure;
10
+ export { GonogoResultsStructure, gonogo_calculate_results, gonogo_extract_trials, gonogo_results };
@@ -1,5 +1,9 @@
1
- import { NBackResults } from './nback';
2
- import { SpatialResults } from './spatial-cognition';
3
- declare const NbackResults: (obj: any[]) => NBackResults;
4
- declare const SpatialCognitionResults: (obj: any[]) => SpatialResults;
5
- export { NbackResults, SpatialCognitionResults };
1
+ import { NbackResultsStructure } from './nback';
2
+ import { SpatialResultsStructure } from './spatial-cognition';
3
+ import { GonogoResultsStructure } from './gonogo';
4
+ import { EmotionResultsStructure } from './emotions';
5
+ declare const NbackResults: (obj: any[]) => NbackResultsStructure;
6
+ declare const SpatialCognitionResults: (obj: any[]) => SpatialResultsStructure;
7
+ declare const GonogoResults: (obj: any[]) => GonogoResultsStructure;
8
+ declare const EmotionResults: (obj: any[]) => EmotionResultsStructure;
9
+ export { NbackResults, SpatialCognitionResults, EmotionResults, GonogoResults };
package/dist/esm/index.js CHANGED
@@ -1,9 +1,17 @@
1
1
  import { nback_calculate_results } from './nback';
2
2
  import { spatial_calculate_results } from './spatial-cognition';
3
+ import { gonogo_calculate_results } from './gonogo';
4
+ import { emotion_calculate_results } from './emotions';
3
5
  var NbackResults = function (obj) {
4
6
  return nback_calculate_results(obj);
5
7
  };
6
8
  var SpatialCognitionResults = function (obj) {
7
9
  return spatial_calculate_results(obj);
8
10
  };
9
- export { NbackResults, SpatialCognitionResults };
11
+ var GonogoResults = function (obj) {
12
+ return gonogo_calculate_results(obj);
13
+ };
14
+ var EmotionResults = function (obj) {
15
+ return emotion_calculate_results(obj);
16
+ };
17
+ export { NbackResults, SpatialCognitionResults, EmotionResults, GonogoResults };
@@ -1,15 +1,15 @@
1
- declare const nback_calculate_results: (obj: any[]) => NBackResults;
1
+ declare const nback_calculate_results: (obj: any[]) => NbackResultsStructure;
2
2
  declare const nback_extract_trials: (obj: any[]) => any[];
3
- interface NbackTrialResults {
3
+ interface NbackTrialResultsStructure {
4
4
  n: number;
5
5
  avg_rt: number;
6
6
  avg_acc: number;
7
7
  }
8
- interface NBackResults {
9
- total_trials: NbackTrialResults;
10
- target_trials: NbackTrialResults;
11
- non_target_trials: NbackTrialResults;
8
+ interface NbackResultsStructure {
9
+ total_trials: NbackTrialResultsStructure;
10
+ target_trials: NbackTrialResultsStructure;
11
+ non_target_trials: NbackTrialResultsStructure;
12
12
  performance: number;
13
13
  }
14
- declare const nback_results: (trials: any[]) => NBackResults;
15
- export { nback_extract_trials, nback_results, nback_calculate_results, NBackResults };
14
+ declare const nback_results: (trials: any[]) => NbackResultsStructure;
15
+ export { nback_extract_trials, nback_results, nback_calculate_results, NbackResultsStructure };
@@ -1,11 +1,11 @@
1
- interface SpatialResults {
1
+ interface SpatialResultsStructure {
2
2
  n: number;
3
3
  avg_rt: number;
4
4
  avg_acc: number;
5
5
  performance: number;
6
6
  }
7
- declare const spatial_calculate_results: (obj: any[]) => SpatialResults;
7
+ declare const spatial_calculate_results: (obj: any[]) => SpatialResultsStructure;
8
8
  declare const spatial_extract_trials: (obj: any[]) => any[];
9
- declare const spatial_results: (obj: any[]) => SpatialResults;
9
+ declare const spatial_results: (obj: any[]) => SpatialResultsStructure;
10
10
  declare const spatial_extract_image_info: (obj: any[]) => any[];
11
- export { spatial_extract_image_info, spatial_extract_trials, spatial_results, spatial_calculate_results, SpatialResults };
11
+ export { spatial_extract_image_info, spatial_extract_trials, spatial_results, spatial_calculate_results, SpatialResultsStructure };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compileprofile-spacetests",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "A package for evaluating cognitive test results from Vzhuru do vesmiru",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/emotions.ts CHANGED
@@ -1,11 +1,11 @@
1
- interface EmotionResults {
1
+ interface EmotionResultsStructure {
2
2
  n: number;
3
3
  avg_rt: number;
4
4
  avg_acc: number;
5
5
  performance: number;
6
6
  }
7
7
 
8
- const emotion_calculate_results = (obj: any[]): EmotionResults => {
8
+ const emotion_calculate_results = (obj: any[]): EmotionResultsStructure => {
9
9
  const trials = emotion_extract_trials(obj);
10
10
  // throw if trials is empty
11
11
  if (trials.length === 0) {
@@ -14,7 +14,7 @@ const emotion_calculate_results = (obj: any[]): EmotionResults => {
14
14
  return emotion_results(trials);
15
15
  };
16
16
 
17
- const emotion_results = (obj: any[]): EmotionResults => {
17
+ const emotion_results = (obj: any[]): EmotionResultsStructure => {
18
18
  // throw error if obj is empty
19
19
  if (obj.length === 0) {
20
20
  throw new Error("No trials found");
@@ -56,4 +56,4 @@ const emotion_extract_trials = (obj: any[]) => {
56
56
  return trials;
57
57
  }
58
58
 
59
- export { emotion_calculate_results, emotion_extract_trials, emotion_results };
59
+ export {EmotionResultsStructure, emotion_calculate_results, emotion_extract_trials, emotion_results };
package/src/gonogo.ts CHANGED
@@ -1,11 +1,11 @@
1
- interface GonogoResults {
1
+ interface GonogoResultsStructure {
2
2
  n: number;
3
3
  avg_rt: number;
4
4
  avg_acc: number;
5
5
  performance: number;
6
6
  }
7
7
 
8
- const gonogo_calculate_results = (data: any[]): GonogoResults => {
8
+ const gonogo_calculate_results = (data: any[]): GonogoResultsStructure => {
9
9
  const trials = gonogo_extract_trials(data);
10
10
  const results = gonogo_results(trials);
11
11
  return results;
@@ -54,7 +54,7 @@ const gonogo_extract_trials = (obj: any[]): any[] => {
54
54
  return trials;
55
55
  }
56
56
 
57
- const gonogo_results = (data: any[]): GonogoResults => {
57
+ const gonogo_results = (data: any[]): GonogoResultsStructure => {
58
58
  // throw error if obj is empty
59
59
  if (data.length === 0) {
60
60
  throw new Error("No trials found");
@@ -73,4 +73,4 @@ const gonogo_results = (data: any[]): GonogoResults => {
73
73
  return results;
74
74
  }
75
75
 
76
- export { gonogo_calculate_results, gonogo_extract_trials, gonogo_results };
76
+ export { GonogoResultsStructure, gonogo_calculate_results, gonogo_extract_trials, gonogo_results };
package/src/index.ts CHANGED
@@ -1,12 +1,23 @@
1
- import { NBackResults, nback_calculate_results } from './nback';
2
- import { spatial_calculate_results, SpatialResults } from './spatial-cognition';
1
+ import { NbackResultsStructure, nback_calculate_results } from './nback';
2
+ import { SpatialResultsStructure, spatial_calculate_results } from './spatial-cognition';
3
+ import { GonogoResultsStructure, gonogo_calculate_results } from './gonogo';
4
+ import { EmotionResultsStructure, emotion_calculate_results } from './emotions';
3
5
 
4
- const NbackResults = (obj: any[]): NBackResults => {
6
+ const NbackResults = (obj: any[]): NbackResultsStructure => {
5
7
  return nback_calculate_results(obj);
6
8
  }
7
9
 
8
- const SpatialCognitionResults = (obj: any[]): SpatialResults => {
10
+ const SpatialCognitionResults = (obj: any[]): SpatialResultsStructure => {
9
11
  return spatial_calculate_results(obj);
10
12
  }
11
13
 
12
- export { NbackResults, SpatialCognitionResults };
14
+ const GonogoResults = (obj: any[]): GonogoResultsStructure => {
15
+ return gonogo_calculate_results(obj);
16
+ }
17
+
18
+ const EmotionResults = (obj: any[]): EmotionResultsStructure => {
19
+ return emotion_calculate_results(obj);
20
+ }
21
+
22
+ export { NbackResults, SpatialCognitionResults,
23
+ EmotionResults, GonogoResults };
package/src/nback.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // from the passed json extract those objects that have field is_target
2
- const nback_calculate_results = (obj: any[]): NBackResults => {
2
+ const nback_calculate_results = (obj: any[]): NbackResultsStructure => {
3
3
  const trials = nback_extract_trials(obj);
4
4
  return nback_results(trials);
5
5
  }
@@ -9,20 +9,20 @@ const nback_extract_trials = (obj: any[]): any[] => {
9
9
  return trials;
10
10
  }
11
11
 
12
- interface NbackTrialResults {
12
+ interface NbackTrialResultsStructure {
13
13
  n: number;
14
14
  avg_rt: number;
15
15
  avg_acc: number;
16
16
  }
17
17
 
18
- interface NBackResults {
19
- total_trials: NbackTrialResults;
20
- target_trials: NbackTrialResults;
21
- non_target_trials: NbackTrialResults;
18
+ interface NbackResultsStructure {
19
+ total_trials: NbackTrialResultsStructure;
20
+ target_trials: NbackTrialResultsStructure;
21
+ non_target_trials: NbackTrialResultsStructure;
22
22
  performance: number;
23
23
  }
24
24
 
25
- const nback_results = (trials: any[]): NBackResults => {
25
+ const nback_results = (trials: any[]): NbackResultsStructure => {
26
26
  const target_trials = trials.filter((o: any) => o.is_target);
27
27
  const non_target_trials = trials.filter((o: any) => !o.is_target);
28
28
 
@@ -50,4 +50,4 @@ const nback_results = (trials: any[]): NBackResults => {
50
50
  }
51
51
 
52
52
  export { nback_extract_trials, nback_results,
53
- nback_calculate_results, NBackResults };
53
+ nback_calculate_results, NbackResultsStructure };
@@ -1,11 +1,11 @@
1
- interface SpatialResults {
1
+ interface SpatialResultsStructure {
2
2
  n: number;
3
3
  avg_rt: number;
4
4
  avg_acc: number;
5
5
  performance: number;
6
6
  }
7
7
 
8
- const spatial_calculate_results = (obj: any[]): SpatialResults => {
8
+ const spatial_calculate_results = (obj: any[]): SpatialResultsStructure => {
9
9
  const trials = spatial_extract_trials(obj);
10
10
  return spatial_results(trials);
11
11
  }
@@ -17,7 +17,7 @@ const spatial_extract_trials = (obj: any[]) => {
17
17
  return trials;
18
18
  }
19
19
 
20
- const spatial_results = (obj: any[]): SpatialResults => {
20
+ const spatial_results = (obj: any[]): SpatialResultsStructure => {
21
21
  const results = {
22
22
  n: obj.length,
23
23
  avg_rt: obj.reduce((a, b) => a + b.rt, 0) / obj.length,
@@ -52,4 +52,4 @@ const spatial_extract_image_info = (obj: any[]) => {
52
52
  }
53
53
 
54
54
  export { spatial_extract_image_info, spatial_extract_trials,
55
- spatial_results, spatial_calculate_results, SpatialResults };
55
+ spatial_results, spatial_calculate_results, SpatialResultsStructure };