muhammara 2.3.0 → 2.6.0

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 (33) hide show
  1. package/CHANGELOG.md +32 -1
  2. package/muhammara.d.ts +261 -242
  3. package/muhammara.js +1 -1
  4. package/node_modules/concat-map/package.json +1 -1
  5. package/node_modules/console-control-strings/package.json +1 -1
  6. package/node_modules/delegates/package.json +1 -1
  7. package/node_modules/fs.realpath/package.json +1 -1
  8. package/node_modules/glob/common.js +2 -0
  9. package/node_modules/glob/glob.js +4 -1
  10. package/node_modules/glob/package.json +9 -6
  11. package/node_modules/glob/sync.js +6 -3
  12. package/node_modules/has-unicode/package.json +1 -1
  13. package/node_modules/inflight/package.json +1 -1
  14. package/node_modules/minimatch/package.json +5 -5
  15. package/node_modules/minipass/LICENSE +1 -1
  16. package/node_modules/minipass/README.md +122 -7
  17. package/node_modules/minipass/index.d.ts +149 -0
  18. package/node_modules/minipass/index.js +191 -102
  19. package/node_modules/minipass/package.json +23 -7
  20. package/node_modules/object-assign/package.json +1 -1
  21. package/node_modules/once/package.json +1 -1
  22. package/node_modules/path-is-absolute/package.json +1 -1
  23. package/node_modules/set-blocking/package.json +1 -1
  24. package/node_modules/tr46/package.json +1 -1
  25. package/node_modules/util-deprecate/package.json +1 -1
  26. package/node_modules/webidl-conversions/package.json +1 -1
  27. package/node_modules/whatwg-url/package.json +1 -1
  28. package/node_modules/wrappy/package.json +1 -1
  29. package/package.json +2 -1
  30. package/src/DocumentCopyingContextDriver.cpp +9 -9
  31. package/src/ObjectByteWriterWithPosition.cpp +15 -7
  32. package/src/ObjectsContextDriver.cpp +1 -1
  33. package/src/deps/PDFWriter/PDFDocumentHandler.cpp +4 -0
@@ -103,7 +103,7 @@ METHOD_RETURN_TYPE DocumentCopyingContextDriver::CreateFormXObjectFromPDFPage(co
103
103
  (!args[1]->IsNumber() && !args[1]->IsArray()) ||
104
104
  (args.Length() == 3 && !args[2]->IsArray()))
105
105
  {
106
- THROW_EXCEPTION("Wrong arguments. provide 2 or 3 arugments, where the first is a 0 based page index, and the second is a EPDFPageBox enumeration value or a 4 numbers array defining an box. a 3rd parameter may be provided to deisgnate the result form matrix");
106
+ THROW_EXCEPTION("Wrong arguments. provide 2 or 3 arguments, where the first is a 0 based page index, and the second is a EPDFPageBox enumeration value or a 4 numbers array defining an box. a 3rd parameter may be provided to deisgnate the result form matrix");
107
107
  SET_FUNCTION_RETURN_VALUE(UNDEFINED)
108
108
  }
109
109
 
@@ -182,7 +182,7 @@ METHOD_RETURN_TYPE DocumentCopyingContextDriver::MergePDFPageToPage(const ARGS_T
182
182
  !copyingContextDriver->holder->IsPDFPageInstance(args[0]) ||
183
183
  !args[1]->IsNumber())
184
184
  {
185
- THROW_EXCEPTION("Wrong arguments. provide 2 arugments, where the first is a page, and the second is a page index to merge");
185
+ THROW_EXCEPTION("Wrong arguments. provide 2 arguments, where the first is a page, and the second is a page index to merge");
186
186
  SET_FUNCTION_RETURN_VALUE(UNDEFINED)
187
187
  }
188
188
 
@@ -246,7 +246,7 @@ METHOD_RETURN_TYPE DocumentCopyingContextDriver::MergePDFPageToFormXObject(const
246
246
  !copyingContextDriver->holder->IsFormXObjectInstance(args[0]) ||
247
247
  !args[1]->IsNumber())
248
248
  {
249
- THROW_EXCEPTION("Wrong arguments. provide 2 arugments, where the first is a form, and the second is a page index to merge");
249
+ THROW_EXCEPTION("Wrong arguments. provide 2 arguments, where the first is a form, and the second is a page index to merge");
250
250
  SET_FUNCTION_RETURN_VALUE(UNDEFINED)
251
251
  }
252
252
 
@@ -287,7 +287,7 @@ METHOD_RETURN_TYPE DocumentCopyingContextDriver::CopyDirectObjectAsIs(const ARGS
287
287
 
288
288
  if(args.Length() != 1) // need to sometimes check that this is a PDFObject
289
289
  {
290
- THROW_EXCEPTION("Wrong arguments. provide 1 arugment, which is PDFObject to copy");
290
+ THROW_EXCEPTION("Wrong arguments. provide 1 argument, which is PDFObject to copy");
291
291
  SET_FUNCTION_RETURN_VALUE(UNDEFINED)
292
292
  }
293
293
 
@@ -314,7 +314,7 @@ METHOD_RETURN_TYPE DocumentCopyingContextDriver::CopyObject(const ARGS_TYPE& arg
314
314
  if(args.Length() != 1 ||
315
315
  !args[0]->IsNumber())
316
316
  {
317
- THROW_EXCEPTION("Wrong arguments. provide 1 arugment, which is object ID of the object to copy");
317
+ THROW_EXCEPTION("Wrong arguments. provide 1 argument, which is object ID of the object to copy");
318
318
  SET_FUNCTION_RETURN_VALUE(UNDEFINED)
319
319
  }
320
320
 
@@ -341,7 +341,7 @@ METHOD_RETURN_TYPE DocumentCopyingContextDriver::CopyDirectObjectWithDeepCopy(co
341
341
 
342
342
  if(args.Length() != 1) // need to sometimes check that this is a PDFObject
343
343
  {
344
- THROW_EXCEPTION("Wrong arguments. provide 1 arugment, which is PDFObject to copy");
344
+ THROW_EXCEPTION("Wrong arguments. provide 1 argument, which is PDFObject to copy");
345
345
  SET_FUNCTION_RETURN_VALUE(UNDEFINED)
346
346
  }
347
347
 
@@ -376,7 +376,7 @@ METHOD_RETURN_TYPE DocumentCopyingContextDriver::CopyNewObjectsForDirectObject(c
376
376
  if(args.Length() != 1 ||
377
377
  !args[0]->IsArray())
378
378
  {
379
- THROW_EXCEPTION("Wrong arguments. provide 1 arugment, which is an array of object IDs");
379
+ THROW_EXCEPTION("Wrong arguments. provide 1 argument, which is an array of object IDs");
380
380
  SET_FUNCTION_RETURN_VALUE(UNDEFINED)
381
381
  }
382
382
 
@@ -413,7 +413,7 @@ METHOD_RETURN_TYPE DocumentCopyingContextDriver::GetCopiedObjectID(const ARGS_TY
413
413
  if(args.Length() != 1 ||
414
414
  !args[0]->IsNumber())
415
415
  {
416
- THROW_EXCEPTION("Wrong arguments. provide 1 arugment, an object ID to check");
416
+ THROW_EXCEPTION("Wrong arguments. provide 1 argument, an object ID to check");
417
417
  SET_FUNCTION_RETURN_VALUE(UNDEFINED)
418
418
  }
419
419
 
@@ -468,7 +468,7 @@ METHOD_RETURN_TYPE DocumentCopyingContextDriver::ReplaceSourceObjects(const ARGS
468
468
  if(args.Length() != 1 ||
469
469
  !args[0]->IsObject())
470
470
  {
471
- THROW_EXCEPTION("Wrong arguments. provide 1 arugment, which is an object mapping source object ids to map to target object IDs");
471
+ THROW_EXCEPTION("Wrong arguments. provide 1 argument, which is an object mapping source object ids to map to target object IDs");
472
472
  SET_FUNCTION_RETURN_VALUE(UNDEFINED)
473
473
  }
474
474
 
@@ -52,12 +52,20 @@ IOBasicTypes::LongBufferSizeType ObjectByteWriterWithPosition::Write(const IOBas
52
52
 
53
53
  Local<Value> args[1];
54
54
  args[0] = anArray;
55
-
56
- Local<Value> result = func->Call(GET_CURRENT_CONTEXT, OBJECT_FROM_PERSISTENT(mObject), 1, args).ToLocalChecked();
55
+ MaybeLocal<Value> maybe;
56
+ TryCatch try_catch(Isolate::GetCurrent());
57
+
58
+ maybe = func->Call(GET_CURRENT_CONTEXT, OBJECT_FROM_PERSISTENT(mObject), 1, args);
59
+ Local <Value> result;
60
+
61
+ if (!maybe.ToLocal(&result)) {
62
+ try_catch.ReThrow();
63
+ return 0;
64
+ }
57
65
  if(result.IsEmpty())
58
66
  {
59
- THROW_EXCEPTION("wrong return value. it's empty. return the number of written characters");
60
- return 0;
67
+ THROW_EXCEPTION("wrong return value. it's empty. return the number of written characters");
68
+ return 0;
61
69
  }
62
70
  else if(result->IsNumber())
63
71
  {
@@ -65,8 +73,8 @@ IOBasicTypes::LongBufferSizeType ObjectByteWriterWithPosition::Write(const IOBas
65
73
  }
66
74
  else
67
75
  {
68
- THROW_EXCEPTION("wrong return value. write should return the number of written characters");
69
- return 0;
76
+ THROW_EXCEPTION("wrong return value. write should return the number of written characters");
77
+ return 0;
70
78
  }
71
79
  }
72
80
 
@@ -81,4 +89,4 @@ IOBasicTypes::LongFilePositionType ObjectByteWriterWithPosition::GetCurrentPosit
81
89
  Local<Function> func = Local<Function>::Cast(value);
82
90
 
83
91
  return TO_NUMBER(func->Call(GET_CURRENT_CONTEXT, OBJECT_FROM_PERSISTENT(mObject), 0, NULL).ToLocalChecked())->Value();
84
- }
92
+ }
@@ -179,7 +179,7 @@ METHOD_RETURN_TYPE ObjectsContextDriver::EndArray(const ARGS_TYPE& args)
179
179
  if((args.Length() != 0 && args.Length() != 1) ||
180
180
  (args.Length() == 1 && !args[0]->IsNumber()))
181
181
  {
182
- THROW_EXCEPTION("wrong arguments, pass 1 optional argument that defiened the array ending");
182
+ THROW_EXCEPTION("wrong arguments, pass 1 optional argument that defined the array ending");
183
183
  SET_FUNCTION_RETURN_VALUE(UNDEFINED)
184
184
 
185
185
  }
@@ -2032,6 +2032,10 @@ EStatusCode PDFDocumentHandler::WriteStreamObject(PDFStreamInput* inStream, IObj
2032
2032
  if(!readingDecrypted) {
2033
2033
  streamReader = mParser->StartReadingFromStreamForPlainCopying(inStream);
2034
2034
  }
2035
+
2036
+ if (streamReader == NULL) {
2037
+ status = PDFHummus::eFailure;
2038
+ }
2035
2039
 
2036
2040
  while (it.MoveNext() && PDFHummus::eSuccess == status)
2037
2041
  {