@quesmed/types 1.3.18 → 1.4.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/gql_input_output_types/User.js +2 -1
- package/gql_input_output_types/User.mjs +1 -0
- package/gql_input_output_types/index.d.ts +1 -0
- package/gql_input_output_types/index.js +2 -1
- package/gql_input_output_types/index.mjs +1 -0
- package/index.js +7 -4
- package/{index.cjs → index.mjs} +4 -7
- package/models/Author.js +2 -1
- package/models/Author.mjs +1 -0
- package/models/Book.js +2 -1
- package/models/Book.mjs +1 -0
- package/models/Card.js +2 -1
- package/models/Card.mjs +1 -0
- package/models/Chapter.js +2 -1
- package/models/Chapter.mjs +1 -0
- package/models/Concept.js +2 -1
- package/models/Concept.mjs +1 -0
- package/models/Difficulty.js +5 -2
- package/models/{Difficulty.cjs → Difficulty.mjs} +2 -5
- package/models/Feedback.js +2 -1
- package/models/Feedback.mjs +1 -0
- package/models/File.js +2 -1
- package/models/File.mjs +1 -0
- package/models/Marksheet.js +5 -2
- package/models/Marksheet.mjs +6 -0
- package/models/MockTest.js +2 -1
- package/models/MockTest.mjs +1 -0
- package/models/OsceMarksheet.js +7 -4
- package/models/{OsceMarksheet.cjs → OsceMarksheet.mjs} +4 -7
- package/models/OsceStation.js +6 -3
- package/models/{OsceStation.cjs → OsceStation.mjs} +3 -6
- package/models/Picture.js +2 -1
- package/models/Picture.mjs +5 -0
- package/models/Promo.js +2 -1
- package/models/Promo.mjs +1 -0
- package/models/Question.js +15 -8
- package/models/{Question.cjs → Question.mjs} +8 -15
- package/models/Subscription.js +5 -2
- package/models/{Subscription.cjs → Subscription.mjs} +2 -5
- package/models/Todo.js +2 -1
- package/models/Todo.mjs +1 -0
- package/models/Token.js +2 -1
- package/models/Token.mjs +1 -0
- package/models/Topic.js +5 -2
- package/models/{Topic.cjs → Topic.mjs} +2 -5
- package/models/Type.js +2 -1
- package/models/Type.mjs +1 -0
- package/models/University.js +2 -1
- package/models/University.mjs +1 -0
- package/models/User.js +2 -1
- package/models/User.mjs +1 -0
- package/models/Video.js +2 -1
- package/models/Video.mjs +1 -0
- package/models/index.js +35 -23
- package/models/index.mjs +23 -0
- package/package.json +5 -4
- package/resolvers/apollo.js +2 -1
- package/resolvers/apollo.mjs +1 -0
- package/resolvers/fragments/chapter.d.ts +2 -0
- package/resolvers/fragments/chapter.js +31 -0
- package/resolvers/fragments/chapter.mjs +28 -0
- package/resolvers/fragments/concept.d.ts +3 -0
- package/resolvers/fragments/concept.js +79 -0
- package/resolvers/fragments/concept.mjs +76 -0
- package/resolvers/fragments/osce.d.ts +10 -0
- package/resolvers/fragments/osce.js +171 -0
- package/resolvers/fragments/osce.mjs +168 -0
- package/resolvers/fragments/picture.d.ts +3 -0
- package/resolvers/fragments/picture.js +44 -0
- package/resolvers/fragments/picture.mjs +41 -0
- package/resolvers/fragments/user.d.ts +1 -0
- package/resolvers/fragments/user.js +26 -0
- package/resolvers/fragments/user.mjs +23 -0
- package/resolvers/fragments/video.d.ts +2 -0
- package/resolvers/fragments/video.js +49 -0
- package/resolvers/fragments/video.mjs +46 -0
- package/resolvers/mutation/admin/algoliaSync.js +2 -1
- package/resolvers/mutation/admin/algoliaSync.mjs +1 -0
- package/resolvers/mutation/admin/index.js +14 -2
- package/resolvers/mutation/admin/index.mjs +2 -0
- package/resolvers/mutation/admin/token.js +2 -1
- package/resolvers/mutation/admin/token.mjs +1 -0
- package/resolvers/mutation/index.js +14 -2
- package/resolvers/mutation/index.mjs +2 -0
- package/resolvers/mutation/restricted/agora.js +2 -1
- package/resolvers/mutation/restricted/agora.mjs +1 -0
- package/resolvers/mutation/restricted/contactUs.js +2 -1
- package/resolvers/mutation/restricted/contactUs.mjs +1 -0
- package/resolvers/mutation/restricted/index.js +22 -10
- package/resolvers/mutation/restricted/index.mjs +10 -0
- package/resolvers/mutation/restricted/marksheet.js +2 -1
- package/resolvers/mutation/restricted/marksheet.mjs +1 -0
- package/resolvers/mutation/restricted/mockTest.js +2 -1
- package/resolvers/mutation/restricted/mockTest.mjs +1 -0
- package/resolvers/mutation/restricted/osce.d.ts +34 -23
- package/resolvers/mutation/restricted/osce.js +202 -1
- package/resolvers/mutation/restricted/osce.mjs +198 -0
- package/resolvers/mutation/restricted/questionDiscussion.js +2 -1
- package/resolvers/mutation/restricted/questionDiscussion.mjs +1 -0
- package/resolvers/mutation/restricted/todo.js +7 -3
- package/resolvers/mutation/restricted/{todo.cjs → todo.mjs} +3 -7
- package/resolvers/mutation/restricted/token.js +2 -1
- package/resolvers/mutation/restricted/token.mjs +1 -0
- package/resolvers/mutation/restricted/users.js +2 -1
- package/resolvers/mutation/restricted/users.mjs +1 -0
- package/resolvers/mutation/restricted/video.js +2 -1
- package/resolvers/mutation/restricted/video.mjs +1 -0
- package/resolvers/mutation/stripe.js +2 -1
- package/resolvers/mutation/stripe.mjs +1 -0
- package/resolvers/mutation/users.js +2 -1
- package/resolvers/mutation/users.mjs +1 -0
- package/resolvers/mutation/validUserToken/index.js +13 -1
- package/resolvers/mutation/validUserToken/index.mjs +1 -0
- package/resolvers/mutation/validUserToken/user.js +2 -1
- package/resolvers/mutation/validUserToken/user.mjs +1 -0
- package/resolvers/query/admin/getUserToken.js +2 -1
- package/resolvers/query/admin/getUserToken.mjs +1 -0
- package/resolvers/query/admin/index.js +13 -1
- package/resolvers/query/admin/index.mjs +1 -0
- package/resolvers/query/author.js +2 -1
- package/resolvers/query/author.mjs +1 -0
- package/resolvers/query/book.js +2 -1
- package/resolvers/query/book.mjs +1 -0
- package/resolvers/query/feedback.js +2 -1
- package/resolvers/query/feedback.mjs +1 -0
- package/resolvers/query/index.js +21 -9
- package/resolvers/query/index.mjs +9 -0
- package/resolvers/query/restricted/anatomy.js +2 -1
- package/resolvers/query/restricted/anatomy.mjs +1 -0
- package/resolvers/query/restricted/index.d.ts +1 -0
- package/resolvers/query/restricted/index.js +23 -10
- package/resolvers/query/restricted/index.mjs +11 -0
- package/resolvers/query/restricted/marksheet.js +2 -1
- package/resolvers/query/restricted/marksheet.mjs +1 -0
- package/resolvers/query/restricted/mockTests.js +2 -1
- package/resolvers/query/restricted/mockTests.mjs +1 -0
- package/resolvers/query/restricted/osce.d.ts +23 -18
- package/resolvers/query/restricted/osce.js +93 -1
- package/resolvers/query/restricted/osce.mjs +90 -0
- package/resolvers/query/restricted/quesBook.d.ts +3 -1
- package/resolvers/query/restricted/quesBook.js +15 -1
- package/resolvers/query/restricted/quesBook.mjs +12 -0
- package/resolvers/query/restricted/replication.d.ts +33 -0
- package/resolvers/query/restricted/replication.js +184 -0
- package/resolvers/query/restricted/replication.mjs +178 -0
- package/resolvers/query/restricted/todos.js +2 -1
- package/resolvers/query/restricted/todos.mjs +1 -0
- package/resolvers/query/restricted/topics.js +2 -1
- package/resolvers/query/restricted/topics.mjs +1 -0
- package/resolvers/query/restricted/university.js +2 -1
- package/resolvers/query/restricted/university.mjs +1 -0
- package/resolvers/query/restricted/user.js +2 -1
- package/resolvers/query/restricted/user.mjs +1 -0
- package/resolvers/query/restricted/video.js +2 -1
- package/resolvers/query/restricted/video.mjs +1 -0
- package/resolvers/query/sampleCards.js +2 -1
- package/resolvers/query/sampleCards.mjs +1 -0
- package/resolvers/query/sampleQuestions.js +2 -1
- package/resolvers/query/sampleQuestions.mjs +1 -0
- package/resolvers/query/subscription.js +2 -1
- package/resolvers/query/subscription.mjs +1 -0
- package/resolvers/query/university.js +2 -1
- package/resolvers/query/university.mjs +1 -0
- package/resolvers/query/user.js +2 -1
- package/resolvers/query/user.mjs +1 -0
- package/resolvers/query/video.js +2 -1
- package/resolvers/query/video.mjs +1 -0
- package/resolvers/subscription/index.js +13 -1
- package/resolvers/subscription/index.mjs +1 -0
- package/resolvers/subscription/osce.d.ts +14 -7
- package/resolvers/subscription/osce.js +45 -10
- package/resolvers/subscription/osce.mjs +70 -0
- package/resolvers/types.d.ts +9 -0
- package/{gql_input_output_types/User.cjs → resolvers/types.js} +0 -0
- package/resolvers/types.mjs +1 -0
- package/utils/commonFunctions.js +17 -11
- package/utils/{commonFunctions.cjs → commonFunctions.mjs} +11 -17
- package/utils/index.js +17 -5
- package/utils/index.mjs +5 -0
- package/utils/lightgallery.js +5 -1
- package/utils/{lightgallery.cjs → lightgallery.mjs} +1 -5
- package/utils/offlineLink.js +16 -9
- package/utils/{offlineLink.cjs → offlineLink.mjs} +9 -16
- package/utils/uuid4.js +3 -1
- package/utils/{uuid4.cjs → uuid4.mjs} +1 -3
- package/utils/wordsToNumber.js +5 -1
- package/utils/{wordsToNumber.cjs → wordsToNumber.mjs} +1 -5
- package/gql_input_output_types/index.cjs +0 -2
- package/models/Author.cjs +0 -2
- package/models/Book.cjs +0 -2
- package/models/Card.cjs +0 -2
- package/models/Chapter.cjs +0 -2
- package/models/Concept.cjs +0 -2
- package/models/Feedback.cjs +0 -2
- package/models/File.cjs +0 -2
- package/models/Marksheet.cjs +0 -9
- package/models/MockTest.cjs +0 -2
- package/models/Picture.cjs +0 -6
- package/models/Promo.cjs +0 -2
- package/models/Todo.cjs +0 -2
- package/models/Token.cjs +0 -2
- package/models/Type.cjs +0 -2
- package/models/University.cjs +0 -2
- package/models/User.cjs +0 -2
- package/models/Video.cjs +0 -2
- package/models/index.cjs +0 -35
- package/resolvers/apollo.cjs +0 -2
- package/resolvers/mutation/admin/algoliaSync.cjs +0 -2
- package/resolvers/mutation/admin/index.cjs +0 -14
- package/resolvers/mutation/admin/token.cjs +0 -2
- package/resolvers/mutation/index.cjs +0 -14
- package/resolvers/mutation/restricted/agora.cjs +0 -2
- package/resolvers/mutation/restricted/contactUs.cjs +0 -2
- package/resolvers/mutation/restricted/index.cjs +0 -22
- package/resolvers/mutation/restricted/marksheet.cjs +0 -2
- package/resolvers/mutation/restricted/mockTest.cjs +0 -2
- package/resolvers/mutation/restricted/osce.cjs +0 -2
- package/resolvers/mutation/restricted/questionDiscussion.cjs +0 -2
- package/resolvers/mutation/restricted/token.cjs +0 -2
- package/resolvers/mutation/restricted/users.cjs +0 -2
- package/resolvers/mutation/restricted/video.cjs +0 -2
- package/resolvers/mutation/stripe.cjs +0 -2
- package/resolvers/mutation/users.cjs +0 -2
- package/resolvers/mutation/validUserToken/index.cjs +0 -13
- package/resolvers/mutation/validUserToken/user.cjs +0 -2
- package/resolvers/query/admin/getUserToken.cjs +0 -2
- package/resolvers/query/admin/index.cjs +0 -13
- package/resolvers/query/author.cjs +0 -2
- package/resolvers/query/book.cjs +0 -2
- package/resolvers/query/feedback.cjs +0 -2
- package/resolvers/query/index.cjs +0 -21
- package/resolvers/query/restricted/anatomy.cjs +0 -2
- package/resolvers/query/restricted/index.cjs +0 -22
- package/resolvers/query/restricted/marksheet.cjs +0 -2
- package/resolvers/query/restricted/mockTests.cjs +0 -2
- package/resolvers/query/restricted/osce.cjs +0 -2
- package/resolvers/query/restricted/quesBook.cjs +0 -2
- package/resolvers/query/restricted/todos.cjs +0 -2
- package/resolvers/query/restricted/topics.cjs +0 -2
- package/resolvers/query/restricted/university.cjs +0 -2
- package/resolvers/query/restricted/user.cjs +0 -2
- package/resolvers/query/restricted/video.cjs +0 -2
- package/resolvers/query/sampleCards.cjs +0 -2
- package/resolvers/query/sampleQuestions.cjs +0 -2
- package/resolvers/query/subscription.cjs +0 -2
- package/resolvers/query/university.cjs +0 -2
- package/resolvers/query/user.cjs +0 -2
- package/resolvers/query/video.cjs +0 -2
- package/resolvers/subscription/index.cjs +0 -13
- package/resolvers/subscription/osce.cjs +0 -43
- package/utils/index.cjs +0 -17
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OSCE_MATCHMAKING_USERS = exports.OSCE_MATCHMAKING = exports.OSCE_MARKSHEET_ACTION = exports.OSCE_ROLE_CHANGE = exports.OsceGroupInit = exports.OSCE_MATCHMAKING_USERS_KEY = exports.OSCE_MATCHMAKING_KEY = exports.OSCE_MARKSHEET_ACTION_KEY = exports.OSCE_ROLE_CHANGE_KEY = void 0;
|
|
4
|
+
const client_1 = require("@apollo/client");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
const osce_1 = require("../fragments/osce");
|
|
7
|
+
exports.OSCE_ROLE_CHANGE_KEY = 'OSCE_ROLE_CHANGE';
|
|
8
|
+
exports.OSCE_MARKSHEET_ACTION_KEY = 'OSCE_MARKSHEET_ACTION';
|
|
9
|
+
exports.OSCE_MATCHMAKING_KEY = 'OSCE_MATCHMAKING';
|
|
10
|
+
exports.OSCE_MATCHMAKING_USERS_KEY = 'OSCE_MATCHMAKING_USERS';
|
|
11
|
+
const OsceGroupInit = (osceMarksheetId) => [
|
|
7
12
|
{
|
|
8
13
|
id: null,
|
|
9
14
|
createdAt: null,
|
|
10
15
|
osceMarksheetId,
|
|
11
16
|
userId: null,
|
|
12
17
|
user: null,
|
|
13
|
-
role: EOsceRoles.CANDIDATE,
|
|
18
|
+
role: models_1.EOsceRoles.CANDIDATE,
|
|
14
19
|
},
|
|
15
20
|
{
|
|
16
21
|
id: null,
|
|
@@ -18,7 +23,7 @@ export const OsceGroupInit = (osceMarksheetId) => [
|
|
|
18
23
|
osceMarksheetId,
|
|
19
24
|
userId: null,
|
|
20
25
|
user: null,
|
|
21
|
-
role: EOsceRoles.EXAMINER,
|
|
26
|
+
role: models_1.EOsceRoles.EXAMINER,
|
|
22
27
|
},
|
|
23
28
|
{
|
|
24
29
|
id: null,
|
|
@@ -26,7 +31,7 @@ export const OsceGroupInit = (osceMarksheetId) => [
|
|
|
26
31
|
osceMarksheetId,
|
|
27
32
|
userId: null,
|
|
28
33
|
user: null,
|
|
29
|
-
role: EOsceRoles.ACTOR,
|
|
34
|
+
role: models_1.EOsceRoles.ACTOR,
|
|
30
35
|
},
|
|
31
36
|
{
|
|
32
37
|
id: null,
|
|
@@ -34,6 +39,36 @@ export const OsceGroupInit = (osceMarksheetId) => [
|
|
|
34
39
|
osceMarksheetId,
|
|
35
40
|
userId: null,
|
|
36
41
|
user: null,
|
|
37
|
-
role: EOsceRoles.OBSERVER,
|
|
42
|
+
role: models_1.EOsceRoles.OBSERVER,
|
|
38
43
|
},
|
|
39
44
|
];
|
|
45
|
+
exports.OsceGroupInit = OsceGroupInit;
|
|
46
|
+
exports.OSCE_ROLE_CHANGE = (0, client_1.gql) `
|
|
47
|
+
${osce_1.OSCE_GROUP_FIELDS}
|
|
48
|
+
subscription osceRoleChangeSubscription($osceMarksheetId: Int!) {
|
|
49
|
+
osceRoleChange(osceMarksheetId: $osceMarksheetId) {
|
|
50
|
+
...OsceGroupFields
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
exports.OSCE_MARKSHEET_ACTION = (0, client_1.gql) `
|
|
55
|
+
${osce_1.OSCE_MARKSHEET_ACTION_FIELDS}
|
|
56
|
+
subscription OsceMarksheetAction($osceMarksheetId: Int!) {
|
|
57
|
+
osceMarksheetAction(osceMarksheetId: $osceMarksheetId) {
|
|
58
|
+
...OsceMarksheetActionFields
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
exports.OSCE_MATCHMAKING = (0, client_1.gql) `
|
|
63
|
+
${osce_1.OSCE_MATCHMAKING_ACTION_FIELDS}
|
|
64
|
+
subscription OsceMatchmaking($userId: Int!) {
|
|
65
|
+
osceMatchmaking(userId: $userId) {
|
|
66
|
+
...OsceMatchmakingActionFields
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
exports.OSCE_MATCHMAKING_USERS = (0, client_1.gql) `
|
|
71
|
+
subscription OsceMatchmakingUsers {
|
|
72
|
+
osceMatchmakingUsers
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
import { EOsceRoles, } from '../../models';
|
|
3
|
+
import { OSCE_GROUP_FIELDS, OSCE_MARKSHEET_ACTION_FIELDS, OSCE_MATCHMAKING_ACTION_FIELDS, } from '../fragments/osce';
|
|
4
|
+
export const OSCE_ROLE_CHANGE_KEY = 'OSCE_ROLE_CHANGE';
|
|
5
|
+
export const OSCE_MARKSHEET_ACTION_KEY = 'OSCE_MARKSHEET_ACTION';
|
|
6
|
+
export const OSCE_MATCHMAKING_KEY = 'OSCE_MATCHMAKING';
|
|
7
|
+
export const OSCE_MATCHMAKING_USERS_KEY = 'OSCE_MATCHMAKING_USERS';
|
|
8
|
+
export const OsceGroupInit = (osceMarksheetId) => [
|
|
9
|
+
{
|
|
10
|
+
id: null,
|
|
11
|
+
createdAt: null,
|
|
12
|
+
osceMarksheetId,
|
|
13
|
+
userId: null,
|
|
14
|
+
user: null,
|
|
15
|
+
role: EOsceRoles.CANDIDATE,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: null,
|
|
19
|
+
createdAt: null,
|
|
20
|
+
osceMarksheetId,
|
|
21
|
+
userId: null,
|
|
22
|
+
user: null,
|
|
23
|
+
role: EOsceRoles.EXAMINER,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: null,
|
|
27
|
+
createdAt: null,
|
|
28
|
+
osceMarksheetId,
|
|
29
|
+
userId: null,
|
|
30
|
+
user: null,
|
|
31
|
+
role: EOsceRoles.ACTOR,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: null,
|
|
35
|
+
createdAt: null,
|
|
36
|
+
osceMarksheetId,
|
|
37
|
+
userId: null,
|
|
38
|
+
user: null,
|
|
39
|
+
role: EOsceRoles.OBSERVER,
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
export const OSCE_ROLE_CHANGE = gql `
|
|
43
|
+
${OSCE_GROUP_FIELDS}
|
|
44
|
+
subscription osceRoleChangeSubscription($osceMarksheetId: Int!) {
|
|
45
|
+
osceRoleChange(osceMarksheetId: $osceMarksheetId) {
|
|
46
|
+
...OsceGroupFields
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
export const OSCE_MARKSHEET_ACTION = gql `
|
|
51
|
+
${OSCE_MARKSHEET_ACTION_FIELDS}
|
|
52
|
+
subscription OsceMarksheetAction($osceMarksheetId: Int!) {
|
|
53
|
+
osceMarksheetAction(osceMarksheetId: $osceMarksheetId) {
|
|
54
|
+
...OsceMarksheetActionFields
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
export const OSCE_MATCHMAKING = gql `
|
|
59
|
+
${OSCE_MATCHMAKING_ACTION_FIELDS}
|
|
60
|
+
subscription OsceMatchmaking($userId: Int!) {
|
|
61
|
+
osceMatchmaking(userId: $userId) {
|
|
62
|
+
...OsceMatchmakingActionFields
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
export const OSCE_MATCHMAKING_USERS = gql `
|
|
67
|
+
subscription OsceMatchmakingUsers {
|
|
68
|
+
osceMatchmakingUsers
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/utils/commonFunctions.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.correctMark = exports.formatPrescribeAnswer = exports.mapPrescribeMarkToAnswer = void 0;
|
|
4
|
+
const models_1 = require("../models");
|
|
5
|
+
const wordsToNumber_1 = require("./wordsToNumber");
|
|
3
6
|
const floatRegex = /([0-9]*[.])?[0-9]+/gm;
|
|
4
7
|
const ACCEPTED_FREQ = ['stat', 'od', 'bd', 'tds', 'qds'];
|
|
5
|
-
|
|
8
|
+
function mapPrescribeMarkToAnswer(obj) {
|
|
6
9
|
return {
|
|
7
10
|
drug: {
|
|
8
11
|
value: obj.drug,
|
|
@@ -30,7 +33,8 @@ export function mapPrescribeMarkToAnswer(obj) {
|
|
|
30
33
|
},
|
|
31
34
|
};
|
|
32
35
|
}
|
|
33
|
-
|
|
36
|
+
exports.mapPrescribeMarkToAnswer = mapPrescribeMarkToAnswer;
|
|
37
|
+
function formatPrescribeAnswer(obj) {
|
|
34
38
|
obj.drug.value = obj.drug.value.toLowerCase().replace(/\s/g, '');
|
|
35
39
|
obj.route.value = obj.route.value.toLowerCase().replace(/\s/g, '');
|
|
36
40
|
if (obj.route.value === 'oral') {
|
|
@@ -75,7 +79,7 @@ export function formatPrescribeAnswer(obj) {
|
|
|
75
79
|
}
|
|
76
80
|
m.forEach((match) => durationMatches.add(match));
|
|
77
81
|
}
|
|
78
|
-
const durationWords = wordsToNumber(obj.duration.value, false);
|
|
82
|
+
const durationWords = (0, wordsToNumber_1.wordsToNumber)(obj.duration.value, false);
|
|
79
83
|
if (durationWords !== 0) {
|
|
80
84
|
durationMatches.add(durationWords.toString());
|
|
81
85
|
}
|
|
@@ -104,12 +108,13 @@ export function formatPrescribeAnswer(obj) {
|
|
|
104
108
|
obj.frequency.value = 'qds';
|
|
105
109
|
}
|
|
106
110
|
else if (!ACCEPTED_FREQ.includes(obj.frequency.value)) {
|
|
107
|
-
obj.frequency.value = wordsToNumber(orgFrequencyValue, true).toString();
|
|
111
|
+
obj.frequency.value = (0, wordsToNumber_1.wordsToNumber)(orgFrequencyValue, true).toString();
|
|
108
112
|
}
|
|
109
113
|
return obj;
|
|
110
114
|
}
|
|
115
|
+
exports.formatPrescribeAnswer = formatPrescribeAnswer;
|
|
111
116
|
const answerRegex = /answer/gi;
|
|
112
|
-
|
|
117
|
+
function correctMark(mark) {
|
|
113
118
|
const data = {
|
|
114
119
|
correct: false,
|
|
115
120
|
incorrect: false,
|
|
@@ -124,7 +129,7 @@ export function correctMark(mark) {
|
|
|
124
129
|
const answer = mark.question[answerKey];
|
|
125
130
|
const flatAnswer = answer[0];
|
|
126
131
|
const flatAttempt = mark.mark[0];
|
|
127
|
-
if (EQuestionType.SINGLE_BEST_ANSWER === mark.question.typeId) {
|
|
132
|
+
if (models_1.EQuestionType.SINGLE_BEST_ANSWER === mark.question.typeId) {
|
|
128
133
|
const answer = flatAnswer;
|
|
129
134
|
const attempt = flatAttempt;
|
|
130
135
|
if (answer === attempt) {
|
|
@@ -134,7 +139,7 @@ export function correctMark(mark) {
|
|
|
134
139
|
data.incorrect = true;
|
|
135
140
|
}
|
|
136
141
|
}
|
|
137
|
-
else if (EQuestionType.QUESTION_ANSWER === mark.question.typeId) {
|
|
142
|
+
else if (models_1.EQuestionType.QUESTION_ANSWER === mark.question.typeId) {
|
|
138
143
|
const answer = flatAnswer.dose.toLowerCase().replace(/\s/g, '');
|
|
139
144
|
let attempt = '';
|
|
140
145
|
if (flatAttempt) {
|
|
@@ -147,7 +152,7 @@ export function correctMark(mark) {
|
|
|
147
152
|
data.incorrect = true;
|
|
148
153
|
}
|
|
149
154
|
}
|
|
150
|
-
else if (EQuestionType.MULTIPLE_ANSWERS === mark.question.typeId) {
|
|
155
|
+
else if (models_1.EQuestionType.MULTIPLE_ANSWERS === mark.question.typeId) {
|
|
151
156
|
const [answerA, answerB] = answer.map((x) => x.sort());
|
|
152
157
|
let [attemptA, attemptB] = [[], []];
|
|
153
158
|
if (Array.isArray(mark.mark) &&
|
|
@@ -167,7 +172,7 @@ export function correctMark(mark) {
|
|
|
167
172
|
data.incorrect = true;
|
|
168
173
|
}
|
|
169
174
|
}
|
|
170
|
-
else if (EQuestionType.PRESCRIPTION_ANSWER === mark.question.typeId) {
|
|
175
|
+
else if (models_1.EQuestionType.PRESCRIPTION_ANSWER === mark.question.typeId) {
|
|
171
176
|
const answers = answer.map(formatPrescribeAnswer);
|
|
172
177
|
let attempt = formatPrescribeAnswer(mapPrescribeMarkToAnswer({
|
|
173
178
|
drug: '',
|
|
@@ -215,3 +220,4 @@ export function correctMark(mark) {
|
|
|
215
220
|
}
|
|
216
221
|
return data;
|
|
217
222
|
}
|
|
223
|
+
exports.correctMark = correctMark;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.correctMark = exports.formatPrescribeAnswer = exports.mapPrescribeMarkToAnswer = void 0;
|
|
4
|
-
const models_1 = require("../models");
|
|
5
|
-
const wordsToNumber_1 = require("./wordsToNumber");
|
|
1
|
+
import { EQuestionType, } from '../models';
|
|
2
|
+
import { wordsToNumber } from './wordsToNumber';
|
|
6
3
|
const floatRegex = /([0-9]*[.])?[0-9]+/gm;
|
|
7
4
|
const ACCEPTED_FREQ = ['stat', 'od', 'bd', 'tds', 'qds'];
|
|
8
|
-
function mapPrescribeMarkToAnswer(obj) {
|
|
5
|
+
export function mapPrescribeMarkToAnswer(obj) {
|
|
9
6
|
return {
|
|
10
7
|
drug: {
|
|
11
8
|
value: obj.drug,
|
|
@@ -33,8 +30,7 @@ function mapPrescribeMarkToAnswer(obj) {
|
|
|
33
30
|
},
|
|
34
31
|
};
|
|
35
32
|
}
|
|
36
|
-
|
|
37
|
-
function formatPrescribeAnswer(obj) {
|
|
33
|
+
export function formatPrescribeAnswer(obj) {
|
|
38
34
|
obj.drug.value = obj.drug.value.toLowerCase().replace(/\s/g, '');
|
|
39
35
|
obj.route.value = obj.route.value.toLowerCase().replace(/\s/g, '');
|
|
40
36
|
if (obj.route.value === 'oral') {
|
|
@@ -79,7 +75,7 @@ function formatPrescribeAnswer(obj) {
|
|
|
79
75
|
}
|
|
80
76
|
m.forEach((match) => durationMatches.add(match));
|
|
81
77
|
}
|
|
82
|
-
const durationWords =
|
|
78
|
+
const durationWords = wordsToNumber(obj.duration.value, false);
|
|
83
79
|
if (durationWords !== 0) {
|
|
84
80
|
durationMatches.add(durationWords.toString());
|
|
85
81
|
}
|
|
@@ -108,13 +104,12 @@ function formatPrescribeAnswer(obj) {
|
|
|
108
104
|
obj.frequency.value = 'qds';
|
|
109
105
|
}
|
|
110
106
|
else if (!ACCEPTED_FREQ.includes(obj.frequency.value)) {
|
|
111
|
-
obj.frequency.value =
|
|
107
|
+
obj.frequency.value = wordsToNumber(orgFrequencyValue, true).toString();
|
|
112
108
|
}
|
|
113
109
|
return obj;
|
|
114
110
|
}
|
|
115
|
-
exports.formatPrescribeAnswer = formatPrescribeAnswer;
|
|
116
111
|
const answerRegex = /answer/gi;
|
|
117
|
-
function correctMark(mark) {
|
|
112
|
+
export function correctMark(mark) {
|
|
118
113
|
const data = {
|
|
119
114
|
correct: false,
|
|
120
115
|
incorrect: false,
|
|
@@ -129,7 +124,7 @@ function correctMark(mark) {
|
|
|
129
124
|
const answer = mark.question[answerKey];
|
|
130
125
|
const flatAnswer = answer[0];
|
|
131
126
|
const flatAttempt = mark.mark[0];
|
|
132
|
-
if (
|
|
127
|
+
if (EQuestionType.SINGLE_BEST_ANSWER === mark.question.typeId) {
|
|
133
128
|
const answer = flatAnswer;
|
|
134
129
|
const attempt = flatAttempt;
|
|
135
130
|
if (answer === attempt) {
|
|
@@ -139,7 +134,7 @@ function correctMark(mark) {
|
|
|
139
134
|
data.incorrect = true;
|
|
140
135
|
}
|
|
141
136
|
}
|
|
142
|
-
else if (
|
|
137
|
+
else if (EQuestionType.QUESTION_ANSWER === mark.question.typeId) {
|
|
143
138
|
const answer = flatAnswer.dose.toLowerCase().replace(/\s/g, '');
|
|
144
139
|
let attempt = '';
|
|
145
140
|
if (flatAttempt) {
|
|
@@ -152,7 +147,7 @@ function correctMark(mark) {
|
|
|
152
147
|
data.incorrect = true;
|
|
153
148
|
}
|
|
154
149
|
}
|
|
155
|
-
else if (
|
|
150
|
+
else if (EQuestionType.MULTIPLE_ANSWERS === mark.question.typeId) {
|
|
156
151
|
const [answerA, answerB] = answer.map((x) => x.sort());
|
|
157
152
|
let [attemptA, attemptB] = [[], []];
|
|
158
153
|
if (Array.isArray(mark.mark) &&
|
|
@@ -172,7 +167,7 @@ function correctMark(mark) {
|
|
|
172
167
|
data.incorrect = true;
|
|
173
168
|
}
|
|
174
169
|
}
|
|
175
|
-
else if (
|
|
170
|
+
else if (EQuestionType.PRESCRIPTION_ANSWER === mark.question.typeId) {
|
|
176
171
|
const answers = answer.map(formatPrescribeAnswer);
|
|
177
172
|
let attempt = formatPrescribeAnswer(mapPrescribeMarkToAnswer({
|
|
178
173
|
drug: '',
|
|
@@ -220,4 +215,3 @@ function correctMark(mark) {
|
|
|
220
215
|
}
|
|
221
216
|
return data;
|
|
222
217
|
}
|
|
223
|
-
exports.correctMark = correctMark;
|
package/utils/index.js
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./commonFunctions"), exports);
|
|
14
|
+
__exportStar(require("./lightgallery"), exports);
|
|
15
|
+
__exportStar(require("./offlineLink"), exports);
|
|
16
|
+
__exportStar(require("./uuid4"), exports);
|
|
17
|
+
__exportStar(require("./wordsToNumber"), exports);
|
package/utils/index.mjs
ADDED
package/utils/lightgallery.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -7,11 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
9
|
});
|
|
9
10
|
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.lightgalleryOsceResolve = void 0;
|
|
10
13
|
const lightgalleryRegex = /\[lightgallery\]/;
|
|
11
14
|
function isOsceMarksheet(data) {
|
|
12
15
|
return 'osceStationId' in data;
|
|
13
16
|
}
|
|
14
|
-
|
|
17
|
+
function lightgalleryOsceResolve(data, cache) {
|
|
15
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
19
|
let station;
|
|
17
20
|
if (isOsceMarksheet(data)) {
|
|
@@ -49,6 +52,7 @@ export function lightgalleryOsceResolve(data, cache) {
|
|
|
49
52
|
}
|
|
50
53
|
});
|
|
51
54
|
}
|
|
55
|
+
exports.lightgalleryOsceResolve = lightgalleryOsceResolve;
|
|
52
56
|
const lightgalleryMutation = (text, pictures, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
57
|
var _a;
|
|
54
58
|
if (pictures.length === 0) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,13 +7,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.lightgalleryOsceResolve = void 0;
|
|
13
10
|
const lightgalleryRegex = /\[lightgallery\]/;
|
|
14
11
|
function isOsceMarksheet(data) {
|
|
15
12
|
return 'osceStationId' in data;
|
|
16
13
|
}
|
|
17
|
-
function lightgalleryOsceResolve(data, cache) {
|
|
14
|
+
export function lightgalleryOsceResolve(data, cache) {
|
|
18
15
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
16
|
let station;
|
|
20
17
|
if (isOsceMarksheet(data)) {
|
|
@@ -52,7 +49,6 @@ function lightgalleryOsceResolve(data, cache) {
|
|
|
52
49
|
}
|
|
53
50
|
});
|
|
54
51
|
}
|
|
55
|
-
exports.lightgalleryOsceResolve = lightgalleryOsceResolve;
|
|
56
52
|
const lightgalleryMutation = (text, pictures, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
53
|
var _a;
|
|
58
54
|
if (pictures.length === 0) {
|
package/utils/offlineLink.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -7,9 +8,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
9
|
});
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.OfflineLink = void 0;
|
|
16
|
+
const client_1 = require("@apollo/client");
|
|
17
|
+
const uuid4_1 = __importDefault(require("./uuid4"));
|
|
18
|
+
class OfflineLink extends client_1.ApolloLink {
|
|
13
19
|
/**
|
|
14
20
|
* storage
|
|
15
21
|
* Provider that will persist the mutation queue. This can be any AsyncStorage compatible storage instance.
|
|
@@ -42,18 +48,18 @@ export class OfflineLink extends ApolloLink {
|
|
|
42
48
|
// If the mutation does not have an optimisticResponse then we can't defer it
|
|
43
49
|
return forward(operation);
|
|
44
50
|
}
|
|
45
|
-
return new Observable((observer) => {
|
|
46
|
-
const mutationId =
|
|
51
|
+
return new client_1.Observable((observer) => {
|
|
52
|
+
const mutationId = uuid4_1.default.asBase64();
|
|
47
53
|
this.add({
|
|
48
54
|
mutation: query,
|
|
49
55
|
variables,
|
|
50
56
|
optimisticResponse: context.optimisticResponse,
|
|
51
57
|
}, mutationId);
|
|
52
58
|
const subscription = forward(operation).subscribe({
|
|
53
|
-
next: (result) =>
|
|
54
|
-
|
|
59
|
+
next: (result) => {
|
|
60
|
+
this.remove(mutationId);
|
|
55
61
|
observer.next(result);
|
|
56
|
-
}
|
|
62
|
+
},
|
|
57
63
|
error: () => {
|
|
58
64
|
// Mutation failed so we try again after a certain amount of time.
|
|
59
65
|
this.delayedSync();
|
|
@@ -124,7 +130,7 @@ export class OfflineLink extends ApolloLink {
|
|
|
124
130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
125
131
|
// We give the mutation attempt a random id so that it is easy to remove when needed (in sync loop)
|
|
126
132
|
if (!mutationId) {
|
|
127
|
-
mutationId =
|
|
133
|
+
mutationId = uuid4_1.default.asBase64();
|
|
128
134
|
}
|
|
129
135
|
this.queue.set(mutationId, item);
|
|
130
136
|
yield this.saveQueue(mutationId, item);
|
|
@@ -228,3 +234,4 @@ export class OfflineLink extends ApolloLink {
|
|
|
228
234
|
});
|
|
229
235
|
}
|
|
230
236
|
}
|
|
237
|
+
exports.OfflineLink = OfflineLink;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,14 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.OfflineLink = void 0;
|
|
16
|
-
const client_1 = require("@apollo/client");
|
|
17
|
-
const uuid4_1 = __importDefault(require("./uuid4"));
|
|
18
|
-
class OfflineLink extends client_1.ApolloLink {
|
|
10
|
+
import { ApolloLink, Observable, } from '@apollo/client';
|
|
11
|
+
import uuid from './uuid4';
|
|
12
|
+
export class OfflineLink extends ApolloLink {
|
|
19
13
|
/**
|
|
20
14
|
* storage
|
|
21
15
|
* Provider that will persist the mutation queue. This can be any AsyncStorage compatible storage instance.
|
|
@@ -48,18 +42,18 @@ class OfflineLink extends client_1.ApolloLink {
|
|
|
48
42
|
// If the mutation does not have an optimisticResponse then we can't defer it
|
|
49
43
|
return forward(operation);
|
|
50
44
|
}
|
|
51
|
-
return new
|
|
52
|
-
const mutationId =
|
|
45
|
+
return new Observable((observer) => {
|
|
46
|
+
const mutationId = uuid.asBase64();
|
|
53
47
|
this.add({
|
|
54
48
|
mutation: query,
|
|
55
49
|
variables,
|
|
56
50
|
optimisticResponse: context.optimisticResponse,
|
|
57
51
|
}, mutationId);
|
|
58
52
|
const subscription = forward(operation).subscribe({
|
|
59
|
-
next: (result) =>
|
|
60
|
-
|
|
53
|
+
next: (result) => {
|
|
54
|
+
this.remove(mutationId);
|
|
61
55
|
observer.next(result);
|
|
62
|
-
}
|
|
56
|
+
},
|
|
63
57
|
error: () => {
|
|
64
58
|
// Mutation failed so we try again after a certain amount of time.
|
|
65
59
|
this.delayedSync();
|
|
@@ -130,7 +124,7 @@ class OfflineLink extends client_1.ApolloLink {
|
|
|
130
124
|
return __awaiter(this, void 0, void 0, function* () {
|
|
131
125
|
// We give the mutation attempt a random id so that it is easy to remove when needed (in sync loop)
|
|
132
126
|
if (!mutationId) {
|
|
133
|
-
mutationId =
|
|
127
|
+
mutationId = uuid.asBase64();
|
|
134
128
|
}
|
|
135
129
|
this.queue.set(mutationId, item);
|
|
136
130
|
yield this.saveQueue(mutationId, item);
|
|
@@ -234,4 +228,3 @@ class OfflineLink extends client_1.ApolloLink {
|
|
|
234
228
|
});
|
|
235
229
|
}
|
|
236
230
|
}
|
|
237
|
-
exports.OfflineLink = OfflineLink;
|
package/utils/uuid4.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
3
|
class Uuid4 {
|
|
2
4
|
/**
|
|
3
5
|
* Generate a custom base 64 encoded UUID v4 (random).
|
|
@@ -282,4 +284,4 @@ Uuid4._base64 = {
|
|
|
282
284
|
'111110': '-',
|
|
283
285
|
'111111': '_',
|
|
284
286
|
};
|
|
285
|
-
|
|
287
|
+
exports.default = Uuid4;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
class Uuid4 {
|
|
4
2
|
/**
|
|
5
3
|
* Generate a custom base 64 encoded UUID v4 (random).
|
|
@@ -284,4 +282,4 @@ Uuid4._base64 = {
|
|
|
284
282
|
'111110': '-',
|
|
285
283
|
'111111': '_',
|
|
286
284
|
};
|
|
287
|
-
|
|
285
|
+
export default Uuid4;
|
package/utils/wordsToNumber.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wordsToNumber = void 0;
|
|
1
4
|
const Small = {
|
|
2
5
|
zero: 0,
|
|
3
6
|
one: 1,
|
|
@@ -28,7 +31,7 @@ const Small = {
|
|
|
28
31
|
eighty: 80,
|
|
29
32
|
ninety: 90,
|
|
30
33
|
};
|
|
31
|
-
|
|
34
|
+
function wordsToNumber(s, checkForDigits = false) {
|
|
32
35
|
const words = s.toString().split(/[\s-]+/);
|
|
33
36
|
let total = 0;
|
|
34
37
|
words.forEach((word) => {
|
|
@@ -42,3 +45,4 @@ export function wordsToNumber(s, checkForDigits = false) {
|
|
|
42
45
|
});
|
|
43
46
|
return total;
|
|
44
47
|
}
|
|
48
|
+
exports.wordsToNumber = wordsToNumber;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wordsToNumber = void 0;
|
|
4
1
|
const Small = {
|
|
5
2
|
zero: 0,
|
|
6
3
|
one: 1,
|
|
@@ -31,7 +28,7 @@ const Small = {
|
|
|
31
28
|
eighty: 80,
|
|
32
29
|
ninety: 90,
|
|
33
30
|
};
|
|
34
|
-
function wordsToNumber(s, checkForDigits = false) {
|
|
31
|
+
export function wordsToNumber(s, checkForDigits = false) {
|
|
35
32
|
const words = s.toString().split(/[\s-]+/);
|
|
36
33
|
let total = 0;
|
|
37
34
|
words.forEach((word) => {
|
|
@@ -45,4 +42,3 @@ function wordsToNumber(s, checkForDigits = false) {
|
|
|
45
42
|
});
|
|
46
43
|
return total;
|
|
47
44
|
}
|
|
48
|
-
exports.wordsToNumber = wordsToNumber;
|
package/models/Author.cjs
DELETED
package/models/Book.cjs
DELETED
package/models/Card.cjs
DELETED
package/models/Chapter.cjs
DELETED
package/models/Concept.cjs
DELETED
package/models/Feedback.cjs
DELETED
package/models/File.cjs
DELETED