aboutsummaryrefslogtreecommitdiff
path: root/cordova/node_modules/xml-escape
diff options
context:
space:
mode:
authorKumar Priyansh <[email protected]>2019-01-19 12:37:14 +0530
committerKumar Priyansh <[email protected]>2019-01-19 12:37:14 +0530
commitdcdfc94cb39dfe2c39925a0145ffa45e2d061c30 (patch)
tree4f6379d955555b298c0e7b83a67e264240ee5614 /cordova/node_modules/xml-escape
parent76f7b3678d3f1ff99c3935a774d420453b0c3cb9 (diff)
downloadWeatherApp-dcdfc94cb39dfe2c39925a0145ffa45e2d061c30.tar.xz
WeatherApp-dcdfc94cb39dfe2c39925a0145ffa45e2d061c30.zip
Initial Upload via GIT
Diffstat (limited to 'cordova/node_modules/xml-escape')
-rwxr-xr-xcordova/node_modules/xml-escape/.npmignore15
-rwxr-xr-xcordova/node_modules/xml-escape/LICENSE20
-rwxr-xr-xcordova/node_modules/xml-escape/README.md38
-rwxr-xr-xcordova/node_modules/xml-escape/index.js22
-rwxr-xr-xcordova/node_modules/xml-escape/package.json57
-rwxr-xr-xcordova/node_modules/xml-escape/test.js29
6 files changed, 181 insertions, 0 deletions
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
+// '&quot;hello&quot; &apos;world&apos; &amp; false &lt; true &gt; -1'
+
+// don't escape some characters
+xmlescape('"hello" \'world\' & false < true > -1', '>"&')
+
+// output
+// '"hello" &apos;world&apos; & false &lt; 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 "<&not>" escaped', ignore)
+console.log(output)
+
+//I am "<&not&gt;" 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 = {
+ '>': '&gt;'
+ , '<': '&lt;'
+ , "'": '&apos;'
+ , '"': '&quot;'
+ , '&': '&amp;'
+} \ 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": "[email protected]",
+ "_id": "[email protected]",
+ "_inBundle": true,
+ "_integrity": "sha1-OQTBQ/qOs6ADDsZG0pAqLxtwbEQ=",
+ "_location": "/cordova-ios/xml-escape",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "[email protected]",
+ "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": "[email protected]",
+ "_where": "/Users/brodybits/Documents/cordova/cordova-ios",
+ "author": {
+ "name": "Michael Hernandez - [email protected]"
+ },
+ "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('" \' < > &'), '&quot; &apos; &lt; &gt; &amp;');
+})
+
+test("Module should respect ignore string", function (t) {
+ t.plan(3);
+
+ t.equals(escape('" \' < > &', '"'), '" &apos; &lt; &gt; &amp;');
+ t.equals(escape('" \' < > &', '>&'), '&quot; &apos; &lt; > &');
+ t.equals(escape('" \' < > &', '"\'<>&'), '" \' < > &');
+})
+
+test("Module should not escape random characters", function (t) {
+ t.plan(1);
+
+ t.equals(escape('<[whats up]>', '<]what'), '<[whats up]&gt;');
+})
+
+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);
+})