Skip to content

Commit e828f84

Browse files
committedMar 26, 2021
update deps
1 parent e7b0394 commit e828f84

File tree

5 files changed

+4381
-2959
lines changed

5 files changed

+4381
-2959
lines changed
 

‎dist/plist-build.js

+78-44
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.plist = f()}})(function(){var define,module,exports;return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){
2-
(function (Buffer){
1+
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.plist = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
2+
(function (Buffer){(function (){
33
/**
44
* Module dependencies.
55
*/
@@ -138,7 +138,7 @@ function walk_obj(next, next_child) {
138138
}
139139
}
140140

141-
}).call(this,{"isBuffer":require("../node_modules/is-buffer/index.js")})
141+
}).call(this)}).call(this,{"isBuffer":require("../node_modules/is-buffer/index.js")})
142142
},{"../node_modules/is-buffer/index.js":3,"base64-js":2,"xmlbuilder":25}],2:[function(require,module,exports){
143143
'use strict'
144144

@@ -161,65 +161,98 @@ for (var i = 0, len = code.length; i < len; ++i) {
161161
revLookup['-'.charCodeAt(0)] = 62
162162
revLookup['_'.charCodeAt(0)] = 63
163163

164-
function placeHoldersCount (b64) {
164+
function getLens (b64) {
165165
var len = b64.length
166+
166167
if (len % 4 > 0) {
167168
throw new Error('Invalid string. Length must be a multiple of 4')
168169
}
169170

170-
// the number of equal signs (place holders)
171-
// if there are two placeholders, than the two characters before it
172-
// represent one byte
173-
// if there is only one, then the three characters before it represent 2 bytes
174-
// this is just a cheap hack to not do indexOf twice
175-
return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
171+
// Trim off extra bytes after placeholder bytes are found
172+
// See: https://github.com/beatgammit/base64-js/issues/42
173+
var validLen = b64.indexOf('=')
174+
if (validLen === -1) validLen = len
175+
176+
var placeHoldersLen = validLen === len
177+
? 0
178+
: 4 - (validLen % 4)
179+
180+
return [validLen, placeHoldersLen]
176181
}
177182

183+
// base64 is 4/3 + up to two characters of the original data
178184
function byteLength (b64) {
179-
// base64 is 4/3 + up to two characters of the original data
180-
return (b64.length * 3 / 4) - placeHoldersCount(b64)
185+
var lens = getLens(b64)
186+
var validLen = lens[0]
187+
var placeHoldersLen = lens[1]
188+
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
189+
}
190+
191+
function _byteLength (b64, validLen, placeHoldersLen) {
192+
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
181193
}
182194

183195
function toByteArray (b64) {
184-
var i, l, tmp, placeHolders, arr
185-
var len = b64.length
186-
placeHolders = placeHoldersCount(b64)
196+
var tmp
197+
var lens = getLens(b64)
198+
var validLen = lens[0]
199+
var placeHoldersLen = lens[1]
187200

188-
arr = new Arr((len * 3 / 4) - placeHolders)
201+
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
189202

190-
// if there are placeholders, only get up to the last complete 4 chars
191-
l = placeHolders > 0 ? len - 4 : len
203+
var curByte = 0
192204

193-
var L = 0
205+
// if there are placeholders, only get up to the last complete 4 chars
206+
var len = placeHoldersLen > 0
207+
? validLen - 4
208+
: validLen
209+
210+
var i
211+
for (i = 0; i < len; i += 4) {
212+
tmp =
213+
(revLookup[b64.charCodeAt(i)] << 18) |
214+
(revLookup[b64.charCodeAt(i + 1)] << 12) |
215+
(revLookup[b64.charCodeAt(i + 2)] << 6) |
216+
revLookup[b64.charCodeAt(i + 3)]
217+
arr[curByte++] = (tmp >> 16) & 0xFF
218+
arr[curByte++] = (tmp >> 8) & 0xFF
219+
arr[curByte++] = tmp & 0xFF
220+
}
194221

195-
for (i = 0; i < l; i += 4) {
196-
tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
197-
arr[L++] = (tmp >> 16) & 0xFF
198-
arr[L++] = (tmp >> 8) & 0xFF
199-
arr[L++] = tmp & 0xFF
222+
if (placeHoldersLen === 2) {
223+
tmp =
224+
(revLookup[b64.charCodeAt(i)] << 2) |
225+
(revLookup[b64.charCodeAt(i + 1)] >> 4)
226+
arr[curByte++] = tmp & 0xFF
200227
}
201228

202-
if (placeHolders === 2) {
203-
tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
204-
arr[L++] = tmp & 0xFF
205-
} else if (placeHolders === 1) {
206-
tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
207-
arr[L++] = (tmp >> 8) & 0xFF
208-
arr[L++] = tmp & 0xFF
229+
if (placeHoldersLen === 1) {
230+
tmp =
231+
(revLookup[b64.charCodeAt(i)] << 10) |
232+
(revLookup[b64.charCodeAt(i + 1)] << 4) |
233+
(revLookup[b64.charCodeAt(i + 2)] >> 2)
234+
arr[curByte++] = (tmp >> 8) & 0xFF
235+
arr[curByte++] = tmp & 0xFF
209236
}
210237

211238
return arr
212239
}
213240

214241
function tripletToBase64 (num) {
215-
return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
242+
return lookup[num >> 18 & 0x3F] +
243+
lookup[num >> 12 & 0x3F] +
244+
lookup[num >> 6 & 0x3F] +
245+
lookup[num & 0x3F]
216246
}
217247

218248
function encodeChunk (uint8, start, end) {
219249
var tmp
220250
var output = []
221251
for (var i = start; i < end; i += 3) {
222-
tmp = ((uint8[i] << 16) & 0xFF0000) + ((uint8[i + 1] << 8) & 0xFF00) + (uint8[i + 2] & 0xFF)
252+
tmp =
253+
((uint8[i] << 16) & 0xFF0000) +
254+
((uint8[i + 1] << 8) & 0xFF00) +
255+
(uint8[i + 2] & 0xFF)
223256
output.push(tripletToBase64(tmp))
224257
}
225258
return output.join('')
@@ -229,7 +262,6 @@ function fromByteArray (uint8) {
229262
var tmp
230263
var len = uint8.length
231264
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
232-
var output = ''
233265
var parts = []
234266
var maxChunkLength = 16383 // must be multiple of 3
235267

@@ -241,19 +273,21 @@ function fromByteArray (uint8) {
241273
// pad the end with zeros, but make sure to not forget the extra bytes
242274
if (extraBytes === 1) {
243275
tmp = uint8[len - 1]
244-
output += lookup[tmp >> 2]
245-
output += lookup[(tmp << 4) & 0x3F]
246-
output += '=='
276+
parts.push(
277+
lookup[tmp >> 2] +
278+
lookup[(tmp << 4) & 0x3F] +
279+
'=='
280+
)
247281
} else if (extraBytes === 2) {
248-
tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
249-
output += lookup[tmp >> 10]
250-
output += lookup[(tmp >> 4) & 0x3F]
251-
output += lookup[(tmp << 2) & 0x3F]
252-
output += '='
282+
tmp = (uint8[len - 2] << 8) + uint8[len - 1]
283+
parts.push(
284+
lookup[tmp >> 10] +
285+
lookup[(tmp >> 4) & 0x3F] +
286+
lookup[(tmp << 2) & 0x3F] +
287+
'='
288+
)
253289
}
254290

255-
parts.push(output)
256-
257291
return parts.join('')
258292
}
259293

‎dist/plist-parse.js

+1,366-999
Large diffs are not rendered by default.

‎dist/plist.js

+1,368-1,001
Large diffs are not rendered by default.

‎package-lock.json

+1,567-913
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
"dependencies": {
2828
"base64-js": "^1.5.1",
2929
"xmlbuilder": "^9.0.7",
30-
"xmldom": "^0.1.31"
30+
"xmldom": "^0.5.0"
3131
},
3232
"devDependencies": {
3333
"browserify": "^16.5.2",
34-
"mocha": "^5.2.0",
34+
"mocha": "^8.3.2",
3535
"multiline": "^1.0.2",
3636
"zuul": "3.10.1"
3737
},

0 commit comments

Comments
 (0)
Please sign in to comment.