codequiry 2.0.0 → 2.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.
Files changed (2) hide show
  1. package/index.js +5 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -233,11 +233,13 @@ class Codequiry {
233
233
  options.onProgress(status);
234
234
  }
235
235
 
236
- const statusVal = status?.status ?? status?.check_status;
237
- if (statusVal === 5 || statusVal === 'completed' || statusVal === 'done') {
236
+ const statusId = status?.status_id;
237
+ // status_id 4 = Completed
238
+ if (statusId === 4) {
238
239
  return status;
239
240
  }
240
- if (statusVal === 'failed' || statusVal === 'error' || statusVal === -1) {
241
+ // status_id 5 = Error/Failed
242
+ if (statusId === 5 || statusId === -1) {
241
243
  throw new Error('Check failed: ' + JSON.stringify(status));
242
244
  }
243
245
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codequiry",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Node.js SDK for Codequiry's Code Plagiarism & Similarity Detection API",
5
5
  "main": "index.js",
6
6
  "scripts": {