@coscine/api-connection
Advanced tools
Comparing version 1.17.0 to 1.17.1
@@ -713,2 +713,16 @@ var axios = require('axios'); | ||
} | ||
function preparePath(path) { | ||
var resultString = ''; | ||
if (path.charAt(0) === '/') { | ||
path = path.substring(1); | ||
} | ||
var array = path.split('/'); | ||
for (var i = 0; i < array.length; i++) { | ||
resultString += encodeURIComponent(array[i]); | ||
if (i !== array.length - 1) { | ||
resultString += '/'; | ||
} | ||
} | ||
return resultString; | ||
} | ||
var TreeApi = /** @class */ (function () { | ||
@@ -722,3 +736,3 @@ function TreeApi() { | ||
return axios$h | ||
.get(getTreeApiUrl() + resourceId + '/' + encodeURIComponent(path)) | ||
.get(getTreeApiUrl() + resourceId + '/' + preparePath(path)) | ||
.then(thenHandler) | ||
@@ -742,3 +756,3 @@ .catch(catchHandler); | ||
return axios$h | ||
.put(getTreeApiUrl() + resourceId + '/' + encodeURIComponent(path), body) | ||
.put(getTreeApiUrl() + resourceId + '/' + preparePath(path), body) | ||
.then(thenHandler) | ||
@@ -745,0 +759,0 @@ .catch(catchHandler); |
@@ -719,2 +719,16 @@ (function (global, factory) { | ||
} | ||
function preparePath(path) { | ||
var resultString = ''; | ||
if (path.charAt(0) === '/') { | ||
path = path.substring(1); | ||
} | ||
var array = path.split('/'); | ||
for (var i = 0; i < array.length; i++) { | ||
resultString += encodeURIComponent(array[i]); | ||
if (i !== array.length - 1) { | ||
resultString += '/'; | ||
} | ||
} | ||
return resultString; | ||
} | ||
var TreeApi = /** @class */ (function () { | ||
@@ -728,3 +742,3 @@ function TreeApi() { | ||
return axios$h | ||
.get(getTreeApiUrl() + resourceId + '/' + encodeURIComponent(path)) | ||
.get(getTreeApiUrl() + resourceId + '/' + preparePath(path)) | ||
.then(thenHandler) | ||
@@ -748,3 +762,3 @@ .catch(catchHandler); | ||
return axios$h | ||
.put(getTreeApiUrl() + resourceId + '/' + encodeURIComponent(path), body) | ||
.put(getTreeApiUrl() + resourceId + '/' + preparePath(path), body) | ||
.then(thenHandler) | ||
@@ -751,0 +765,0 @@ .catch(catchHandler); |
@@ -9,2 +9,16 @@ "use strict"; | ||
} | ||
function preparePath(path) { | ||
var resultString = ''; | ||
if (path.charAt(0) === '/') { | ||
path = path.substring(1); | ||
} | ||
var array = path.split('/'); | ||
for (var i = 0; i < array.length; i++) { | ||
resultString += encodeURIComponent(array[i]); | ||
if (i !== array.length - 1) { | ||
resultString += '/'; | ||
} | ||
} | ||
return resultString; | ||
} | ||
var TreeApi = /** @class */ (function () { | ||
@@ -18,3 +32,3 @@ function TreeApi() { | ||
return axios | ||
.get(getTreeApiUrl() + resourceId + '/' + encodeURIComponent(path)) | ||
.get(getTreeApiUrl() + resourceId + '/' + preparePath(path)) | ||
.then(thenHandler) | ||
@@ -38,3 +52,3 @@ .catch(catchHandler); | ||
return axios | ||
.put(getTreeApiUrl() + resourceId + '/' + encodeURIComponent(path), body) | ||
.put(getTreeApiUrl() + resourceId + '/' + preparePath(path), body) | ||
.then(thenHandler) | ||
@@ -41,0 +55,0 @@ .catch(catchHandler); |
{ | ||
"name": "@coscine/api-connection", | ||
"version": "1.17.0", | ||
"version": "1.17.1", | ||
"description": "This library provides methods to connect to CoScInE Apis with JavaScript.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
343960
2708