Update dist/ with newest stuff

This commit is contained in:
David Humphrey 2018-05-29 14:03:59 -04:00
parent eee8200e23
commit c71a91f72f
8 changed files with 8291 additions and 7390 deletions

648
dist/buffer.js vendored
View File

@ -1,21 +1,150 @@
(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.FilerBuffer = f()}})(function(){var define,module,exports;return (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})({1:[function(require,module,exports){ (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.FilerBuffer = f()}})(function(){var define,module,exports;return (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})({1:[function(require,module,exports){
var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
;(function (exports) {
'use strict';
var Arr = (typeof Uint8Array !== 'undefined')
? Uint8Array
: Array
var PLUS = '+'.charCodeAt(0)
var SLASH = '/'.charCodeAt(0)
var NUMBER = '0'.charCodeAt(0)
var LOWER = 'a'.charCodeAt(0)
var UPPER = 'A'.charCodeAt(0)
var PLUS_URL_SAFE = '-'.charCodeAt(0)
var SLASH_URL_SAFE = '_'.charCodeAt(0)
function decode (elt) {
var code = elt.charCodeAt(0)
if (code === PLUS ||
code === PLUS_URL_SAFE)
return 62 // '+'
if (code === SLASH ||
code === SLASH_URL_SAFE)
return 63 // '/'
if (code < NUMBER)
return -1 //no match
if (code < NUMBER + 10)
return code - NUMBER + 26 + 26
if (code < UPPER + 26)
return code - UPPER
if (code < LOWER + 26)
return code - LOWER + 26
}
function b64ToByteArray (b64) {
var i, j, l, tmp, placeHolders, arr
if (b64.length % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
}
// the number of equal signs (place holders)
// if there are two placeholders, than the two characters before it
// represent one byte
// if there is only one, then the three characters before it represent 2 bytes
// this is just a cheap hack to not do indexOf twice
var len = b64.length
placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0
// base64 is 4/3 + up to two characters of the original data
arr = new Arr(b64.length * 3 / 4 - placeHolders)
// if there are placeholders, only get up to the last complete 4 chars
l = placeHolders > 0 ? b64.length - 4 : b64.length
var L = 0
function push (v) {
arr[L++] = v
}
for (i = 0, j = 0; i < l; i += 4, j += 3) {
tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))
push((tmp & 0xFF0000) >> 16)
push((tmp & 0xFF00) >> 8)
push(tmp & 0xFF)
}
if (placeHolders === 2) {
tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)
push(tmp & 0xFF)
} else if (placeHolders === 1) {
tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)
push((tmp >> 8) & 0xFF)
push(tmp & 0xFF)
}
return arr
}
function uint8ToBase64 (uint8) {
var i,
extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
output = "",
temp, length
function encode (num) {
return lookup.charAt(num)
}
function tripletToBase64 (num) {
return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
}
// go through the array every three bytes, we'll deal with trailing stuff later
for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
output += tripletToBase64(temp)
}
// pad the end with zeros, but make sure to not forget the extra bytes
switch (extraBytes) {
case 1:
temp = uint8[uint8.length - 1]
output += encode(temp >> 2)
output += encode((temp << 4) & 0x3F)
output += '=='
break
case 2:
temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])
output += encode(temp >> 10)
output += encode((temp >> 4) & 0x3F)
output += encode((temp << 2) & 0x3F)
output += '='
break
}
return output
}
exports.toByteArray = b64ToByteArray
exports.fromByteArray = uint8ToBase64
}(typeof exports === 'undefined' ? (this.base64js = {}) : exports))
},{}],2:[function(require,module,exports){
(function (global){
/*! /*!
* The buffer module from node.js, for the browser. * The buffer module from node.js, for the browser.
* *
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT * @license MIT
*/ */
/* eslint-disable no-proto */
'use strict'
var base64 = require('base64-js') var base64 = require('base64-js')
var ieee754 = require('ieee754') var ieee754 = require('ieee754')
var isArray = require('is-array') var isArray = require('isarray')
exports.Buffer = Buffer exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer exports.SlowBuffer = SlowBuffer
exports.INSPECT_MAX_BYTES = 50 exports.INSPECT_MAX_BYTES = 50
Buffer.poolSize = 8192 // not used by this implementation Buffer.poolSize = 8192 // not used by this implementation
var kMaxLength = 0x3fffffff
var rootParent = {} var rootParent = {}
/** /**
@ -26,32 +155,49 @@ var rootParent = {}
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
* Opera 11.6+, iOS 4.2+. * Opera 11.6+, iOS 4.2+.
* *
* Due to various browser bugs, sometimes the Object implementation will be used even
* when the browser supports typed arrays.
*
* Note: * Note:
* *
* - Implementation must support adding new properties to `Uint8Array` instances. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
* Firefox 4-29 lacked support, fixed in Firefox 30+. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
* See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
* *
* - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property
* on objects.
* *
* - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
* incorrect length in some situations.
* *
* We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they will * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
* get the Object implementation, which is slower but will work correctly. * incorrect length in some situations.
* We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
* get the Object implementation, which is slower but behaves correctly.
*/ */
Buffer.TYPED_ARRAY_SUPPORT = (function () { Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
? global.TYPED_ARRAY_SUPPORT
: typedArraySupport()
function typedArraySupport () {
function Bar () {}
try { try {
var buf = new ArrayBuffer(0) var arr = new Uint8Array(1)
var arr = new Uint8Array(buf)
arr.foo = function () { return 42 } arr.foo = function () { return 42 }
arr.constructor = Bar
return arr.foo() === 42 && // typed array instances can be augmented return arr.foo() === 42 && // typed array instances can be augmented
arr.constructor === Bar && // constructor can be set
typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
new Uint8Array(1).subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
} catch (e) { } catch (e) {
return false return false
} }
})() }
function kMaxLength () {
return Buffer.TYPED_ARRAY_SUPPORT
? 0x7fffffff
: 0x3fffffff
}
/** /**
* Class: Buffer * Class: Buffer
@ -72,8 +218,10 @@ function Buffer (arg) {
return new Buffer(arg) return new Buffer(arg)
} }
this.length = 0 if (!Buffer.TYPED_ARRAY_SUPPORT) {
this.parent = undefined this.length = 0
this.parent = undefined
}
// Common case. // Common case.
if (typeof arg === 'number') { if (typeof arg === 'number') {
@ -119,8 +267,13 @@ function fromObject (that, object) {
throw new TypeError('must start with number, buffer, array or string') throw new TypeError('must start with number, buffer, array or string')
} }
if (typeof ArrayBuffer !== 'undefined' && object.buffer instanceof ArrayBuffer) { if (typeof ArrayBuffer !== 'undefined') {
return fromTypedArray(that, object) if (object.buffer instanceof ArrayBuffer) {
return fromTypedArray(that, object)
}
if (object instanceof ArrayBuffer) {
return fromArrayBuffer(that, object)
}
} }
if (object.length) return fromArrayLike(that, object) if (object.length) return fromArrayLike(that, object)
@ -157,6 +310,18 @@ function fromTypedArray (that, array) {
return that return that
} }
function fromArrayBuffer (that, array) {
if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
array.byteLength
that = Buffer._augment(new Uint8Array(array))
} else {
// Fallback: Return an object instance of the Buffer class
that = fromTypedArray(that, new Uint8Array(array))
}
return that
}
function fromArrayLike (that, array) { function fromArrayLike (that, array) {
var length = checked(array.length) | 0 var length = checked(array.length) | 0
that = allocate(that, length) that = allocate(that, length)
@ -184,10 +349,20 @@ function fromJsonObject (that, object) {
return that return that
} }
if (Buffer.TYPED_ARRAY_SUPPORT) {
Buffer.prototype.__proto__ = Uint8Array.prototype
Buffer.__proto__ = Uint8Array
} else {
// pre-set for values that may exist in the future
Buffer.prototype.length = undefined
Buffer.prototype.parent = undefined
}
function allocate (that, length) { function allocate (that, length) {
if (Buffer.TYPED_ARRAY_SUPPORT) { if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance // Return an augmented `Uint8Array` instance, for best performance
that = Buffer._augment(new Uint8Array(length)) that = Buffer._augment(new Uint8Array(length))
that.__proto__ = Buffer.prototype
} else { } else {
// Fallback: Return an object instance of the Buffer class // Fallback: Return an object instance of the Buffer class
that.length = length that.length = length
@ -203,9 +378,9 @@ function allocate (that, length) {
function checked (length) { function checked (length) {
// Note: cannot use `length < kMaxLength` here because that fails when // Note: cannot use `length < kMaxLength` here because that fails when
// length is NaN (which is otherwise coerced to zero.) // length is NaN (which is otherwise coerced to zero.)
if (length >= kMaxLength) { if (length >= kMaxLength()) {
throw new RangeError('Attempt to allocate Buffer larger than maximum ' + throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
'size: 0x' + kMaxLength.toString(16) + ' bytes') 'size: 0x' + kMaxLength().toString(16) + ' bytes')
} }
return length | 0 return length | 0
} }
@ -274,8 +449,6 @@ Buffer.concat = function concat (list, length) {
if (list.length === 0) { if (list.length === 0) {
return new Buffer(0) return new Buffer(0)
} else if (list.length === 1) {
return list[0]
} }
var i var i
@ -297,39 +470,43 @@ Buffer.concat = function concat (list, length) {
} }
function byteLength (string, encoding) { function byteLength (string, encoding) {
if (typeof string !== 'string') string = String(string) if (typeof string !== 'string') string = '' + string
if (string.length === 0) return 0 var len = string.length
if (len === 0) return 0
switch (encoding || 'utf8') { // Use a for loop to avoid recursion
case 'ascii': var loweredCase = false
case 'binary': for (;;) {
case 'raw': switch (encoding) {
return string.length case 'ascii':
case 'ucs2': case 'binary':
case 'ucs-2': // Deprecated
case 'utf16le': case 'raw':
case 'utf-16le': case 'raws':
return string.length * 2 return len
case 'hex': case 'utf8':
return string.length >>> 1 case 'utf-8':
case 'utf8': return utf8ToBytes(string).length
case 'utf-8': case 'ucs2':
return utf8ToBytes(string).length case 'ucs-2':
case 'base64': case 'utf16le':
return base64ToBytes(string).length case 'utf-16le':
default: return len * 2
return string.length case 'hex':
return len >>> 1
case 'base64':
return base64ToBytes(string).length
default:
if (loweredCase) return utf8ToBytes(string).length // assume utf8
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
} }
} }
Buffer.byteLength = byteLength Buffer.byteLength = byteLength
// pre-set for values that may exist in the future function slowToString (encoding, start, end) {
Buffer.prototype.length = undefined
Buffer.prototype.parent = undefined
// toString(encoding, start=0, end=buffer.length)
Buffer.prototype.toString = function toString (encoding, start, end) {
var loweredCase = false var loweredCase = false
start = start | 0 start = start | 0
@ -372,6 +549,13 @@ Buffer.prototype.toString = function toString (encoding, start, end) {
} }
} }
Buffer.prototype.toString = function toString () {
var length = this.length | 0
if (length === 0) return ''
if (arguments.length === 0) return utf8Slice(this, 0, length)
return slowToString.apply(this, arguments)
}
Buffer.prototype.equals = function equals (b) { Buffer.prototype.equals = function equals (b) {
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
if (this === b) return true if (this === b) return true
@ -435,13 +619,13 @@ Buffer.prototype.indexOf = function indexOf (val, byteOffset) {
throw new TypeError('val must be string, number or Buffer') throw new TypeError('val must be string, number or Buffer')
} }
// `get` will be removed in Node 0.13+ // `get` is deprecated
Buffer.prototype.get = function get (offset) { Buffer.prototype.get = function get (offset) {
console.log('.get() is deprecated. Access using array indexes instead.') console.log('.get() is deprecated. Access using array indexes instead.')
return this.readUInt8(offset) return this.readUInt8(offset)
} }
// `set` will be removed in Node 0.13+ // `set` is deprecated
Buffer.prototype.set = function set (v, offset) { Buffer.prototype.set = function set (v, offset) {
console.log('.set() is deprecated. Access using array indexes instead.') console.log('.set() is deprecated. Access using array indexes instead.')
return this.writeUInt8(v, offset) return this.writeUInt8(v, offset)
@ -582,20 +766,99 @@ function base64Slice (buf, start, end) {
} }
function utf8Slice (buf, start, end) { function utf8Slice (buf, start, end) {
var res = ''
var tmp = ''
end = Math.min(buf.length, end) end = Math.min(buf.length, end)
var res = []
for (var i = start; i < end; i++) { var i = start
if (buf[i] <= 0x7F) { while (i < end) {
res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i]) var firstByte = buf[i]
tmp = '' var codePoint = null
} else { var bytesPerSequence = (firstByte > 0xEF) ? 4
tmp += '%' + buf[i].toString(16) : (firstByte > 0xDF) ? 3
: (firstByte > 0xBF) ? 2
: 1
if (i + bytesPerSequence <= end) {
var secondByte, thirdByte, fourthByte, tempCodePoint
switch (bytesPerSequence) {
case 1:
if (firstByte < 0x80) {
codePoint = firstByte
}
break
case 2:
secondByte = buf[i + 1]
if ((secondByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
if (tempCodePoint > 0x7F) {
codePoint = tempCodePoint
}
}
break
case 3:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
codePoint = tempCodePoint
}
}
break
case 4:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
fourthByte = buf[i + 3]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
codePoint = tempCodePoint
}
}
}
} }
if (codePoint === null) {
// we did not generate a valid codePoint so insert a
// replacement char (U+FFFD) and advance only 1 byte
codePoint = 0xFFFD
bytesPerSequence = 1
} else if (codePoint > 0xFFFF) {
// encode to utf16 (surrogate pair dance)
codePoint -= 0x10000
res.push(codePoint >>> 10 & 0x3FF | 0xD800)
codePoint = 0xDC00 | codePoint & 0x3FF
}
res.push(codePoint)
i += bytesPerSequence
} }
return res + decodeUtf8Char(tmp) return decodeCodePointsArray(res)
}
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
var MAX_ARGUMENTS_LENGTH = 0x1000
function decodeCodePointsArray (codePoints) {
var len = codePoints.length
if (len <= MAX_ARGUMENTS_LENGTH) {
return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
}
// Decode in chunks to avoid "call stack size exceeded".
var res = ''
var i = 0
while (i < len) {
res += String.fromCharCode.apply(
String,
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
)
}
return res
} }
function asciiSlice (buf, start, end) { function asciiSlice (buf, start, end) {
@ -884,7 +1147,7 @@ Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
offset = offset | 0 offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
this[offset] = value this[offset] = (value & 0xff)
return offset + 1 return offset + 1
} }
@ -901,7 +1164,7 @@ Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert
offset = offset | 0 offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) { if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = value this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8) this[offset + 1] = (value >>> 8)
} else { } else {
objectWriteUInt16(this, value, offset, true) objectWriteUInt16(this, value, offset, true)
@ -915,7 +1178,7 @@ Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) { if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8) this[offset] = (value >>> 8)
this[offset + 1] = value this[offset + 1] = (value & 0xff)
} else { } else {
objectWriteUInt16(this, value, offset, false) objectWriteUInt16(this, value, offset, false)
} }
@ -937,7 +1200,7 @@ Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert
this[offset + 3] = (value >>> 24) this[offset + 3] = (value >>> 24)
this[offset + 2] = (value >>> 16) this[offset + 2] = (value >>> 16)
this[offset + 1] = (value >>> 8) this[offset + 1] = (value >>> 8)
this[offset] = value this[offset] = (value & 0xff)
} else { } else {
objectWriteUInt32(this, value, offset, true) objectWriteUInt32(this, value, offset, true)
} }
@ -952,7 +1215,7 @@ Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert
this[offset] = (value >>> 24) this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16) this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8) this[offset + 2] = (value >>> 8)
this[offset + 3] = value this[offset + 3] = (value & 0xff)
} else { } else {
objectWriteUInt32(this, value, offset, false) objectWriteUInt32(this, value, offset, false)
} }
@ -1005,7 +1268,7 @@ Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
if (value < 0) value = 0xff + value + 1 if (value < 0) value = 0xff + value + 1
this[offset] = value this[offset] = (value & 0xff)
return offset + 1 return offset + 1
} }
@ -1014,7 +1277,7 @@ Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert)
offset = offset | 0 offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) { if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = value this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8) this[offset + 1] = (value >>> 8)
} else { } else {
objectWriteUInt16(this, value, offset, true) objectWriteUInt16(this, value, offset, true)
@ -1028,7 +1291,7 @@ Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert)
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) { if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8) this[offset] = (value >>> 8)
this[offset + 1] = value this[offset + 1] = (value & 0xff)
} else { } else {
objectWriteUInt16(this, value, offset, false) objectWriteUInt16(this, value, offset, false)
} }
@ -1040,7 +1303,7 @@ Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert)
offset = offset | 0 offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (Buffer.TYPED_ARRAY_SUPPORT) { if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = value this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8) this[offset + 1] = (value >>> 8)
this[offset + 2] = (value >>> 16) this[offset + 2] = (value >>> 16)
this[offset + 3] = (value >>> 24) this[offset + 3] = (value >>> 24)
@ -1059,7 +1322,7 @@ Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert)
this[offset] = (value >>> 24) this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16) this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8) this[offset + 2] = (value >>> 8)
this[offset + 3] = value this[offset + 3] = (value & 0xff)
} else { } else {
objectWriteUInt32(this, value, offset, false) objectWriteUInt32(this, value, offset, false)
} }
@ -1130,9 +1393,16 @@ Buffer.prototype.copy = function copy (target, targetStart, start, end) {
} }
var len = end - start var len = end - start
var i
if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { if (this === target && start < targetStart && targetStart < end) {
for (var i = 0; i < len; i++) { // descending copy from end
for (i = len - 1; i >= 0; i--) {
target[i + targetStart] = this[i + start]
}
} else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
// ascending copy from start
for (i = 0; i < len; i++) {
target[i + targetStart] = this[i + start] target[i + targetStart] = this[i + start]
} }
} else { } else {
@ -1208,7 +1478,7 @@ Buffer._augment = function _augment (arr) {
// save reference to original Uint8Array set method before overwriting // save reference to original Uint8Array set method before overwriting
arr._set = arr.set arr._set = arr.set
// deprecated, will be removed in node 0.13+ // deprecated
arr.get = BP.get arr.get = BP.get
arr.set = BP.set arr.set = BP.set
@ -1264,7 +1534,7 @@ Buffer._augment = function _augment (arr) {
return arr return arr
} }
var INVALID_BASE64_RE = /[^+\/0-9A-z\-]/g var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
function base64clean (str) { function base64clean (str) {
// Node strips out invalid characters like \n and \t from the string, base64-js does not // Node strips out invalid characters like \n and \t from the string, base64-js does not
@ -1294,28 +1564,15 @@ function utf8ToBytes (string, units) {
var length = string.length var length = string.length
var leadSurrogate = null var leadSurrogate = null
var bytes = [] var bytes = []
var i = 0
for (; i < length; i++) { for (var i = 0; i < length; i++) {
codePoint = string.charCodeAt(i) codePoint = string.charCodeAt(i)
// is surrogate component // is surrogate component
if (codePoint > 0xD7FF && codePoint < 0xE000) { if (codePoint > 0xD7FF && codePoint < 0xE000) {
// last char was a lead // last char was a lead
if (leadSurrogate) { if (!leadSurrogate) {
// 2 leads in a row
if (codePoint < 0xDC00) {
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
leadSurrogate = codePoint
continue
} else {
// valid surrogate pair
codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000
leadSurrogate = null
}
} else {
// no lead yet // no lead yet
if (codePoint > 0xDBFF) { if (codePoint > 0xDBFF) {
// unexpected trail // unexpected trail
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
@ -1324,18 +1581,30 @@ function utf8ToBytes (string, units) {
// unpaired lead // unpaired lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue continue
} else {
// valid lead
leadSurrogate = codePoint
continue
} }
// valid lead
leadSurrogate = codePoint
continue
} }
// 2 leads in a row
if (codePoint < 0xDC00) {
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
leadSurrogate = codePoint
continue
}
// valid surrogate pair
codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
} else if (leadSurrogate) { } else if (leadSurrogate) {
// valid bmp char, but last char was a lead // valid bmp char, but last char was a lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
leadSurrogate = null
} }
leadSurrogate = null
// encode utf8 // encode utf8
if (codePoint < 0x80) { if (codePoint < 0x80) {
if ((units -= 1) < 0) break if ((units -= 1) < 0) break
@ -1353,7 +1622,7 @@ function utf8ToBytes (string, units) {
codePoint >> 0x6 & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80 codePoint & 0x3F | 0x80
) )
} else if (codePoint < 0x200000) { } else if (codePoint < 0x110000) {
if ((units -= 4) < 0) break if ((units -= 4) < 0) break
bytes.push( bytes.push(
codePoint >> 0x12 | 0xF0, codePoint >> 0x12 | 0xF0,
@ -1406,144 +1675,18 @@ function blitBuffer (src, dst, offset, length) {
return i return i
} }
function decodeUtf8Char (str) { }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
try { },{"base64-js":1,"ieee754":4,"isarray":3}],3:[function(require,module,exports){
return decodeURIComponent(str) var toString = {}.toString;
} catch (err) {
return String.fromCharCode(0xFFFD) // UTF 8 invalid char
}
}
},{"base64-js":2,"ieee754":3,"is-array":4}],2:[function(require,module,exports){ module.exports = Array.isArray || function (arr) {
var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; return toString.call(arr) == '[object Array]';
};
;(function (exports) { },{}],4:[function(require,module,exports){
'use strict';
var Arr = (typeof Uint8Array !== 'undefined')
? Uint8Array
: Array
var PLUS = '+'.charCodeAt(0)
var SLASH = '/'.charCodeAt(0)
var NUMBER = '0'.charCodeAt(0)
var LOWER = 'a'.charCodeAt(0)
var UPPER = 'A'.charCodeAt(0)
var PLUS_URL_SAFE = '-'.charCodeAt(0)
var SLASH_URL_SAFE = '_'.charCodeAt(0)
function decode (elt) {
var code = elt.charCodeAt(0)
if (code === PLUS ||
code === PLUS_URL_SAFE)
return 62 // '+'
if (code === SLASH ||
code === SLASH_URL_SAFE)
return 63 // '/'
if (code < NUMBER)
return -1 //no match
if (code < NUMBER + 10)
return code - NUMBER + 26 + 26
if (code < UPPER + 26)
return code - UPPER
if (code < LOWER + 26)
return code - LOWER + 26
}
function b64ToByteArray (b64) {
var i, j, l, tmp, placeHolders, arr
if (b64.length % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
}
// the number of equal signs (place holders)
// if there are two placeholders, than the two characters before it
// represent one byte
// if there is only one, then the three characters before it represent 2 bytes
// this is just a cheap hack to not do indexOf twice
var len = b64.length
placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0
// base64 is 4/3 + up to two characters of the original data
arr = new Arr(b64.length * 3 / 4 - placeHolders)
// if there are placeholders, only get up to the last complete 4 chars
l = placeHolders > 0 ? b64.length - 4 : b64.length
var L = 0
function push (v) {
arr[L++] = v
}
for (i = 0, j = 0; i < l; i += 4, j += 3) {
tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))
push((tmp & 0xFF0000) >> 16)
push((tmp & 0xFF00) >> 8)
push(tmp & 0xFF)
}
if (placeHolders === 2) {
tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)
push(tmp & 0xFF)
} else if (placeHolders === 1) {
tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)
push((tmp >> 8) & 0xFF)
push(tmp & 0xFF)
}
return arr
}
function uint8ToBase64 (uint8) {
var i,
extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
output = "",
temp, length
function encode (num) {
return lookup.charAt(num)
}
function tripletToBase64 (num) {
return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
}
// go through the array every three bytes, we'll deal with trailing stuff later
for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
output += tripletToBase64(temp)
}
// pad the end with zeros, but make sure to not forget the extra bytes
switch (extraBytes) {
case 1:
temp = uint8[uint8.length - 1]
output += encode(temp >> 2)
output += encode((temp << 4) & 0x3F)
output += '=='
break
case 2:
temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])
output += encode(temp >> 10)
output += encode((temp >> 4) & 0x3F)
output += encode((temp << 2) & 0x3F)
output += '='
break
}
return output
}
exports.toByteArray = b64ToByteArray
exports.fromByteArray = uint8ToBase64
}(typeof exports === 'undefined' ? (this.base64js = {}) : exports))
},{}],3:[function(require,module,exports){
exports.read = function (buffer, offset, isLE, mLen, nBytes) { exports.read = function (buffer, offset, isLE, mLen, nBytes) {
var e, m var e, m
var eLen = nBytes * 8 - mLen - 1 var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1 var eMax = (1 << eLen) - 1
var eBias = eMax >> 1 var eBias = eMax >> 1
var nBits = -7 var nBits = -7
@ -1556,12 +1699,12 @@ exports.read = function (buffer, offset, isLE, mLen, nBytes) {
e = s & ((1 << (-nBits)) - 1) e = s & ((1 << (-nBits)) - 1)
s >>= (-nBits) s >>= (-nBits)
nBits += eLen nBits += eLen
for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
m = e & ((1 << (-nBits)) - 1) m = e & ((1 << (-nBits)) - 1)
e >>= (-nBits) e >>= (-nBits)
nBits += mLen nBits += mLen
for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
if (e === 0) { if (e === 0) {
e = 1 - eBias e = 1 - eBias
@ -1576,7 +1719,7 @@ exports.read = function (buffer, offset, isLE, mLen, nBytes) {
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
var e, m, c var e, m, c
var eLen = nBytes * 8 - mLen - 1 var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1 var eMax = (1 << eLen) - 1
var eBias = eMax >> 1 var eBias = eMax >> 1
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
@ -1609,7 +1752,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
m = 0 m = 0
e = eMax e = eMax
} else if (e + eBias >= 1) { } else if (e + eBias >= 1) {
m = (value * c - 1) * Math.pow(2, mLen) m = ((value * c) - 1) * Math.pow(2, mLen)
e = e + eBias e = e + eBias
} else { } else {
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
@ -1626,41 +1769,6 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
buffer[offset + i - d] |= s * 128 buffer[offset + i - d] |= s * 128
} }
},{}],4:[function(require,module,exports){
/**
* isArray
*/
var isArray = Array.isArray;
/**
* toString
*/
var str = Object.prototype.toString;
/**
* Whether or not the given `val`
* is an array.
*
* example:
*
* isArray([]);
* // > true
* isArray(arguments);
* // > false
* isArray('');
* // > false
*
* @param {mixed} val
* @return {bool}
*/
module.exports = isArray || function (val) {
return !! val && '[object Array]' == str.call(val);
};
},{}],5:[function(require,module,exports){ },{}],5:[function(require,module,exports){
(function (Buffer){ (function (Buffer){
function FilerBuffer (subject, encoding, nonZero) { function FilerBuffer (subject, encoding, nonZero) {
@ -1688,5 +1796,5 @@ Object.keys(Buffer).forEach(function (p) {
module.exports = FilerBuffer; module.exports = FilerBuffer;
}).call(this,require("buffer").Buffer) }).call(this,require("buffer").Buffer)
},{"buffer":1}]},{},[5])(5) },{"buffer":2}]},{},[5])(5)
}); });

