Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
.idea/
4 changes: 1 addition & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ module.exports = function(grunt) {

uglify: {
prod: {
options: {
mangle: true, compress: true,
},
options: {mangle: true, compress: true},
src: 'dist/binarypack.js',
dest: 'dist/binarypack.min.js'
}
Expand Down
6 changes: 3 additions & 3 deletions dist/binarypack.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! binarypack.js build:0.0.9, production. Copyright(c) 2012 Eric Zhang <eric@ericzhang.com> MIT Licensed */(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){
/*! binarypack.js build:0.0.9, production. Copyright(c) 2012 Eric Zhang <eric@ericzhang.com> MIT Licensed */(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){
var BufferBuilder = require('./bufferbuilder').BufferBuilder;
var binaryFeatures = require('./bufferbuilder').binaryFeatures;

Expand Down Expand Up @@ -287,7 +287,7 @@ Packer.prototype.pack = function(value){
var constructor = value.constructor;
if (constructor == Array){
this.pack_array(value);
} else if (constructor == Blob || constructor == File) {
} else if (constructor == Blob || constructor == File || value instanceof Blob || value instanceof File) {
this.pack_bin(value);
} else if (constructor == ArrayBuffer) {
if(binaryFeatures.useArrayBufferView) {
Expand All @@ -301,7 +301,7 @@ Packer.prototype.pack = function(value){
} else {
this.pack_bin(value.buffer);
}
} else if (constructor == Object){
} else if (constructor == Object || (constructor.toString().startsWith('class'))){
this.pack_object(value);
} else if (constructor == Date){
this.pack_string(value.toString());
Expand Down
2 changes: 1 addition & 1 deletion dist/binarypack.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/binarypack.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ Packer.prototype.pack = function(value){
var constructor = value.constructor;
if (constructor == Array){
this.pack_array(value);
} else if (constructor == Blob || constructor == File) {
} else if (constructor == Blob || constructor == File || value instanceof Blob || value instanceof File) {
this.pack_bin(value);
} else if (constructor == ArrayBuffer) {
if(binaryFeatures.useArrayBufferView) {
Expand All @@ -300,7 +300,7 @@ Packer.prototype.pack = function(value){
} else {
this.pack_bin(value.buffer);
}
} else if (constructor == Object){
} else if (constructor == Object || (constructor.toString().startsWith('class'))){
this.pack_object(value);
} else if (constructor == Date){
this.pack_string(value.toString());
Expand Down
3,030 changes: 3,030 additions & 0 deletions npm-debug.log

Large diffs are not rendered by default.

Loading