@didask/scol-r 2.2.3 → 2.2.4

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.
Files changed (2) hide show
  1. package/lib/SCORMAdapter.js +15 -16
  2. package/package.json +1 -1
@@ -3,31 +3,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SCORMAdapter = void 0;
4
4
  var SCORMAdapter = /** @class */ (function () {
5
5
  function SCORMAdapter(errorCallback) {
6
+ var _this = this;
6
7
  if (errorCallback === void 0) { errorCallback = function () { }; }
7
8
  this._ignorableErrorCodes = [
8
- { code: 0, shouldBeIgnored: true },
9
+ { code: 0, getShouldBeIgnored: function () { return true; } },
9
10
  {
10
11
  code: 403,
11
- get shouldBeIgnored() {
12
- return this._isSCORM2004;
13
- },
12
+ getShouldBeIgnored: function () { return _this._isSCORM2004; },
14
13
  },
15
14
  {
16
15
  code: 401,
17
- get shouldBeIgnored() {
18
- return (!this._isSCORM2004 &&
19
- this._lastRequest &&
20
- this._lastRequest.method === "get" &&
21
- this._lastRequest.key === "cmi.objectives._children");
16
+ getShouldBeIgnored: function () {
17
+ return !_this._isSCORM2004 &&
18
+ _this._lastRequest &&
19
+ _this._lastRequest.method === "get" &&
20
+ _this._lastRequest.key === "cmi.objectives._children";
22
21
  },
23
22
  },
24
23
  {
25
24
  code: 402,
26
- get shouldBeIgnored() {
27
- return (this._isSCORM2004 &&
28
- this._lastRequest &&
29
- this._lastRequest.method === "get" &&
30
- this._lastRequest.key === "cmi.objectives._children");
25
+ getShouldBeIgnored: function () {
26
+ return _this._isSCORM2004 &&
27
+ _this._lastRequest &&
28
+ _this._lastRequest.method === "get" &&
29
+ _this._lastRequest.key === "cmi.objectives._children";
31
30
  },
32
31
  },
33
32
  ];
@@ -124,8 +123,8 @@ var SCORMAdapter = /** @class */ (function () {
124
123
  var lastErrorString = this.LMSGetErrorString(lastErrorCode);
125
124
  var lastErrorDiagnostic = this.LMSGetDiagnostic(lastErrorCode);
126
125
  if (!this._ignorableErrorCodes.some(function (_a) {
127
- var code = _a.code, shouldBeIgnored = _a.shouldBeIgnored;
128
- return code === lastErrorCode && shouldBeIgnored;
126
+ var code = _a.code, getShouldBeIgnored = _a.getShouldBeIgnored;
127
+ return code === lastErrorCode && getShouldBeIgnored();
129
128
  })) {
130
129
  console.warn(functionName, "An error occured on the SCORM API: code " + lastErrorCode + ", message: " + lastErrorString, lastErrorDiagnostic);
131
130
  this._errorCallback(lastErrorString, lastErrorDiagnostic && lastErrorDiagnostic != lastErrorCode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@didask/scol-r",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
4
4
  "description": "Shareable Cross-Origin Learning Resources",
5
5
  "main": "index.html",
6
6
  "types": "lib/index.d.ts",