plist 3.0.0 → 3.0.4

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/.travis.yml CHANGED
@@ -1,7 +1,6 @@
1
- sudo: false
2
-
1
+ dist: xenial
2
+ os: linux
3
3
  language: node_js
4
-
5
4
  node_js:
6
5
  - '6'
7
6
  - '7'
@@ -10,24 +9,14 @@ node_js:
10
9
 
11
10
  env:
12
11
  global:
13
- - secure: xlLmWO7akYQjmDgrv6/b/ZMGILF8FReD+k6A/u8pYRD2JW29hhwvRwIQGcKp9+zmJdn4i5M4D1/qJkCeI3pdhAYBDHvzHOHSEwLJz1ESB2Crv6fa69CtpIufQkWvIxmZoU49tCaLpMBaIroGihJ4DAXdIVOIz6Ur9vXLDhGsE4c=
14
- - secure: aQ46RdxL10xR5ZJJTMUKdH5k4tdrzgZ87nlwHC+pTr6bfRw3UKYC+6Rm7yQpg9wq0Io9O9dYCP007gQGSWstbjr1+jXNu/ubtNG+q5cpWBQZZZ013VHh9QJTf1MnetsZxbv8Yhrjg590s6vruT0oqesOnB2CizO/BsKxnY37Nos=
12
+ - secure: R4tCAipsC0KdBPin8+rWedqptn0RXksLM20yZ0w8En0hhaglWCiIxA5uKt/6njXp9Q8FEKkVOyWF+yjq74jB6+KUu0dSK30pbmaAHhlXsL5kTWmY9vd7rxwcn1Hdf1sW15NqRX4hvWuIC32cA7vDr+58VPyum+A+yvPJICvgIlw=
13
+ - secure: sfEwCcmUrfFPIRPV8UwdJymRZ8YY20fuJiAlWfOUQSOccNGWB4RbUsD+iyc9XW5qB1kdOqxVkvZ0sKrYo3Uc4k8mhar7+yhP04hfNj4CWAigG3rtTugbar9kSQjwi/yEaTrb4kdP8HRYs5yjrEX/CGwjm3iHGOSyUw5du0PQfbk=
15
14
 
16
- matrix:
15
+ jobs:
17
16
  include:
18
- - node_js: '6'
17
+ - node_js: '8'
19
18
  env: BROWSER_NAME=chrome BROWSER_VERSION=latest
20
- - node_js: '6'
21
- env: BROWSER_NAME=chrome BROWSER_VERSION=29
22
- - node_js: '6'
19
+ - node_js: '8'
23
20
  env: BROWSER_NAME=firefox BROWSER_VERSION=latest
24
- - node_js: '6'
25
- env: BROWSER_NAME=safari BROWSER_VERSION=latest
26
- - node_js: '6'
27
- env: BROWSER_NAME=safari BROWSER_VERSION=7
28
- - node_js: '6'
21
+ - node_js: '8'
29
22
  env: BROWSER_NAME=ie BROWSER_VERSION=11
30
- - node_js: '6'
31
- env: BROWSER_NAME=ie BROWSER_VERSION=10
32
- - node_js: '6'
33
- env: BROWSER_NAME=ie BROWSER_VERSION=9
package/History.md CHANGED
@@ -1,3 +1,15 @@
1
+ 3.0.2 / 2021-03-25
2
+ ==================
3
+ * update xmldom to 0.5.0 to patch critical vulnerability (Mike Reinstein)
4
+ * update saucelab credentials to point at mreinstein's saucelabs account (Mike Reinstein)
5
+ * remove a bunch of test versions from the matrix because they weren't working in zuul + sauce (Mike Reinstein)
6
+
7
+
8
+ 3.0.1 / 2018-03-21
9
+ ==================
10
+ * avoid using Buffer constructor nodejs/node#19079
11
+
12
+
1
13
  3.0.0 / 2018-03-18
2
14
  ==================
3
15
  * [[`cb0d8f1bc6`]](https://github.com/TooTallNate/plist.js/commit/cb0d8f1bc60dee423f8fc2cfcac427452dfaddb0) update Makefile, rebuild dist/ (Mike Reinstein)
package/README.md CHANGED
@@ -2,8 +2,6 @@ plist.js
2
2
  ========
3
3
  ### Mac OS X Plist parser/builder for Node.js and browsers
4
4
 
5
- [![Sauce Test Status](https://saucelabs.com/browser-matrix/plistjs.svg)](https://saucelabs.com/u/plistjs)
6
-
7
5
  [![Build Status](https://travis-ci.org/TooTallNate/plist.js.svg?branch=master)](https://travis-ci.org/TooTallNate/plist.js)
8
6
 
9
7
  Provides facilities for reading and writing Mac OS X Plist (property list)
@@ -136,6 +134,13 @@ console.log(plist.build(json));
136
134
  // </plist>
137
135
  ```
138
136
 
137
+ ## Cross Platform Testing Credits
138
+
139
+ Much thanks to Sauce Labs for providing free resources that enable cross-browser testing on this project!
140
+
141
+ [![Testing Powered By SauceLabs](https://opensource.saucelabs.com/images/opensauce/powered-by-saucelabs-badge-red.png?sanitize=true "Testing Powered By SauceLabs")](https://saucelabs.com)
142
+
143
+
139
144
  ## License
140
145
 
141
146
  [(The MIT License)](LICENSE)
@@ -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 (){
3
3
  /**
4
4
  * Module dependencies.
5
5
  */
@@ -138,7 +138,7 @@ function walk_obj(next, next_child) {
138
138
  }
139
139
  }
140
140
 
141
- }).call(this,{"isBuffer":require("../node_modules/is-buffer/index.js")})
141
+ }).call(this)}).call(this,{"isBuffer":require("../node_modules/is-buffer/index.js")})
142
142
  },{"../node_modules/is-buffer/index.js":3,"base64-js":2,"xmlbuilder":25}],2:[function(require,module,exports){
143
143
  'use strict'
144
144
 
@@ -161,65 +161,98 @@ for (var i = 0, len = code.length; i < len; ++i) {
161
161
  revLookup['-'.charCodeAt(0)] = 62
162
162
  revLookup['_'.charCodeAt(0)] = 63
163
163
 
164
- function placeHoldersCount (b64) {
164
+ function getLens (b64) {
165
165
  var len = b64.length
166
+
166
167
  if (len % 4 > 0) {
167
168
  throw new Error('Invalid string. Length must be a multiple of 4')
168
169
  }
169
170
 
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]
176
181
  }
177
182
 
183
+ // base64 is 4/3 + up to two characters of the original data
178
184
  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
181
193
  }
182
194
 
183
195
  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]
187
200
 
188
- arr = new Arr((len * 3 / 4) - placeHolders)
201
+ var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
189
202
 
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
192
204
 
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
+ }
194
221
 
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
200
227
  }
201
228
 
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
209
236
  }
210
237
 
211
238
  return arr
212
239
  }
213
240
 
214
241
  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]
216
246
  }
217
247
 
218
248
  function encodeChunk (uint8, start, end) {
219
249
  var tmp
220
250
  var output = []
221
251
  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)
223
256
  output.push(tripletToBase64(tmp))
224
257
  }
225
258
  return output.join('')
@@ -229,7 +262,6 @@ function fromByteArray (uint8) {
229
262
  var tmp
230
263
  var len = uint8.length
231
264
  var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
232
- var output = ''
233
265
  var parts = []
234
266
  var maxChunkLength = 16383 // must be multiple of 3
235
267
 
@@ -241,19 +273,21 @@ function fromByteArray (uint8) {
241
273
  // pad the end with zeros, but make sure to not forget the extra bytes
242
274
  if (extraBytes === 1) {
243
275
  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
+ )
247
281
  } 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
+ )
253
289
  }
254
290
 
255
- parts.push(output)
256
-
257
291
  return parts.join('')
258
292
  }
259
293