Commit e6592c8b authored by Patricio Bruna's avatar Patricio Bruna

Removed jquery and build for nodejs support

parent bc10301c
......@@ -3,7 +3,6 @@
.travis.yml
.editorconfig
test/
src/
bower.json
Makefile
server.js
......
This diff is collapsed.
This diff is collapsed.
{
"name": "zimbra-admin-api-js",
"version": "0.1.6",
"main": "lib/zimbra-admin-api.js",
"version": "0.2.0",
"main": "src/index.js",
"dependencies": {
"crypto-browserify": "^3.11.0",
"jquery": "^2.2.3",
"js-zimbra": "github:zboxapp/js-zimbra#super-agent",
"js-zimbra": "github:zboxapp/js-zimbra",
"merge": "^1.2.0",
"options-api": "^1.1.0",
"sprintf-js": "^1.0.3",
......
......@@ -28,7 +28,7 @@ export default class Dictionary {
// Takes an object an return an array
// {size: 20, age: 30} => [ {n: size, _content: 20}, {n: age, _content: 30}]
attributesToArray (attributes) {
if ($.isEmptyObject(attributes)) return [];
if (this.isEmptyObject(attributes)) return [];
const result = [];
const map = new Map(Object.entries(attributes));
map.forEach((key, value) => {
......@@ -105,6 +105,24 @@ export default class Dictionary {
return result;
}
isEmptyObject(obj) {
// null and undefined are "empty"
if (obj === null) return true;
// Assume if it has a length property with a non-zero value
// that that property is correct.
if (obj.length > 0) return false;
if (obj.length === 0) return true;
// Otherwise, does it have any properties of its own?
// Note that this doesn't handle
// toString and valueOf enumeration bugs in IE < 9
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) return false;
}
return true;
}
resourceResponseName (resource) {
return this.zimbra_resources[resource.toLowerCase()].response_name;
}
......
......@@ -745,17 +745,4 @@
});
});
describe('Timeout Error tests', function() {
this.timeout(5000);
it('should create and return an account', function(done){
let api = new ZimbraAdminApi(auth_data);
api.client.options.timeout = 100;
api.getAllAccounts(function(err, data){
expect(err).to.exist;
done();
});
});
});
})();
......@@ -48,11 +48,7 @@ var config = {
},
{
test: /(node_modules)\/.+\.(js|jsx)$/,
loader: 'imports',
query: {
$: 'jquery',
jQuery: 'jquery'
}
loader: 'imports'
}
]
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment