pdfmake 0.1.72 → 0.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pdfmake",
3
- "version": "0.1.72",
3
+ "version": "0.2.0",
4
4
  "description": "Client/server side PDF printing in pure JavaScript",
5
5
  "main": "src/printer.js",
6
6
  "browser": "build/pdfmake.js",
@@ -8,43 +8,52 @@
8
8
  "test": "tests"
9
9
  },
10
10
  "dependencies": {
11
- "iconv-lite": "^0.6.2",
12
- "linebreak": "^1.0.2",
13
- "pdfkit": "^0.12.0",
11
+ "@foliojs-fork/linebreak": "^1.1.0",
12
+ "@foliojs-fork/pdfkit": "^0.12.1",
13
+ "iconv-lite": "^0.6.3",
14
14
  "svg-to-pdfkit": "^0.1.8",
15
15
  "xmldoc": "^1.1.2"
16
16
  },
17
17
  "devDependencies": {
18
- "@babel/core": "^7.12.10",
19
- "@babel/plugin-transform-modules-commonjs": "^7.12.1",
20
- "@babel/preset-env": "^7.12.11",
18
+ "@babel/cli": "^7.14.5",
19
+ "@babel/core": "^7.14.6",
20
+ "@babel/plugin-transform-modules-commonjs": "^7.14.5",
21
+ "@babel/preset-env": "^7.14.7",
22
+ "assert": "^2.0.0",
21
23
  "babel-loader": "^8.2.2",
22
24
  "brfs": "^2.0.2",
23
- "core-js": "^3.8.1",
24
- "eslint-plugin-jsdoc": "^30.7.9",
25
- "expose-loader": "^1.0.3",
26
- "fancy-log": "^1.3.3",
25
+ "browserify-zlib": "^0.2.0",
26
+ "buffer": "^6.0.3",
27
+ "core-js": "^3.15.2",
28
+ "eslint": "^7.29.0",
29
+ "eslint-plugin-jsdoc": "^35.4.1",
30
+ "expose-loader": "^3.0.0",
27
31
  "file-saver": "^2.0.5",
28
- "gulp": "^4.0.2",
29
- "gulp-each": "^0.5.0",
30
- "gulp-eslint": "^6.0.0",
31
- "gulp-file-contents-to-json": "^0.2.2",
32
- "gulp-spawn-mocha": "^6.0.0",
33
- "mocha": "7.2.0",
32
+ "mocha": "^9.0.1",
33
+ "npm-run-all": "^4.1.5",
34
+ "process": "^0.11.10",
34
35
  "rewire": "^5.0.0",
35
- "sinon": "^9.2.2",
36
+ "sinon": "^11.1.1",
37
+ "stream-browserify": "^3.0.0",
36
38
  "string-replace-webpack-plugin": "^0.1.3",
37
- "terser-webpack-plugin": "2.3.8",
39
+ "terser-webpack-plugin": "^5.1.4",
38
40
  "transform-loader": "^0.2.4",
39
- "webpack": "^4.44.2"
41
+ "util": "^0.12.4",
42
+ "webpack": "^5.42.0",
43
+ "webpack-cli": "^4.7.2"
40
44
  },
41
45
  "engines": {
42
- "node": ">=8"
46
+ "node": ">=12"
43
47
  },
44
48
  "scripts": {
45
- "build": "gulp build",
49
+ "test": "run-s build mocha",
50
+ "build": "run-s build:browser",
51
+ "build:browser": "webpack",
52
+ "build:browser-standard-fonts": "webpack --config webpack-standardfonts.config.js",
46
53
  "build:vfs": "node build-vfs.js \"./examples/fonts\"",
47
- "test": "gulp",
54
+ "build:examples": "node build-examples.js",
55
+ "lint": "eslint \"./src/**/*.js\" \"./tests/**/*.js\" \"./examples/**/*.js\"",
56
+ "mocha": "mocha --reporter spec \"./tests/**/*.js\"",
48
57
  "playground": "node dev-playground/server.js"
49
58
  },
50
59
  "repository": {
@@ -24,6 +24,16 @@ function Document(docDefinition, tableLayouts, fonts, vfs) {
24
24
 
25
25
  function canCreatePdf() {
26
26
  // Ensure the browser provides the level of support needed
27
+ try {
28
+ var arr = new Uint8Array(1)
29
+ var proto = { foo: function () { return 42 } }
30
+ Object.setPrototypeOf(proto, Uint8Array.prototype)
31
+ Object.setPrototypeOf(arr, proto)
32
+ return arr.foo() === 42
33
+ } catch (e) {
34
+ return false
35
+ }
36
+
27
37
  if (!Object.keys || typeof Uint16Array === 'undefined') {
28
38
  return false;
29
39
  }
@@ -4,7 +4,7 @@ function _interopDefault(ex) {
4
4
  return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex;
5
5
  }
6
6
 
7
- var PdfKit = _interopDefault(require('pdfkit'));
7
+ var PdfKit = _interopDefault(require('@foliojs-fork/pdfkit'));
8
8
 
9
9
  function getEngineInstance() {
10
10
  return PdfKit;
package/src/textTools.js CHANGED
@@ -5,7 +5,7 @@ var isNumber = require('./helpers').isNumber;
5
5
  var isObject = require('./helpers').isObject;
6
6
  var isArray = require('./helpers').isArray;
7
7
  var isUndefined = require('./helpers').isUndefined;
8
- var LineBreaker = require('linebreak');
8
+ var LineBreaker = require('@foliojs-fork/linebreak');
9
9
 
10
10
  var LEADING = /^(\s)+/g;
11
11
  var TRAILING = /(\s)+$/g;