Skip to content

Commit

Permalink
refactor: remove all uninstall exports, as install call is not revers…
Browse files Browse the repository at this point in the history
…ible
  • Loading branch information
Harrison Ifeanyichukwu committed Aug 18, 2018
1 parent e7be910 commit 7d9f9cc
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 91 deletions.
2 changes: 1 addition & 1 deletion src/exports.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {install, uninstall} from './modules/Globals.js';
export {install} from './modules/Globals.js';
export {default as Util} from './modules/Util.js';
export {default as Queue} from './modules/Queue.js';
export {default as Event} from './modules/Event.js';
Expand Down
12 changes: 1 addition & 11 deletions src/modules/Event.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
*@module Event
*/
import { install, uninstall, host, root, onInstall, browserPrefixes } from './Globals.js';
import { install, host, root, onInstall, browserPrefixes } from './Globals.js';
import Util from './Util.js';
import Queue from './Queue.js';
import Driver from './Event/Drivers/Driver.js';
Expand Down Expand Up @@ -769,16 +769,6 @@ let eventModule = {
return install(hostParam, rootParam);
},

/**
* calls the Globals uninstall method with the parameters. This is useful when using the
* Utils module as a standalone distribution or lib.
*@memberof Event
*@returns {boolean}
*/
uninstall() {
return uninstall();
},

/**
* sets or retrieves the silence event status
*@memberof Event
Expand Down
12 changes: 1 addition & 11 deletions src/modules/Util.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* this module defines a bunch of utility functions that will be relevant to most other modules
*@module Util
*/
import {toString, host, root, install, uninstall} from './Globals.js';
import {toString, host, root, install} from './Globals.js';

export default {
/**
Expand All @@ -19,16 +19,6 @@ export default {
return install(hostParam, rootParam);
},

/**
* calls the Globals uninstall method with the parameters. This is useful when using the
* Utils module as a standalone distribution or lib.
*
*@returns {boolean}
*/
uninstall() {
return uninstall();
},

/**
* tests if a variable is a number
*@param {*} variable - variable to test
Expand Down
12 changes: 1 addition & 11 deletions src/modules/XML.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
*@module XML
*/
import { onInstall, host, root, install, uninstall} from './Globals.js';
import { onInstall, host, root, install} from './Globals.js';
import Util from './Util.js';
import Xhr from './Xhr.js';

Expand Down Expand Up @@ -333,16 +333,6 @@ export default class XML {
return install(hostParam, rootParam);
}

/**
* calls the Globals uninstall method with the parameters. This is useful when using the
* Utils module as a standalone distribution or lib.
*
*@returns {boolean}
*/
static uninstall() {
return uninstall();
}

/**
* xml document construct
*@param {string} [qualifiedName] - document root node qualified name
Expand Down
12 changes: 1 addition & 11 deletions src/modules/XPath.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
*@module XPath
*/
import { onInstall, host, install, uninstall } from './Globals.js';
import { onInstall, host, install } from './Globals.js';
import Util from './Util.js';
import XML from './XML.js';

Expand Down Expand Up @@ -177,16 +177,6 @@ export default {
return install(hostParam, rootParam);
},

/**
* calls the Globals uninstall method with the parameters. This is useful when using the
* Utils module as a standalone distribution or lib.
*
*@returns {boolean}
*/
uninstall() {
return uninstall();
},

/**
* indicates if xPath is supported
*@type {boolean}
Expand Down
12 changes: 1 addition & 11 deletions src/modules/Xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* request headers and lots more
*@module Xhr
*/
import {install, uninstall} from './Globals.js';
import {install} from './Globals.js';
import Util from './Util.js';
import Queue from './Queue.js';
import Transport from './XhrComponents/Transport.js';
Expand Down Expand Up @@ -176,16 +176,6 @@ export default {
return install(hostParam, rootParam);
},

/**
* calls the Globals uninstall method with the parameters. This is useful when using the
* Utils module as a standalone distribution or lib.
*
*@returns {boolean}
*/
uninstall() {
return uninstall();
},

/**
* sets default request timeout or retrieves the default timeout value. Default is 15000 ms
*@param {number} [ms] - time in milliseconds after which to timeout request
Expand Down
7 changes: 0 additions & 7 deletions test/modules/Event.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ describe('Event module', function() {
});
});

describe('.uninstall()', function() {
it('should call the global uninstall method', function() {
expect(_Event.uninstall()).to.be.true;
expect(_Event.install(window, document)).to.be.true;
});
});

describe('.silenceEvents', function() {
it (`should set or return the silence event current status when called as a setter
or a getter. The silenceEvents status determines if the module will stop the browser
Expand Down
7 changes: 0 additions & 7 deletions test/modules/Util.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ describe('Util module', function() {
});
});

describe('.uninstall()', function() {
it('should call the global uninstall method', function() {
expect(Util.uninstall()).to.be.true;
expect(Util.install(window, document)).to.be.true;
});
});

describe('.isNumber(variable)', function() {
it('should return true if argument is a number', function() {
expect(Util.isNumber(3.2)).to.be.true;
Expand Down
7 changes: 0 additions & 7 deletions test/modules/XML.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ describe('XML module', function() {
});
});

describe('.uninstall()', function() {
it('should call the global uninstall method', function() {
expect(XML.uninstall()).to.be.true;
expect(XML.install(window, document)).to.be.true;
});
});

describe('.supported', function() {
it('it should hold a boolean value that indicates if XML creation is supported', function() {
expect(XML.supported).to.be.true;
Expand Down
7 changes: 0 additions & 7 deletions test/modules/XPath.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ describe('XPath module', function() {
});
});

describe('.uninstall()', function() {
it('should call the global uninstall method', function() {
expect(XPath.uninstall()).to.be.true;
expect(XPath.install(window, document)).to.be.true;
});
});

describe('.supported', function() {
it('it should hold a boolean value that indicates if XPath is supported', function() {
expect(XPath.supported).to.be.true;
Expand Down
7 changes: 0 additions & 7 deletions test/modules/Xhr.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ describe('Xhr', function() {
});
});

describe('.uninstall()', function() {
it('should call the global uninstall method', function() {
expect(Xhr.uninstall()).to.be.true;
expect(Xhr.install(window, document)).to.be.true;
});
});

describe('.fetch(url, options?)', function() {

it('should send request to the resource at the given url and return a promise', function() {
Expand Down

0 comments on commit 7d9f9cc

Please sign in to comment.