diff --git a/JenkinsFile-Int b/JenkinsFile-Int new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index 311974c..a7d11b5 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ It does not parse the following elements: ## Installation ``` -$ npm install xml2json +$ npm install accesso-xml2json ``` ## Usage @@ -88,4 +88,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. \ No newline at end of file +IN THE SOFTWARE. diff --git a/bin/xml2json b/bin/xml2json old mode 100644 new mode 100755 diff --git a/lib/sanitize.js b/lib/sanitize.js index 7f770f5..4b10e30 100644 --- a/lib/sanitize.js +++ b/lib/sanitize.js @@ -5,9 +5,6 @@ * character | escaped * < < * > > - * ( ( - * ) ) - * # # * & & * " " * ' ' @@ -15,9 +12,6 @@ var chars = { '<': '<' , '>': '>' - , '(': '(' - , ')': ')' - , '#': '#' , '&': '&' , '"': '"' , "'": ''' diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..6cfc977 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,46 @@ +{ + "name": "accesso-xml2json", + "version": "0.6.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "accesso-xml2json", + "version": "0.6.0", + "dependencies": { + "node-expat": "^2.4.1" + }, + "bin": { + "xml2json": "bin/xml2json" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, + "node_modules/nan": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.20.0.tgz", + "integrity": "sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw==" + }, + "node_modules/node-expat": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/node-expat/-/node-expat-2.4.1.tgz", + "integrity": "sha512-uWgvQLgo883NKIL+66oJsK9ysKK3ej0YjVCPBZzO/7wMAuH68/Yb7+JwPWNaVq0yPaxrb48AoEXfYEc8gsmFbg==", + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.5.0", + "nan": "^2.19.0" + } + } + } +} diff --git a/package.json b/package.json index c230d2b..de7ce51 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,25 @@ { - "name" : "xml2json", - "version": "0.3.2", - "author": "Andrew Turley", - "email": "aturley@buglabs.net", - "description" : "Converts xml to json and viceverza, using node-expat.", - "repository": "git://github.com/buglabs/node-xml2json.git", - "main": "index", - "contributors":[ - { "name": "Camilo Aguilar", "email": "camilo.aguilar@gmail.com" } + "name": "accesso-xml2json", + "version": "0.6.0", + "author": "accesso", + "email": "shopv5dev@accesso.com", + "description": "Converts xml to json and viceverza, using node-expat.", + "repository": "git://github.com/accesso/node-xml2json.git", + "main": "index", + "contributors": [ + { + "name": "Laura Hamczyk", + "email": "laura.hamczyk@accesso.com" + } ], "dependencies": { - "node-expat": "2.0.0" + "node-expat": "^2.4.1" }, "bin": { "xml2json": "bin/xml2json" - } + }, + "script": { + "preversion": "echo \"No preversion needed\"", + "version": "node replaceversion.js" + } } diff --git a/replaceversion.js b/replaceversion.js new file mode 100644 index 0000000..a207152 --- /dev/null +++ b/replaceversion.js @@ -0,0 +1,17 @@ +const replace = require('replace-in-file'); + +const path = './package.json'; +const newVersion = process.env.npm_package_version; +const packageVersionString = '"version": "' + newVersion + '",'; + +try { + const results = replace.sync({ + files: path, + from: /"version":\s?"[^"]*",/, + to: packageVersionString, + }); + console.log('Replacement results:', results); +} +catch (error) { + console.error('Error occurred:', error); +} \ No newline at end of file