muhammara 3.2.0 → 3.3.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.
@@ -8,8 +8,9 @@ const normPath = require('./normalize-windows-path.js')
8
8
  const stripSlash = require('./strip-trailing-slashes.js')
9
9
 
10
10
  const prefixPath = (path, prefix) => {
11
- if (!prefix)
11
+ if (!prefix) {
12
12
  return normPath(path)
13
+ }
13
14
  path = normPath(path).replace(/^\.(\/|$)/, '')
14
15
  return stripSlash(prefix) + '/' + path
15
16
  }
@@ -44,8 +45,9 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
44
45
  constructor (p, opt) {
45
46
  opt = opt || {}
46
47
  super(opt)
47
- if (typeof p !== 'string')
48
+ if (typeof p !== 'string') {
48
49
  throw new TypeError('path is required')
50
+ }
49
51
  this.path = normPath(p)
50
52
  // suppress atime, ctime, uid, gid, uname, gname
51
53
  this.portable = !!opt.portable
@@ -72,8 +74,9 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
72
74
  this.pos = null
73
75
  this.remain = null
74
76
 
75
- if (typeof opt.onwarn === 'function')
77
+ if (typeof opt.onwarn === 'function') {
76
78
  this.on('warn', opt.onwarn)
79
+ }
77
80
 
78
81
  let pathWarn = false
79
82
  if (!this.preservePaths) {
@@ -94,8 +97,9 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
94
97
 
95
98
  this.absolute = normPath(opt.absolute || path.resolve(this.cwd, p))
96
99
 
97
- if (this.path === '')
100
+ if (this.path === '') {
98
101
  this.path = './'
102
+ }
99
103
 
100
104
  if (pathWarn) {
101
105
  this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, {
@@ -104,22 +108,25 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
104
108
  })
105
109
  }
106
110
 
107
- if (this.statCache.has(this.absolute))
111
+ if (this.statCache.has(this.absolute)) {
108
112
  this[ONLSTAT](this.statCache.get(this.absolute))
109
- else
113
+ } else {
110
114
  this[LSTAT]()
115
+ }
111
116
  }
112
117
 
113
118
  emit (ev, ...data) {
114
- if (ev === 'error')
119
+ if (ev === 'error') {
115
120
  this[HAD_ERROR] = true
121
+ }
116
122
  return super.emit(ev, ...data)
117
123
  }
118
124
 
119
125
  [LSTAT] () {
120
126
  fs.lstat(this.absolute, (er, stat) => {
121
- if (er)
127
+ if (er) {
122
128
  return this.emit('error', er)
129
+ }
123
130
  this[ONLSTAT](stat)
124
131
  })
125
132
  }
@@ -127,8 +134,9 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
127
134
  [ONLSTAT] (stat) {
128
135
  this.statCache.set(this.absolute, stat)
129
136
  this.stat = stat
130
- if (!stat.isFile())
137
+ if (!stat.isFile()) {
131
138
  stat.size = 0
139
+ }
132
140
  this.type = getType(stat)
133
141
  this.emit('stat', stat)
134
142
  this[PROCESS]()
@@ -153,8 +161,9 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
153
161
  }
154
162
 
