From dcdfc94cb39dfe2c39925a0145ffa45e2d061c30 Mon Sep 17 00:00:00 2001 From: Kumar Priyansh Date: Sat, 19 Jan 2019 12:37:14 +0530 Subject: Initial Upload via GIT --- cordova/node_modules/xml-escape/.npmignore | 15 ++++++++ cordova/node_modules/xml-escape/LICENSE | 20 ++++++++++ cordova/node_modules/xml-escape/README.md | 38 +++++++++++++++++++ cordova/node_modules/xml-escape/index.js | 22 +++++++++++ cordova/node_modules/xml-escape/package.json | 57 ++++++++++++++++++++++++++++ cordova/node_modules/xml-escape/test.js | 29 ++++++++++++++ 6 files changed, 181 insertions(+) create mode 100755 cordova/node_modules/xml-escape/.npmignore create mode 100755 cordova/node_modules/xml-escape/LICENSE create mode 100755 cordova/node_modules/xml-escape/README.md create mode 100755 cordova/node_modules/xml-escape/index.js create mode 100755 cordova/node_modules/xml-escape/package.json create mode 100755 cordova/node_modules/xml-escape/test.js (limited to 'cordova/node_modules/xml-escape') diff --git a/cordova/node_modules/xml-escape/.npmignore b/cordova/node_modules/xml-escape/.npmignore new file mode 100755 index 0000000..a72b52e --- /dev/null +++ b/cordova/node_modules/xml-escape/.npmignore @@ -0,0 +1,15 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log +node_modules diff --git a/cordova/node_modules/xml-escape/LICENSE b/cordova/node_modules/xml-escape/LICENSE new file mode 100755 index 0000000..bd261ef --- /dev/null +++ b/cordova/node_modules/xml-escape/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Michael Hernandez + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 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. diff --git a/cordova/node_modules/xml-escape/README.md b/cordova/node_modules/xml-escape/README.md new file mode 100755 index 0000000..5faf9f9 --- /dev/null +++ b/cordova/node_modules/xml-escape/README.md @@ -0,0 +1,38 @@ +xml-escape +========== + +Escape XML in javascript (NodeJS) + +npm install xml-escape + +```javascript +// Warning escape is a reserved word, so maybe best to use xmlescape for var name +var xmlescape = require('xml-escape'); + +xmlescape('"hello" \'world\' & false < true > -1'); + +// output +// '"hello" 'world' & false < true > -1' + +// don't escape some characters +xmlescape('"hello" \'world\' & false < true > -1', '>"&') + +// output +// '"hello" 'world' & false < true > -1' +``` + + +There is also now an ignore function thanks to @jayflo + +```javascript +esc = require('./'); + +ignore = '"<&' +// note you should never ignore an & +output = esc('I am "<¬>" escaped', ignore) +console.log(output) + +//I am "<¬>" escaped +``` + +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/miketheprogrammer/xml-escape/trend.png)](https://bitdeli.com/free "Bitdeli Badge") diff --git a/cordova/node_modules/xml-escape/index.js b/cordova/node_modules/xml-escape/index.js new file mode 100755 index 0000000..8c37325 --- /dev/null +++ b/cordova/node_modules/xml-escape/index.js @@ -0,0 +1,22 @@ + + +var escape = module.exports = function escape(string, ignore) { + var pattern; + + if (string === null || string === undefined) return; + + ignore = (ignore || '').replace(/[^&"<>\']/g, ''); + pattern = '([&"<>\'])'.replace(new RegExp('[' + ignore + ']', 'g'), ''); + + return string.replace(new RegExp(pattern, 'g'), function(str, item) { + return escape.map[item]; + }) +} + +var map = escape.map = { + '>': '>' + , '<': '<' + , "'": ''' + , '"': '"' + , '&': '&' +} \ No newline at end of file diff --git a/cordova/node_modules/xml-escape/package.json b/cordova/node_modules/xml-escape/package.json new file mode 100755 index 0000000..22fe803 --- /dev/null +++ b/cordova/node_modules/xml-escape/package.json @@ -0,0 +1,57 @@ +{ + "_from": "xml-escape@1.1.0", + "_id": "xml-escape@1.1.0", + "_inBundle": true, + "_integrity": "sha1-OQTBQ/qOs6ADDsZG0pAqLxtwbEQ=", + "_location": "/cordova-ios/xml-escape", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "xml-escape@1.1.0", + "name": "xml-escape", + "escapedName": "xml-escape", + "rawSpec": "1.1.0", + "saveSpec": null, + "fetchSpec": "1.1.0" + }, + "_requiredBy": [ + "/cordova-ios" + ], + "_resolved": "https://registry.npmjs.org/xml-escape/-/xml-escape-1.1.0.tgz", + "_shasum": "3904c143fa8eb3a0030ec646d2902a2f1b706c44", + "_spec": "xml-escape@1.1.0", + "_where": "/Users/brodybits/Documents/cordova/cordova-ios", + "author": { + "name": "Michael Hernandez - michael.hernandez1988@gmail.com" + }, + "bugs": { + "url": "https://github.com/miketheprogrammer/xml-escape/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Escape XML ", + "devDependencies": { + "tape": "~2.4.2" + }, + "homepage": "https://github.com/miketheprogrammer/xml-escape", + "keywords": [ + "Escape", + "XML", + "Unesacpe", + "encoding", + "xml-escape" + ], + "license": "MIT License", + "main": "index.js", + "name": "xml-escape", + "repository": { + "type": "git", + "url": "git://github.com/miketheprogrammer/xml-escape.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.1.0" +} diff --git a/cordova/node_modules/xml-escape/test.js b/cordova/node_modules/xml-escape/test.js new file mode 100755 index 0000000..21ad218 --- /dev/null +++ b/cordova/node_modules/xml-escape/test.js @@ -0,0 +1,29 @@ +var test = require('tape'); +var escape = require('./index'); +test("Characters should be escaped properly", function (t) { + t.plan(1); + + t.equals(escape('" \' < > &'), '" ' < > &'); +}) + +test("Module should respect ignore string", function (t) { + t.plan(3); + + t.equals(escape('" \' < > &', '"'), '" ' < > &'); + t.equals(escape('" \' < > &', '>&'), '" ' < > &'); + t.equals(escape('" \' < > &', '"\'<>&'), '" \' < > &'); +}) + +test("Module should not escape random characters", function (t) { + t.plan(1); + + t.equals(escape('<[whats up]>', '<]what'), '<[whats up]>'); +}) + +test("Module should not crash on null or undefined input", function (t) { + t.plan(3); + + t.equals((escape("")), ""); + t.doesNotThrow(function(){escape(null);}, TypeError); + t.doesNotThrow(function(){escape(undefined);}, TypeError); +}) -- cgit v1.2.3