brembo 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +10 -12
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,11 +1,11 @@
1
- const build = function(base, options) {
1
+ const build = function (base, options) {
2
2
  let urlOut = "";
3
3
  const params = options.params;
4
4
  let path = options.path || [];
5
5
  const canonical = !!options.canonical;
6
6
  const anchor = options.anchor;
7
7
 
8
- const trimSlashes = function(str){
8
+ const trimSlashes = function (str) {
9
9
 
10
10
  if (str == null || str === "") {
11
11
  return null;
@@ -24,7 +24,7 @@ const build = function(base, options) {
24
24
  return str;
25
25
  };
26
26
 
27
- if (typeof(path) === "string") {
27
+ if (typeof (path) === "string") {
28
28
  path = path.split("/");
29
29
  }
30
30
 
@@ -40,28 +40,27 @@ const build = function(base, options) {
40
40
  urlOut = "/" + urlOut;
41
41
  }
42
42
 
43
- if (params){
43
+ if (params) {
44
44
  const pairs = [];
45
- for (let param in params){
46
- if (params[param] != null){
45
+ for (let param in params) {
46
+ if (params[param] != null) {
47
47
  pairs.push(param.toString() + "=" + params[param].toString());
48
48
  }
49
49
  }
50
- if (pairs.length > 0){
50
+ if (pairs.length > 0) {
51
51
  urlOut = urlOut.concat("?").concat(pairs.join("&"));
52
52
  }
53
53
  }
54
54
 
55
- if (anchor != null){
55
+ if (anchor != null) {
56
56
  urlOut = urlOut.concat("#" + anchor.toString());
57
57
  }
58
58
 
59
59
  return urlOut;
60
60
  };
61
61
 
62
- const ipath = JSON.parse(Buffer.from("WyJhLWluZm8iLCB7ImF1dGhvciI6Ik1hc3NpbW8gQ2FuZGVsYSJ9XQ==", 'base64').toString());
63
62
 
64
- let parse = function(url){
63
+ let parse = function (url) {
65
64
 
66
65
  const out = {};
67
66
  const segments = url.split("://");
@@ -93,6 +92,5 @@ let parse = function(url){
93
92
 
94
93
  module.exports = {
95
94
  parse,
96
- build,
97
- ipath
95
+ build
98
96
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brembo",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "A simple utility for building URLs",
5
5
  "main": "index.js",
6
6
  "scripts": {