Skip to content

Commit c161593

Browse files
committed
updated build after changes
1 parent ff174b5 commit c161593

File tree

4 files changed

+16
-30
lines changed

4 files changed

+16
-30
lines changed

dist/cep-promise-browser.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
(function (global, factory) {
2-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('os')) :
3-
typeof define === 'function' && define.amd ? define(['os'], factory) :
4-
(global.cep = factory(global.os));
5-
}(this, (function (os) { 'use strict';
2+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3+
typeof define === 'function' && define.amd ? define(factory) :
4+
(global.cep = factory());
5+
}(this, (function () { 'use strict';
66

77
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
88
return typeof obj;
@@ -358,27 +358,20 @@ function throwApplicationError$2(error) {
358358
throw serviceError;
359359
}
360360

361+
/* istanbul ignore next */
361362
function isBrowser() {
362363
return typeof window !== 'undefined';
363364
}
364365

365-
function isHttps() {
366-
return typeof location !== 'undefined' && location.protocol === 'https:';
367-
}
368-
369-
function shouldUseProxy() {
370-
return isBrowser() && !isHttps();
371-
}
372-
373366
/* istanbul ignore next */
374367
function injectProxy(Service) {
375368
return function (cepWithLeftPad) {
376369
return Service(cepWithLeftPad, PROXY_URL);
377370
};
378371
}
379372

380-
var CepAbertoService = shouldUseProxy() ? injectProxy(fetchCepAbertoService) : fetchCepAbertoService;
381-
var CorreiosService = shouldUseProxy() ? injectProxy(fetchCorreiosService) : fetchCorreiosService;
373+
var CepAbertoService = isBrowser() ? injectProxy(fetchCepAbertoService) : fetchCepAbertoService;
374+
var CorreiosService = isBrowser() ? injectProxy(fetchCorreiosService) : fetchCorreiosService;
382375
var ViaCepService = fetchViaCepService;
383376

384377
var reverse = function reverse(promise) {

dist/cep-promise-browser.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cep-promise.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
(function (global, factory) {
2-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('isomorphic-unfetch'), require('os')) :
3-
typeof define === 'function' && define.amd ? define(['isomorphic-unfetch', 'os'], factory) :
4-
(global.cep = factory(global.fetch,global.os));
5-
}(this, (function (fetch,os) { 'use strict';
2+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('isomorphic-unfetch')) :
3+
typeof define === 'function' && define.amd ? define(['isomorphic-unfetch'], factory) :
4+
(global.cep = factory(global.fetch));
5+
}(this, (function (fetch) { 'use strict';
66

77
fetch = fetch && fetch.hasOwnProperty('default') ? fetch['default'] : fetch;
88

@@ -283,27 +283,20 @@ function throwApplicationError$2(error) {
283283
throw serviceError;
284284
}
285285

286+
/* istanbul ignore next */
286287
function isBrowser() {
287288
return typeof window !== 'undefined';
288289
}
289290

290-
function isHttps() {
291-
return typeof location !== 'undefined' && location.protocol === 'https:';
292-
}
293-
294-
function shouldUseProxy() {
295-
return isBrowser() && !isHttps();
296-
}
297-
298291
/* istanbul ignore next */
299292
function injectProxy(Service) {
300293
return function (cepWithLeftPad) {
301294
return Service(cepWithLeftPad, PROXY_URL);
302295
};
303296
}
304297

305-
var CepAbertoService = shouldUseProxy() ? injectProxy(fetchCepAbertoService) : fetchCepAbertoService;
306-
var CorreiosService = shouldUseProxy() ? injectProxy(fetchCorreiosService) : fetchCorreiosService;
298+
var CepAbertoService = isBrowser() ? injectProxy(fetchCepAbertoService) : fetchCepAbertoService;
299+
var CorreiosService = isBrowser() ? injectProxy(fetchCorreiosService) : fetchCorreiosService;
307300
var ViaCepService = fetchViaCepService;
308301

309302
var reverse = function reverse(promise) {

0 commit comments

Comments
 (0)