4
dist/buffer.min.js vendored

File diff suppressed because one or more lines are too long

4683
dist/filer-perf.js vendored

File diff suppressed because it is too large Load Diff

8204
dist/filer-test.js vendored

File diff suppressed because it is too large Load Diff

2120
dist/filer.js vendored

File diff suppressed because it is too large Load Diff

8
dist/filer.min.js vendored

File diff suppressed because one or more lines are too long

4
dist/path.min.js vendored
View File

@ -1,2 +1,2 @@
/*! filer 0.0.44 2017-05-25 */ /*! filer 0.0.44 2018-05-29 */
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.Path=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){function d(a,b){for(var c=0,d=a.length-1;d>=0;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}function e(){for(var a="",b=!1,c=arguments.length-1;c>=-1&&!b;c--){var e=c>=0?arguments[c]:"/";"string"==typeof e&&e&&(a=e+"/"+a,b="/"===e.charAt(0))}return a=d(a.split("/").filter(function(a){return!!a}),!b).join("/"),(b?"/":"")+a||"."}function f(a){var b="/"===a.charAt(0);"/"===a.substr(-1);return a=d(a.split("/").filter(function(a){return!!a}),!b).join("/"),a||b||(a="."),(b?"/":"")+a}function g(){var a=Array.prototype.slice.call(arguments,0);return f(a.filter(function(a,b){return a&&"string"==typeof a}).join("/"))}function h(a,b){function c(a){for(var b=0;b<a.length&&""===a[b];b++);for(var c=a.length-1;c>=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=e(a).substr(1),b=e(b).substr(1);for(var d=c(a.split("/")),f=c(b.split("/")),g=Math.min(d.length,f.length),h=g,i=0;g>i;i++)if(d[i]!==f[i]){h=i;break}for(var j=[],i=h;i<d.length;i++)j.push("..");return j=j.concat(f.slice(h)),j.join("/")}function i(a){var b=q(a),c=b[0],d=b[1];return c||d?(d&&(d=d.substr(0,d.length-1)),c+d):"."}function j(a,b){var c=q(a)[2];return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),""===c?"/":c}function k(a){return q(a)[3]}function l(a){return"/"===a.charAt(0)?!0:!1}function m(a){return-1!==(""+a).indexOf("\x00")?!0:!1}function n(a){return a.replace(/\/*$/,"/")}function o(a){return a=a.replace(/\/*$/,""),""===a?"/":a}var p=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,q=function(a){var b=p.exec(a);return[b[1]||"",b[2]||"",b[3]||"",b[4]||""]};b.exports={normalize:f,resolve:e,join:g,relative:h,sep:"/",delimiter:":",dirname:i,basename:j,extname:k,isAbsolute:l,isNull:m,addTrailing:n,removeTrailing:o}},{}]},{},[1])(1)}); !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.Path=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){function d(a,b){for(var c=0,d=a.length-1;d>=0;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}function e(){for(var a="",b=!1,c=arguments.length-1;c>=-1&&!b;c--){var e=c>=0?arguments[c]:"/";"string"==typeof e&&e&&(a=e+"/"+a,b="/"===e.charAt(0))}return a=d(a.split("/").filter(function(a){return!!a}),!b).join("/"),(b?"/":"")+a||"."}function f(a){var b="/"===a.charAt(0);a.substr(-1);return a=d(a.split("/").filter(function(a){return!!a}),!b).join("/"),a||b||(a="."),(b?"/":"")+a}function g(){return f(Array.prototype.slice.call(arguments,0).filter(function(a,b){return a&&"string"==typeof a}).join("/"))}function h(a,b){function c(a){for(var b=0;b<a.length&&""===a[b];b++);for(var c=a.length-1;c>=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=e(a).substr(1),b=e(b).substr(1);for(var d=c(a.split("/")),f=c(b.split("/")),g=Math.min(d.length,f.length),h=g,i=0;i<g;i++)if(d[i]!==f[i]){h=i;break}for(var j=[],i=h;i<d.length;i++)j.push("..");return j=j.concat(f.slice(h)),j.join("/")}function i(a){var b=q(a),c=b[0],d=b[1];return c||d?(d&&(d=d.substr(0,d.length-1)),c+d):"."}function j(a,b){var c=q(a)[2];return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),""===c?"/":c}function k(a){return q(a)[3]}function l(a){return"/"===a.charAt(0)}function m(a){return-1!==(""+a).indexOf("\0")}function n(a){return a.replace(/\/*$/,"/")}function o(a){return a=a.replace(/\/*$/,""),""===a?"/":a}var p=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,q=function(a){var b=p.exec(a);return[b[1]||"",b[2]||"",b[3]||"",b[4]||""]};b.exports={normalize:f,resolve:e,join:g,relative:h,sep:"/",delimiter:":",dirname:i,basename:j,extname:k,isAbsolute:l,isNull:m,addTrailing:n,removeTrailing:o}},{}]},{},[1])(1)});