155
163
  [HEADER] () {
156
- if (this.type === 'Directory' && this.portable)
164
+ if (this.type === 'Directory' && this.portable) {
157
165
  this.noMtime = true
166
+ }
158
167
 
159
168
  this.header = new Header({
160
169
  path: this[PREFIX](this.path),
@@ -196,8 +205,9 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
196
205
  }
197
206
 
198
207
  [DIRECTORY] () {
199
- if (this.path.substr(-1) !== '/')
208
+ if (this.path.slice(-1) !== '/') {
200
209
  this.path += '/'
210
+ }
201
211
  this.stat.size = 0
202
212
  this[HEADER]()
203
213
  this.end()
@@ -205,8 +215,9 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
205
215
 
206
216
  [SYMLINK] () {
207
217
  fs.readlink(this.absolute, (er, linkpath) => {
208
- if (er)
218
+ if (er) {
209
219
  return this.emit('error', er)
220
+ }
210
221
  this[ONREADLINK](linkpath)
211
222
  })
212
223
  }
@@ -230,31 +241,35 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
230
241
  const linkKey = this.stat.dev + ':' + this.stat.ino
231
242
  if (this.linkCache.has(linkKey)) {
232
243
  const linkpath = this.linkCache.get(linkKey)
233
- if (linkpath.indexOf(this.cwd) === 0)
244
+ if (linkpath.indexOf(this.cwd) === 0) {
234
245
  return this[HARDLINK](linkpath)
246
+ }
235
247
  }
236
248
  this.linkCache.set(linkKey, this.absolute)
237
249
  }
238
250
 
239
251
  this[HEADER]()
240
- if (this.stat.size === 0)
252
+ if (this.stat.size === 0) {
241
253
  return this.end()
254
+ }
242
255
 
243
256
  this[OPENFILE]()
244
257
  }
245
258
 
246
259
  [OPENFILE] () {
247
260
  fs.open(this.absolute, 'r', (er, fd) => {
248
- if (er)
261
+ if (er) {
249
262
  return this.emit('error', er)
263
+ }
250
264
  this[ONOPENFILE](fd)
251
265
  })
252
266
  }
253
267
 
254
268
  [ONOPENFILE] (fd) {
255
269
  this.fd = fd
256
- if (this[HAD_ERROR])
270
+ if (this[HAD_ERROR]) {
257
271
  return this[CLOSE]()
272
+ }
258
273
 
259
274
  this.blockLen = 512 * Math.ceil(this.stat.size / 512)
260
275
  this.blockRemain = this.blockLen
@@ -318,10 +333,11 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
318
333
  this.buf : this.buf.slice(this.offset, this.offset + bytesRead)
319
334
 
320
335
  const flushed = this.write(writeBuf)
321
- if (!flushed)
336
+ if (!flushed) {
322
337
  this[AWAITDRAIN](() => this[ONDRAIN]())
323
- else
338
+ } else {
324
339
  this[ONDRAIN]()
340
+ }
325
341
  }
326
342
 
327
343
  [AWAITDRAIN] (cb) {
@@ -343,8 +359,9 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
343
359
 
344
360
  [ONDRAIN] () {
345
361
  if (!this.remain) {
346
- if (this.blockRemain)
362
+ if (this.blockRemain) {
347
363
  super.write(Buffer.alloc(this.blockRemain))
364
+ }
348
365
  return this[CLOSE](er => er ? this.emit('error', er) : this.end())
349
366
  }
350
367
 
@@ -412,8 +429,9 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass {
412
429
 
413
430
  this.readEntry = readEntry
414
431
  this.type = readEntry.type
415
- if (this.type === 'Directory' && this.portable)
432
+ if (this.type === 'Directory' && this.portable) {
416
433
  this.noMtime = true
434
+ }
417
435
 
418
436
  this.prefix = opt.prefix || null
419
437
 
@@ -429,8 +447,9 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass {
429
447
  this.ctime = this.portable ? null : readEntry.ctime
430
448
  this.linkpath = normPath(readEntry.linkpath)
431
449
 
432
- if (typeof opt.onwarn === 'function')
450
+ if (typeof opt.onwarn === 'function') {
433
451
  this.on('warn', opt.onwarn)
452
+ }
434
453
 
435
454
  let pathWarn = false
436
455
  if (!this.preservePaths) {
@@ -500,15 +519,17 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass {
500
519
 
501
520
  write (data) {
502
521
  const writeLen = data.length
503
- if (writeLen > this.blockRemain)
522
+ if (writeLen > this.blockRemain) {
504
523
  throw new Error('writing more to entry than is appropriate')
524
+ }
505
525
  this.blockRemain -= writeLen
506
526
  return super.write(data)
507
527
  }
508
528
 
509
529
  end () {
510
- if (this.blockRemain)
530
+ if (this.blockRemain) {
511
531
  super.write(Buffer.alloc(this.blockRemain))
532
+ }
512
533
  return super.end()
513
534
  }
514
535
  })
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "tar@^6.1.11",
3
- "_id": "tar@6.1.11",
3
+ "_id": "tar@6.1.12",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==",
5
+ "_integrity": "sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==",
6
6
  "_location": "/tar",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -18,14 +18,12 @@
18
18
  "_requiredBy": [
19
19
  "/@mapbox/node-pre-gyp"
20
20
  ],
21
- "_resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz",
22
- "_shasum": "6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621",
21
+ "_resolved": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz",
22
+ "_shasum": "3b742fb05669b55671fb769ab67a7791ea1a62e6",
23
23
  "_spec": "tar@^6.1.11",
24
24
  "_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/@mapbox/node-pre-gyp",
25
25
  "author": {
26
- "name": "Isaac Z. Schlueter",
27
- "email": "i@izs.me",
28
- "url": "http://blog.izs.me/"
26
+ "name": "GitHub Inc."
29
27
  },
30
28
  "bugs": {
31
29
  "url": "https://github.com/npm/node-tar/issues"
@@ -42,26 +40,23 @@
42
40
  "deprecated": false,
43
41
  "description": "tar for node",
44
42
  "devDependencies": {
43
+ "@npmcli/eslint-config": "^4.0.0",
44
+ "@npmcli/template-oss": "4.8.0",
45
45
  "chmodr": "^1.2.0",
46
46
  "end-of-stream": "^1.4.3",
47
- "eslint": "^7.17.0",
48
- "eslint-plugin-import": "^2.22.1",
49
- "eslint-plugin-node": "^11.1.0",
50
- "eslint-plugin-promise": "^4.2.1",
51
- "eslint-plugin-standard": "^5.0.0",
52
47
  "events-to-array": "^1.1.2",
53
48
  "mutate-fs": "^2.1.1",
54
- "rimraf": "^2.7.1",
55
- "tap": "^15.0.9",
56
- "tar-fs": "^1.16.3",
57
- "tar-stream": "^1.6.2"
49
+ "nock": "^13.2.9",
50
+ "rimraf": "^3.0.2",
51
+ "tap": "^16.0.1"
58
52
  },
59
53
  "engines": {
60
- "node": ">= 10"
54
+ "node": ">=10"
61
55
  },
62
56
  "files": [
63
- "index.js",
64
- "lib/*.js"
57
+ "bin/",
58
+ "lib/",
59
+ "index.js"
65
60
  ],
66
61
  "homepage": "https://github.com/npm/node-tar#readme",
67
62
  "license": "ISC",
@@ -71,22 +66,41 @@
71
66
  "url": "git+https://github.com/npm/node-tar.git"
72
67
  },
73
68
  "scripts": {
74
- "bench": "for i in benchmarks/*/*.js; do echo $i; for j in {1..5}; do node $i || break; done; done",
75
- "eslint": "eslint",
76
69
  "genparse": "node scripts/generate-parse-fixtures.js",
77
- "lint": "npm run eslint -- test lib",
70
+ "lint": "eslint \"**/*.js\"",
78
71
  "lintfix": "npm run lint -- --fix",
72
+ "postlint": "template-oss-check",
79
73
  "posttest": "npm run lint",
80
- "postversion": "npm publish",
81
- "prepublishOnly": "git push origin --follow-tags",
82
- "preversion": "npm test",
83
- "test": "node test/fixtures/test.js",
84
- "test:posix": "tap",
85
- "test:win32": "tap --lines=98 --branches=98 --statements=98 --functions=98"
74
+ "snap": "tap",
75
+ "template-oss-apply": "template-oss-apply --force",
76
+ "test": "tap"
86
77
  },
87
78
  "tap": {
88
79
  "coverage-map": "map.js",
89
- "check-coverage": true
80
+ "timeout": 0,
81
+ "nyc-arg": [
82
+ "--exclude",
83
+ "tap-snapshots/**"
84
+ ]
90
85
  },
91
- "version": "6.1.11"
86
+ "templateOSS": {
87
+ "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
88
+ "version": "4.8.0",
89
+ "content": "scripts/template-oss",
90
+ "engines": ">=10",
91
+ "distPaths": [
92
+ "index.js"
93
+ ],
94
+ "allowPaths": [
95
+ "/index.js"
96
+ ],
97
+ "ciVersions": [
98
+ "10.x",
99
+ "12.x",
100
+ "14.x",
101
+ "16.x",
102
+ "18.x"
103
+ ]
104
+ },
105
+ "version": "6.1.12"
92
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muhammara",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "Create, read and modify PDF files and streams. A drop in replacement for hummusjs PDF library",
5
5
  "homepage": "https://github.com/julianhille/Muhammarajs",
6
6
  "license": "Apache-2.0",
@@ -14,6 +14,16 @@
14
14
  './include/freetype/internal',
15
15
  './include/freetype/internal/services'
16
16
  ],
17
+ 'msvs_settings':
18
+ {
19
+ 'VCCLCompilerTool':
20
+ {
21
+ 'AdditionalOptions':
22
+ [
23
+ '/std:c++17',
24
+ ]
25
+ }
26
+ },
17
27
  'sources': [
18
28
  './src/base/ftbbox.c',
19
29
  './src/base/ftgxval.c',
@@ -3,6 +3,16 @@
3
3
  {
4
4
  'target_name': 'libaesgm',
5
5
  'type': 'static_library',
6
+ 'msvs_settings':
7
+ {
8
+ 'VCCLCompilerTool':
9
+ {
10
+ 'AdditionalOptions':
11
+ [
12
+ '/std:c++17',
13
+ ]
14
+ }
15
+ },
6
16
  'sources': [
7
17
  'aescrypt.c',
8
18
  'aeskey.c',
@@ -3,6 +3,16 @@
3
3
  {
4
4
  'target_name': 'libjpeg',
5
5
  'type': 'static_library',
6
+ 'msvs_settings':
7
+ {
8
+ 'VCCLCompilerTool':
9
+ {
10
+ 'AdditionalOptions':
11
+ [
12
+ '/std:c++17',
13
+ ]
14
+ }
15
+ },
6
16
  'sources': [
7
17
  'jaricom.c',
8
18
  'jcapimin.c',
@@ -8,7 +8,17 @@
8
8
  ],
9
9
  'include_dirs': [
10
10
  '<(module_root_dir)/src/deps/ZLib',
11
- ],
11
+ ],
12
+ 'msvs_settings':
13
+ {
14
+ 'VCCLCompilerTool':
15
+ {
16
+ 'AdditionalOptions':
17
+ [
18
+ '/std:c++17',
19
+ ]
20
+ }
21
+ },
12
22
  'sources': [
13
23
  'png.c',
14
24
  'pngerror.c',
@@ -27,6 +27,16 @@
27
27
  'include_dirs': [
28
28
  '<(module_root_dir)/src/deps/ZLib',
29
29
  ],
30
+ 'msvs_settings':
31
+ {
32
+ 'VCCLCompilerTool':
33
+ {
34
+ 'AdditionalOptions':
35
+ [
36
+ '/std:c++17',
37
+ ]
38
+ }
39
+ },
30
40
  'sources': [
31
41
  'tif_aux.c',
32
42
  'tif_close.c',
@@ -12,6 +12,16 @@
12
12
  }
13
13
  }]
14
14
  ],
15
+ 'msvs_settings':
16
+ {
17
+ 'VCCLCompilerTool':
18
+ {
19
+ 'AdditionalOptions':
20
+ [
21
+ '/std:c++17',
22
+ ]
23
+ }
24
+ },
15
25
  'dependencies': [
16
26
  '<(module_root_dir)/src/deps/LibAesgm/binding.gyp:libaesgm',
17
27
  '<(module_root_dir)/src/deps/FreeType/binding.gyp:freetype',
@@ -3,6 +3,16 @@
3
3
  {
4
4
  'target_name': 'zlib',
5
5
  'type': 'static_library',
6
+ 'msvs_settings':
7
+ {
8
+ 'VCCLCompilerTool':
9
+ {
10
+ 'AdditionalOptions':
11
+ [
12
+ '/std:c++17',
13
+ ]
14
+ }
15
+ },
6
16
  'sources': [
7
17
  'adler32.c',
8
18
  'compress.c',