http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/examples/browser/index.html ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/examples/browser/index.html b/bin/node_modules/plist/examples/browser/index.html new file mode 100644 index 0000000..8ce7d92 --- /dev/null +++ b/bin/node_modules/plist/examples/browser/index.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html> + <head> + <title>plist.js browser example</title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + </head> + <body> + <script src="../../dist/plist.js"></script> + <script> + // TODO: add <input type=file> drag and drop example + console.log(plist); + </script> + </body> +</html>
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/lib/build.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/lib/build.js b/bin/node_modules/plist/lib/build.js new file mode 100644 index 0000000..9437ed6 --- /dev/null +++ b/bin/node_modules/plist/lib/build.js @@ -0,0 +1,136 @@ + +/** + * Module dependencies. + */ + +var base64 = require('base64-js'); +var xmlbuilder = require('xmlbuilder'); + +/** + * Module exports. + */ + +exports.build = build; + +/** + * Accepts a `Date` instance and returns an ISO date string. + * + * @param {Date} d - Date instance to serialize + * @returns {String} ISO date string representation of `d` + * @api private + */ + +function ISODateString(d){ + function pad(n){ + return n < 10 ? '0' + n : n; + } + return d.getUTCFullYear()+'-' + + pad(d.getUTCMonth()+1)+'-' + + pad(d.getUTCDate())+'T' + + pad(d.getUTCHours())+':' + + pad(d.getUTCMinutes())+':' + + pad(d.getUTCSeconds())+'Z'; +} + +/** + * Returns the internal "type" of `obj` via the + * `Object.prototype.toString()` trick. + * + * @param {Mixed} obj - any value + * @returns {String} the internal "type" name + * @api private + */ + +var toString = Object.prototype.toString; +function type (obj) { + var m = toString.call(obj).match(/\[object (.*)\]/); + return m ? m[1] : m; +} + +/** + * Generate an XML plist string from the input object `obj`. + * + * @param {Object} obj - the object to convert + * @param {Object} [opts] - optional options object + * @returns {String} converted plist XML string + * @api public + */ + +function build (obj, opts) { + var XMLHDR = { + version: '1.0', + encoding: 'UTF-8' + }; + + var XMLDTD = { + pubid: '-//Apple//DTD PLIST 1.0//EN', + sysid: 'http://www.apple.com/DTDs/PropertyList-1.0.dtd' + }; + + var doc = xmlbuilder.create('plist'); + + doc.dec(XMLHDR.version, XMLHDR.encoding, XMLHDR.standalone); + doc.dtd(XMLDTD.pubid, XMLDTD.sysid); + doc.att('version', '1.0'); + + walk_obj(obj, doc); + + if (!opts) opts = {}; + // default `pretty` to `true` + opts.pretty = opts.pretty !== false; + return doc.end(opts); +} + +/** + * depth first, recursive traversal of a javascript object. when complete, + * next_child contains a reference to the build XML object. + * + * @api private + */ + +function walk_obj(next, next_child) { + var tag_type, i, prop; + var name = type(next); + + if (Array.isArray(next)) { + next_child = next_child.ele('array'); + for (i = 0; i < next.length; i++) { + walk_obj(next[i], next_child); + } + + } else if (Buffer.isBuffer(next)) { + next_child.ele('data').raw(next.toString('base64')); + + } else if ('Object' == name) { + next_child = next_child.ele('dict'); + for (prop in next) { + if (next.hasOwnProperty(prop)) { + next_child.ele('key').txt(prop); + walk_obj(next[prop], next_child); + } + } + + } else if ('Number' == name) { + // detect if this is an integer or real + // TODO: add an ability to force one way or another via a "cast" + tag_type = (next % 1 === 0) ? 'integer' : 'real'; + next_child.ele(tag_type).txt(next.toString()); + + } else if ('Date' == name) { + next_child.ele('date').txt(ISODateString(new Date(next))); + + } else if ('Boolean' == name) { + next_child.ele(next ? 'true' : 'false'); + + } else if ('String' == name) { + next_child.ele('string').txt(next); + + } else if ('ArrayBuffer' == name) { + next_child.ele('data').raw(base64.fromByteArray(next)); + + } else if (next.buffer && 'ArrayBuffer' == type(next.buffer)) { + // a typed array + next_child.ele('data').raw(base64.fromByteArray(new Uint8Array(next.buffer), next_child)); + + } +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/lib/node.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/lib/node.js b/bin/node_modules/plist/lib/node.js new file mode 100644 index 0000000..ac18e32 --- /dev/null +++ b/bin/node_modules/plist/lib/node.js @@ -0,0 +1,49 @@ +/** + * Module dependencies. + */ + +var fs = require('fs'); +var parse = require('./parse'); +var deprecate = require('util-deprecate'); + +/** + * Module exports. + */ + +exports.parseFile = deprecate(parseFile, '`parseFile()` is deprecated. ' + + 'Use `parseString()` instead.'); +exports.parseFileSync = deprecate(parseFileSync, '`parseFileSync()` is deprecated. ' + + 'Use `parseStringSync()` instead.'); + +/** + * Parses file `filename` as a .plist file. + * Invokes `fn` callback function when done. + * + * @param {String} filename - name of the file to read + * @param {Function} fn - callback function + * @api public + * @deprecated use parseString() instead + */ + +function parseFile (filename, fn) { + fs.readFile(filename, { encoding: 'utf8' }, onread); + function onread (err, inxml) { + if (err) return fn(err); + parse.parseString(inxml, fn); + } +} + +/** + * Parses file `filename` as a .plist file. + * Returns a when done. + * + * @param {String} filename - name of the file to read + * @param {Function} fn - callback function + * @api public + * @deprecated use parseStringSync() instead + */ + +function parseFileSync (filename) { + var inxml = fs.readFileSync(filename, 'utf8'); + return parse.parseStringSync(inxml); +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/lib/parse.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/lib/parse.js b/bin/node_modules/plist/lib/parse.js new file mode 100644 index 0000000..c154384 --- /dev/null +++ b/bin/node_modules/plist/lib/parse.js @@ -0,0 +1,200 @@ + +/** + * Module dependencies. + */ + +var deprecate = require('util-deprecate'); +var DOMParser = require('xmldom').DOMParser; + +/** + * Module exports. + */ + +exports.parse = parse; +exports.parseString = deprecate(parseString, '`parseString()` is deprecated. ' + + 'It\'s not actually async. Use `parse()` instead.'); +exports.parseStringSync = deprecate(parseStringSync, '`parseStringSync()` is ' + + 'deprecated. Use `parse()` instead.'); + +/** + * We ignore raw text (usually whitespace), <!-- xml comments -->, + * and raw CDATA nodes. + * + * @param {Element} node + * @returns {Boolean} + * @api private + */ + +function shouldIgnoreNode (node) { + return node.nodeType === 3 // text + || node.nodeType === 8 // comment + || node.nodeType === 4; // cdata +} + + +/** + * Parses a Plist XML string. Returns an Object. + * + * @param {String} xml - the XML String to decode + * @returns {Mixed} the decoded value from the Plist XML + * @api public + */ + +function parse (xml) { + var doc = new DOMParser().parseFromString(xml); + if (doc.documentElement.nodeName !== 'plist') { + throw new Error('malformed document. First element should be <plist>'); + } + var plist = parsePlistXML(doc.documentElement); + + // the root <plist> node gets interpreted as an Array, + // so pull out the inner data first + if (plist.length == 1) plist = plist[0]; + + return plist; +} + +/** + * Parses a Plist XML string. Returns an Object. Takes a `callback` function. + * + * @param {String} xml - the XML String to decode + * @param {Function} callback - callback function + * @returns {Mixed} the decoded value from the Plist XML + * @api public + * @deprecated not actually async. use parse() instead + */ + +function parseString (xml, callback) { + var doc, error, plist; + try { + doc = new DOMParser().parseFromString(xml); + plist = parsePlistXML(doc.documentElement); + } catch(e) { + error = e; + } + callback(error, plist); +} + +/** + * Parses a Plist XML string. Returns an Object. + * + * @param {String} xml - the XML String to decode + * @param {Function} callback - callback function + * @returns {Mixed} the decoded value from the Plist XML + * @api public + * @deprecated use parse() instead + */ + +function parseStringSync (xml) { + var doc = new DOMParser().parseFromString(xml); + var plist; + if (doc.documentElement.nodeName !== 'plist') { + throw new Error('malformed document. First element should be <plist>'); + } + plist = parsePlistXML(doc.documentElement); + + // if the plist is an array with 1 element, pull it out of the array + if (plist.length == 1) { + plist = plist[0]; + } + return plist; +} + +/** + * Convert an XML based plist document into a JSON representation. + * + * @param {Object} xml_node - current XML node in the plist + * @returns {Mixed} built up JSON object + * @api private + */ + +function parsePlistXML (node) { + var i, new_obj, key, val, new_arr, res, d; + + if (!node) + return null; + + if (node.nodeName === 'plist') { + new_arr = []; + for (i=0; i < node.childNodes.length; i++) { + // ignore comment nodes (text) + if (!shouldIgnoreNode(node.childNodes[i])) { + new_arr.push( parsePlistXML(node.childNodes[i])); + } + } + return new_arr; + + } else if (node.nodeName === 'dict') { + new_obj = {}; + key = null; + for (i=0; i < node.childNodes.length; i++) { + // ignore comment nodes (text) + if (!shouldIgnoreNode(node.childNodes[i])) { + if (key === null) { + key = parsePlistXML(node.childNodes[i]); + } else { + new_obj[key] = parsePlistXML(node.childNodes[i]); + key = null; + } + } + } + return new_obj; + + } else if (node.nodeName === 'array') { + new_arr = []; + for (i=0; i < node.childNodes.length; i++) { + // ignore comment nodes (text) + if (!shouldIgnoreNode(node.childNodes[i])) { + res = parsePlistXML(node.childNodes[i]); + if (null != res) new_arr.push(res); + } + } + return new_arr; + + } else if (node.nodeName === '#text') { + // TODO: what should we do with text types? (CDATA sections) + + } else if (node.nodeName === 'key') { + return node.childNodes[0].nodeValue; + + } else if (node.nodeName === 'string') { + res = ''; + for (d=0; d < node.childNodes.length; d++) { + res += node.childNodes[d].nodeValue; + } + return res; + + } else if (node.nodeName === 'integer') { + // parse as base 10 integer + return parseInt(node.childNodes[0].nodeValue, 10); + + } else if (node.nodeName === 'real') { + res = ''; + for (d=0; d < node.childNodes.length; d++) { + if (node.childNodes[d].nodeType === 3) { + res += node.childNodes[d].nodeValue; + } + } + return parseFloat(res); + + } else if (node.nodeName === 'data') { + res = ''; + for (d=0; d < node.childNodes.length; d++) { + if (node.childNodes[d].nodeType === 3) { + res += node.childNodes[d].nodeValue.replace(/\s+/g, ''); + } + } + + // decode base64 data to a Buffer instance + return new Buffer(res, 'base64'); + + } else if (node.nodeName === 'date') { + return new Date(node.childNodes[0].nodeValue); + + } else if (node.nodeName === 'true') { + return true; + + } else if (node.nodeName === 'false') { + return false; + } +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/lib/plist.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/lib/plist.js b/bin/node_modules/plist/lib/plist.js new file mode 100644 index 0000000..00a4167 --- /dev/null +++ b/bin/node_modules/plist/lib/plist.js @@ -0,0 +1,23 @@ + +var i; + +/** + * Parser functions. + */ + +var parserFunctions = require('./parse'); +for (i in parserFunctions) exports[i] = parserFunctions[i]; + +/** + * Builder functions. + */ + +var builderFunctions = require('./build'); +for (i in builderFunctions) exports[i] = builderFunctions[i]; + +/** + * Add Node.js-specific functions (they're deprecatedâ¦). + */ + +var nodeFunctions = require('./node'); +for (i in nodeFunctions) exports[i] = nodeFunctions[i]; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/base64-js/.travis.yml ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/base64-js/.travis.yml b/bin/node_modules/plist/node_modules/base64-js/.travis.yml new file mode 100644 index 0000000..939cb51 --- /dev/null +++ b/bin/node_modules/plist/node_modules/base64-js/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.11" \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/base64-js/LICENSE.MIT ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/base64-js/LICENSE.MIT b/bin/node_modules/plist/node_modules/base64-js/LICENSE.MIT new file mode 100644 index 0000000..96d3f68 --- /dev/null +++ b/bin/node_modules/plist/node_modules/base64-js/LICENSE.MIT @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 + +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. http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/base64-js/README.md ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/base64-js/README.md b/bin/node_modules/plist/node_modules/base64-js/README.md new file mode 100644 index 0000000..ed31d1a --- /dev/null +++ b/bin/node_modules/plist/node_modules/base64-js/README.md @@ -0,0 +1,31 @@ +base64-js +========= + +`base64-js` does basic base64 encoding/decoding in pure JS. + +[](http://travis-ci.org/beatgammit/base64-js) + +[](https://ci.testling.com/beatgammit/base64-js) + +Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data. + +Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does. + +## install + +With [npm](https://npmjs.org) do: + +`npm install base64-js` + +## methods + +`var base64 = require('base64-js')` + +`base64` has two exposed functions, `toByteArray` and `fromByteArray`, which both take a single argument. + +* `toByteArray` - Takes a base64 string and returns a byte array +* `fromByteArray` - Takes a byte array and returns a base64 string + +## license + +MIT \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/base64-js/bench/bench.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/base64-js/bench/bench.js b/bin/node_modules/plist/node_modules/base64-js/bench/bench.js new file mode 100644 index 0000000..0689e08 --- /dev/null +++ b/bin/node_modules/plist/node_modules/base64-js/bench/bench.js @@ -0,0 +1,19 @@ +var random = require('crypto').pseudoRandomBytes + +var b64 = require('../') +var fs = require('fs') +var path = require('path') +var data = random(1e6).toString('base64') +//fs.readFileSync(path.join(__dirname, 'example.b64'), 'ascii').split('\n').join('') +var start = Date.now() +var raw = b64.toByteArray(data) +var middle = Date.now() +var data = b64.fromByteArray(raw) +var end = Date.now() + +console.log('decode ms, decode ops/ms, encode ms, encode ops/ms') +console.log( + middle - start, data.length / (middle - start), + end - middle, data.length / (end - middle)) +//console.log(data) + http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/base64-js/lib/b64.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/base64-js/lib/b64.js b/bin/node_modules/plist/node_modules/base64-js/lib/b64.js new file mode 100644 index 0000000..887f706 --- /dev/null +++ b/bin/node_modules/plist/node_modules/base64-js/lib/b64.js @@ -0,0 +1,121 @@ +var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + +;(function (exports) { + 'use strict'; + + var Arr = (typeof Uint8Array !== 'undefined') + ? Uint8Array + : Array + + var ZERO = '0'.charCodeAt(0) + var PLUS = '+'.charCodeAt(0) + var SLASH = '/'.charCodeAt(0) + var NUMBER = '0'.charCodeAt(0) + var LOWER = 'a'.charCodeAt(0) + var UPPER = 'A'.charCodeAt(0) + + function decode (elt) { + var code = elt.charCodeAt(0) + if (code === PLUS) + return 62 // '+' + if (code === SLASH) + return 63 // '/' + if (code < NUMBER) + return -1 //no match + if (code < NUMBER + 10) + return code - NUMBER + 26 + 26 + if (code < UPPER + 26) + return code - UPPER + if (code < LOWER + 26) + return code - LOWER + 26 + } + + function b64ToByteArray (b64) { + var i, j, l, tmp, placeHolders, arr + + if (b64.length % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + var len = b64.length + placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0 + + // base64 is 4/3 + up to two characters of the original data + arr = new Arr(b64.length * 3 / 4 - placeHolders) + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? b64.length - 4 : b64.length + + var L = 0 + + function push (v) { + arr[L++] = v + } + + for (i = 0, j = 0; i < l; i += 4, j += 3) { + tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3)) + push((tmp & 0xFF0000) >> 16) + push((tmp & 0xFF00) >> 8) + push(tmp & 0xFF) + } + + if (placeHolders === 2) { + tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4) + push(tmp & 0xFF) + } else if (placeHolders === 1) { + tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2) + push((tmp >> 8) & 0xFF) + push(tmp & 0xFF) + } + + return arr + } + + function uint8ToBase64 (uint8) { + var i, + extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes + output = "", + temp, length + + function encode (num) { + return lookup.charAt(num) + } + + function tripletToBase64 (num) { + return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F) + } + + // go through the array every three bytes, we'll deal with trailing stuff later + for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { + temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) + output += tripletToBase64(temp) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + switch (extraBytes) { + case 1: + temp = uint8[uint8.length - 1] + output += encode(temp >> 2) + output += encode((temp << 4) & 0x3F) + output += '==' + break + case 2: + temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]) + output += encode(temp >> 10) + output += encode((temp >> 4) & 0x3F) + output += encode((temp << 2) & 0x3F) + output += '=' + break + } + + return output + } + + module.exports.toByteArray = b64ToByteArray + module.exports.fromByteArray = uint8ToBase64 +}()) http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/base64-js/package.json ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/base64-js/package.json b/bin/node_modules/plist/node_modules/base64-js/package.json new file mode 100644 index 0000000..001b227 --- /dev/null +++ b/bin/node_modules/plist/node_modules/base64-js/package.json @@ -0,0 +1,62 @@ +{ + "author": { + "name": "T. Jameson Little", + "email": "[email protected]" + }, + "name": "base64-js", + "description": "Base64 encoding/decoding in pure JS", + "version": "0.0.6", + "repository": { + "type": "git", + "url": "git://github.com/beatgammit/base64-js.git" + }, + "main": "lib/b64.js", + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "chrome/4..latest", + "firefox/3..latest", + "safari/5.1..latest", + "opera/11.0..latest", + "iphone/6", + "ipad/6" + ] + }, + "engines": { + "node": ">= 0.4" + }, + "license": "MIT", + "dependencies": {}, + "devDependencies": { + "tape": "~2.3.2" + }, + "bugs": { + "url": "https://github.com/beatgammit/base64-js/issues" + }, + "homepage": "https://github.com/beatgammit/base64-js", + "_id": "[email protected]", + "dist": { + "shasum": "7b859f79f0bbbd55867ba67a7fab397e24a20947", + "tarball": "http://registry.npmjs.org/base64-js/-/base64-js-0.0.6.tgz" + }, + "_from": "[email protected]", + "_npmVersion": "1.3.21", + "_npmUser": { + "name": "feross", + "email": "[email protected]" + }, + "maintainers": [ + { + "name": "feross", + "email": "[email protected]" + } + ], + "directories": {}, + "_shasum": "7b859f79f0bbbd55867ba67a7fab397e24a20947", + "_resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.6.tgz", + "readme": "ERROR: No README data found!" +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/base64-js/test/convert.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/base64-js/test/convert.js b/bin/node_modules/plist/node_modules/base64-js/test/convert.js new file mode 100644 index 0000000..48fbba7 --- /dev/null +++ b/bin/node_modules/plist/node_modules/base64-js/test/convert.js @@ -0,0 +1,52 @@ +var test = require('tape'), + b64 = require('../lib/b64'), + checks = [ + 'a', + 'aa', + 'aaa', + 'hi', + 'hi!', + 'hi!!', + 'sup', + 'sup?', + 'sup?!' + ], + res; + +test('convert to base64 and back', function (t) { + t.plan(checks.length); + + for (var i = 0; i < checks.length; i++) { + var check = checks[i], + b64Str, + arr, + str; + + b64Str = b64.fromByteArray(map(check, function (char) { return char.charCodeAt(0); })); + + arr = b64.toByteArray(b64Str); + str = map(arr, function (byte) { return String.fromCharCode(byte); }).join(''); + + t.equal(check, str, 'Checked ' + check); + } + +}); + +function map (arr, callback) { + var res = [], + kValue, + mappedValue; + + for (var k = 0, len = arr.length; k < len; k++) { + if ((typeof arr === 'string' && !!arr.charAt(k))) { + kValue = arr.charAt(k); + mappedValue = callback(kValue, k, arr); + res[k] = mappedValue; + } else if (typeof arr !== 'string' && k in arr) { + kValue = arr[k]; + mappedValue = callback(kValue, k, arr); + res[k] = mappedValue; + } + } + return res; +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/util-deprecate/History.md ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/util-deprecate/History.md b/bin/node_modules/plist/node_modules/util-deprecate/History.md new file mode 100644 index 0000000..149b6d3 --- /dev/null +++ b/bin/node_modules/plist/node_modules/util-deprecate/History.md @@ -0,0 +1,5 @@ + +1.0.0 / 2014-04-30 +================== + + * initial commit http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/util-deprecate/LICENSE ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/util-deprecate/LICENSE b/bin/node_modules/plist/node_modules/util-deprecate/LICENSE new file mode 100644 index 0000000..6a60e8c --- /dev/null +++ b/bin/node_modules/plist/node_modules/util-deprecate/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich <[email protected]> + +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. http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/util-deprecate/README.md ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/util-deprecate/README.md b/bin/node_modules/plist/node_modules/util-deprecate/README.md new file mode 100644 index 0000000..75622fa --- /dev/null +++ b/bin/node_modules/plist/node_modules/util-deprecate/README.md @@ -0,0 +1,53 @@ +util-deprecate +============== +### The Node.js `util.deprecate()` function with browser support + +In Node.js, this module simply re-exports the `util.deprecate()` function. + +In the web browser (i.e. via browserify), a browser-specific implementation +of the `util.deprecate()` function is used. + + +## API + +A `deprecate()` function is the only thing exposed by this module. + +``` javascript +// setup: +exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); + + +// users see: +foo(); +// foo() is deprecated, use bar() instead +foo(); +foo(); +``` + + +## License + +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich <[email protected]> + +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. http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/util-deprecate/browser.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/util-deprecate/browser.js b/bin/node_modules/plist/node_modules/util-deprecate/browser.js new file mode 100644 index 0000000..9112c54 --- /dev/null +++ b/bin/node_modules/plist/node_modules/util-deprecate/browser.js @@ -0,0 +1,55 @@ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * If --no-deprecation is set, then it is a no-op. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + if (!global.localStorage) return false; + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/util-deprecate/node.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/util-deprecate/node.js b/bin/node_modules/plist/node_modules/util-deprecate/node.js new file mode 100644 index 0000000..5e6fcff --- /dev/null +++ b/bin/node_modules/plist/node_modules/util-deprecate/node.js @@ -0,0 +1,6 @@ + +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + +module.exports = require('util').deprecate; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/util-deprecate/package.json ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/util-deprecate/package.json b/bin/node_modules/plist/node_modules/util-deprecate/package.json new file mode 100644 index 0000000..b05f100 --- /dev/null +++ b/bin/node_modules/plist/node_modules/util-deprecate/package.json @@ -0,0 +1,52 @@ +{ + "name": "util-deprecate", + "version": "1.0.0", + "description": "The Node.js `util.deprecate()` function with browser support", + "main": "node.js", + "browser": "browser.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/util-deprecate.git" + }, + "keywords": [ + "util", + "deprecate", + "browserify", + "browser", + "node" + ], + "author": { + "name": "Nathan Rajlich", + "email": "[email protected]", + "url": "http://n8.io/" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/util-deprecate/issues" + }, + "homepage": "https://github.com/TooTallNate/util-deprecate", + "_id": "[email protected]", + "dist": { + "shasum": "3007af012c140eae26de05576ec22785cac3abf2", + "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.0.tgz" + }, + "_from": "[email protected]", + "_npmVersion": "1.4.3", + "_npmUser": { + "name": "tootallnate", + "email": "[email protected]" + }, + "maintainers": [ + { + "name": "tootallnate", + "email": "[email protected]" + } + ], + "directories": {}, + "_shasum": "3007af012c140eae26de05576ec22785cac3abf2", + "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/.npmignore ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/.npmignore b/bin/node_modules/plist/node_modules/xmlbuilder/.npmignore new file mode 100644 index 0000000..3ca4980 --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/.npmignore @@ -0,0 +1,4 @@ +.travis.yml +src +test +perf http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/LICENSE ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/LICENSE b/bin/node_modules/plist/node_modules/xmlbuilder/LICENSE new file mode 100644 index 0000000..e7cbac9 --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Ozgur Ozcitak + +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. http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/README.md ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/README.md b/bin/node_modules/plist/node_modules/xmlbuilder/README.md new file mode 100644 index 0000000..4883757 --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/README.md @@ -0,0 +1,82 @@ +# xmlbuilder-js + +An XML builder for [node.js](http://nodejs.org/) similar to +[java-xmlbuilder](http://code.google.com/p/java-xmlbuilder/). + +[](http://badge.fury.io/js/xmlbuilder) +[](http://travis-ci.org/oozcitak/xmlbuilder-js) +[](https://david-dm.org/oozcitak/xmlbuilder-js) + +### Installation: + +``` sh +npm install xmlbuilder +``` + +### Usage: + +``` js +var builder = require('xmlbuilder'); +var xml = builder.create('root') + .ele('xmlbuilder', {'for': 'node-js'}) + .ele('repo', {'type': 'git'}, 'git://github.com/oozcitak/xmlbuilder-js.git') + .end({ pretty: true}); + +console.log(xml); +``` + +will result in: + +``` xml +<?xml version="1.0"?> +<root> + <xmlbuilder for="node-js"> + <repo type="git">git://github.com/oozcitak/xmlbuilder-js.git</repo> + </xmlbuilder> +</root> +``` + +It is also possible to convert objects into nodes: + +``` js +builder.create({ + root: { + xmlbuilder: { + '@for': 'node-js', // attributes start with @ + repo: { + '@type': 'git', + '#text': 'git://github.com/oozcitak/xmlbuilder-js.git' // #text denotes element text + } + } + } +}); +``` + +If you need to do some processing: + +``` js +var root = builder.create('squares'); +root.com('f(x) = x^2'); +for(var i = 1; i <= 5; i++) +{ + var item = root.ele('data'); + item.att('x', i); + item.att('y', i * i); +} +``` + +This will result in: + +``` xml +<?xml version="1.0"?> +<squares> + <!-- f(x) = x^2 --> + <data x="1" y="1"/> + <data x="2" y="4"/> + <data x="3" y="9"/> + <data x="4" y="16"/> + <data x="5" y="25"/> +</squares> +``` + +See the [wiki](https://github.com/oozcitak/xmlbuilder-js/wiki) for details. http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLAttribute.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLAttribute.js b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLAttribute.js new file mode 100644 index 0000000..a83ffec --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLAttribute.js @@ -0,0 +1,32 @@ +// Generated by CoffeeScript 1.6.3 +(function() { + var XMLAttribute, _; + + _ = require('lodash-node'); + + module.exports = XMLAttribute = (function() { + function XMLAttribute(parent, name, value) { + this.stringify = parent.stringify; + if (name == null) { + throw new Error("Missing attribute name"); + } + if (value == null) { + throw new Error("Missing attribute value"); + } + this.name = this.stringify.attName(name); + this.value = this.stringify.attValue(value); + } + + XMLAttribute.prototype.clone = function() { + return _.create(XMLAttribute.prototype, this); + }; + + XMLAttribute.prototype.toString = function(options, level) { + return ' ' + this.name + '="' + this.value + '"'; + }; + + return XMLAttribute; + + })(); + +}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLBuilder.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLBuilder.js b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLBuilder.js new file mode 100644 index 0000000..063d6db --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLBuilder.js @@ -0,0 +1,70 @@ +// Generated by CoffeeScript 1.6.3 +(function() { + var XMLBuilder, XMLDeclaration, XMLDocType, XMLElement, XMLStringifier, _; + + _ = require('lodash-node'); + + XMLStringifier = require('./XMLStringifier'); + + XMLDeclaration = require('./XMLDeclaration'); + + XMLDocType = require('./XMLDocType'); + + XMLElement = require('./XMLElement'); + + module.exports = XMLBuilder = (function() { + function XMLBuilder(name, options) { + var root, temp; + if (name == null) { + throw new Error("Root element needs a name"); + } + if (options == null) { + options = {}; + } + this.options = options; + this.stringify = new XMLStringifier(options); + temp = new XMLElement(this, 'doc'); + root = temp.element(name); + root.isRoot = true; + root.documentObject = this; + this.rootObject = root; + if (!options.headless) { + root.declaration(options); + if ((options.pubID != null) || (options.sysID != null)) { + root.doctype(options); + } + } + } + + XMLBuilder.prototype.root = function() { + return this.rootObject; + }; + + XMLBuilder.prototype.end = function(options) { + return toString(options); + }; + + XMLBuilder.prototype.toString = function(options) { + var indent, newline, pretty, r; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (options != null ? options.indent : void 0) || ' '; + newline = (options != null ? options.newline : void 0) || '\n'; + r = ''; + if (this.xmldec != null) { + r += this.xmldec.toString(options); + } + if (this.doctype != null) { + r += this.doctype.toString(options); + } + r += this.rootObject.toString(options); + if (pretty && r.slice(-newline.length) === newline) { + r = r.slice(0, -newline.length); + } + return r; + }; + + return XMLBuilder; + + })(); + +}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLCData.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLCData.js b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLCData.js new file mode 100644 index 0000000..c729a3f --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLCData.js @@ -0,0 +1,48 @@ +// Generated by CoffeeScript 1.6.3 +(function() { + var XMLCData, XMLNode, _, + __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; + + _ = require('lodash-node'); + + XMLNode = require('./XMLNode'); + + module.exports = XMLCData = (function(_super) { + __extends(XMLCData, _super); + + function XMLCData(parent, text) { + XMLCData.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing CDATA text"); + } + this.text = this.stringify.cdata(text); + } + + XMLCData.prototype.clone = function() { + return _.create(XMLCData.prototype, this); + }; + + XMLCData.prototype.toString = function(options, level) { + var indent, newline, pretty, r, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (options != null ? options.indent : void 0) || ' '; + newline = (options != null ? options.newline : void 0) || '\n'; + level || (level = 0); + space = new Array(level + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += '<![CDATA[' + this.text + ']]>'; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLCData; + + })(XMLNode); + +}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLComment.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLComment.js b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLComment.js new file mode 100644 index 0000000..d89cc8f --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLComment.js @@ -0,0 +1,48 @@ +// Generated by CoffeeScript 1.6.3 +(function() { + var XMLComment, XMLNode, _, + __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; + + _ = require('lodash-node'); + + XMLNode = require('./XMLNode'); + + module.exports = XMLComment = (function(_super) { + __extends(XMLComment, _super); + + function XMLComment(parent, text) { + XMLComment.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing comment text"); + } + this.text = this.stringify.comment(text); + } + + XMLComment.prototype.clone = function() { + return _.create(XMLComment.prototype, this); + }; + + XMLComment.prototype.toString = function(options, level) { + var indent, newline, pretty, r, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (options != null ? options.indent : void 0) || ' '; + newline = (options != null ? options.newline : void 0) || '\n'; + level || (level = 0); + space = new Array(level + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += '<!-- ' + this.text + ' -->'; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLComment; + + })(XMLNode); + +}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDAttList.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDAttList.js b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDAttList.js new file mode 100644 index 0000000..37e2fa7 --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDAttList.js @@ -0,0 +1,71 @@ +// Generated by CoffeeScript 1.6.3 +(function() { + var XMLDTDAttList, _; + + _ = require('lodash-node'); + + module.exports = XMLDTDAttList = (function() { + function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) { + this.stringify = parent.stringify; + if (elementName == null) { + throw new Error("Missing DTD element name"); + } + if (attributeName == null) { + throw new Error("Missing DTD attribute name"); + } + if (!attributeType) { + throw new Error("Missing DTD attribute type"); + } + if (!defaultValueType) { + throw new Error("Missing DTD attribute default"); + } + if (defaultValueType.indexOf('#') !== 0) { + defaultValueType = '#' + defaultValueType; + } + if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) { + throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT"); + } + if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) { + throw new Error("Default value only applies to #FIXED or #DEFAULT"); + } + this.elementName = this.stringify.eleName(elementName); + this.attributeName = this.stringify.attName(attributeName); + this.attributeType = this.stringify.dtdAttType(attributeType); + this.defaultValue = this.stringify.dtdAttDefault(defaultValue); + this.defaultValueType = defaultValueType; + } + + XMLDTDAttList.prototype.clone = function() { + return _.create(XMLDTDAttList.prototype, this); + }; + + XMLDTDAttList.prototype.toString = function(options, level) { + var indent, newline, pretty, r, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (options != null ? options.indent : void 0) || ' '; + newline = (options != null ? options.newline : void 0) || '\n'; + level || (level = 0); + space = new Array(level + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += '<!ATTLIST ' + this.elementName + ' ' + this.attributeName + ' ' + this.attributeType; + if (this.defaultValueType !== '#DEFAULT') { + r += ' ' + this.defaultValueType; + } + if (this.defaultValue) { + r += ' "' + this.defaultValue + '"'; + } + r += '>'; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLDTDAttList; + + })(); + +}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDElement.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDElement.js b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDElement.js new file mode 100644 index 0000000..548eed4 --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDElement.js @@ -0,0 +1,49 @@ +// Generated by CoffeeScript 1.6.3 +(function() { + var XMLDTDElement, _; + + _ = require('lodash-node'); + + module.exports = XMLDTDElement = (function() { + function XMLDTDElement(parent, name, value) { + this.stringify = parent.stringify; + if (name == null) { + throw new Error("Missing DTD element name"); + } + if (!value) { + value = '(#PCDATA)'; + } + if (_.isArray(value)) { + value = '(' + value.join(',') + ')'; + } + this.name = this.stringify.eleName(name); + this.value = this.stringify.dtdElementValue(value); + } + + XMLDTDElement.prototype.clone = function() { + return _.create(XMLDTDElement.prototype, this); + }; + + XMLDTDElement.prototype.toString = function(options, level) { + var indent, newline, pretty, r, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (options != null ? options.indent : void 0) || ' '; + newline = (options != null ? options.newline : void 0) || '\n'; + level || (level = 0); + space = new Array(level + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += '<!ELEMENT ' + this.name + ' ' + this.value + '>'; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLDTDElement; + + })(); + +}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDEntity.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDEntity.js b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDEntity.js new file mode 100644 index 0000000..205c948 --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDEntity.js @@ -0,0 +1,85 @@ +// Generated by CoffeeScript 1.6.3 +(function() { + var XMLDTDEntity, _; + + _ = require('lodash-node'); + + module.exports = XMLDTDEntity = (function() { + function XMLDTDEntity(parent, pe, name, value) { + this.stringify = parent.stringify; + if (name == null) { + throw new Error("Missing entity name"); + } + if (value == null) { + throw new Error("Missing entity value"); + } + this.pe = !!pe; + this.name = this.stringify.eleName(name); + if (!_.isObject(value)) { + this.value = this.stringify.dtdEntityValue(value); + } else { + if (!value.pubID && !value.sysID) { + throw new Error("Public and/or system identifiers are required for an external entity"); + } + if (value.pubID && !value.sysID) { + throw new Error("System identifier is required for a public external entity"); + } + if (value.pubID != null) { + this.pubID = this.stringify.dtdPubID(value.pubID); + } + if (value.sysID != null) { + this.sysID = this.stringify.dtdSysID(value.sysID); + } + if (value.nData != null) { + this.nData = this.stringify.dtdNData(value.nData); + } + if (this.pe && this.nData) { + throw new Error("Notation declaration is not allowed in a parameter entity"); + } + } + } + + XMLDTDEntity.prototype.clone = function() { + return _.create(XMLDTDEntity.prototype, this); + }; + + XMLDTDEntity.prototype.toString = function(options, level) { + var indent, newline, pretty, r, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (options != null ? options.indent : void 0) || ' '; + newline = (options != null ? options.newline : void 0) || '\n'; + level || (level = 0); + space = new Array(level + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += '<!ENTITY'; + if (this.pe) { + r += ' %'; + } + r += ' ' + this.name; + if (this.value) { + r += ' "' + this.value + '"'; + } else { + if (this.pubID && this.sysID) { + r += ' PUBLIC "' + this.pubID + '" "' + this.sysID + '"'; + } else if (this.sysID) { + r += ' SYSTEM "' + this.sysID + '"'; + } + if (this.nData) { + r += ' NDATA ' + this.nData; + } + } + r += '>'; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLDTDEntity; + + })(); + +}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDNotation.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDNotation.js b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDNotation.js new file mode 100644 index 0000000..94b0cb6 --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDTDNotation.js @@ -0,0 +1,59 @@ +// Generated by CoffeeScript 1.6.3 +(function() { + var XMLDTDNotation, _; + + _ = require('lodash-node'); + + module.exports = XMLDTDNotation = (function() { + function XMLDTDNotation(parent, name, value) { + this.stringify = parent.stringify; + if (name == null) { + throw new Error("Missing notation name"); + } + if (!value.pubID && !value.sysID) { + throw new Error("Public or system identifiers are required for an external entity"); + } + this.name = this.stringify.eleName(name); + if (value.pubID != null) { + this.pubID = this.stringify.dtdPubID(value.pubID); + } + if (value.sysID != null) { + this.sysID = this.stringify.dtdSysID(value.sysID); + } + } + + XMLDTDNotation.prototype.clone = function() { + return _.create(XMLDTDNotation.prototype, this); + }; + + XMLDTDNotation.prototype.toString = function(options, level) { + var indent, newline, pretty, r, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (options != null ? options.indent : void 0) || ' '; + newline = (options != null ? options.newline : void 0) || '\n'; + level || (level = 0); + space = new Array(level + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += '<!NOTATION ' + this.name; + if (this.pubID && this.sysID) { + r += ' PUBLIC "' + this.pubID + '" "' + this.sysID + '"'; + } else if (this.pubID) { + r += ' PUBLIC "' + this.pubID + '"'; + } else if (this.sysID) { + r += ' SYSTEM "' + this.sysID + '"'; + } + r += '>'; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLDTDNotation; + + })(); + +}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDeclaration.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDeclaration.js b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDeclaration.js new file mode 100644 index 0000000..a8ea575 --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDeclaration.js @@ -0,0 +1,70 @@ +// Generated by CoffeeScript 1.6.3 +(function() { + var XMLDeclaration, XMLNode, _, + __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; + + _ = require('lodash-node'); + + XMLNode = require('./XMLNode'); + + module.exports = XMLDeclaration = (function(_super) { + __extends(XMLDeclaration, _super); + + function XMLDeclaration(parent, version, encoding, standalone) { + var _ref; + XMLDeclaration.__super__.constructor.call(this, parent); + if (_.isObject(version)) { + _ref = version, version = _ref.version, encoding = _ref.encoding, standalone = _ref.standalone; + } + if (!version) { + version = '1.0'; + } + if (version != null) { + this.version = this.stringify.xmlVersion(version); + } + if (encoding != null) { + this.encoding = this.stringify.xmlEncoding(encoding); + } + if (standalone != null) { + this.standalone = this.stringify.xmlStandalone(standalone); + } + } + + XMLDeclaration.prototype.clone = function() { + return _.create(XMLDeclaration.prototype, this); + }; + + XMLDeclaration.prototype.toString = function(options, level) { + var indent, newline, pretty, r, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (options != null ? options.indent : void 0) || ' '; + newline = (options != null ? options.newline : void 0) || '\n'; + level || (level = 0); + space = new Array(level + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += '<?xml'; + if (this.version != null) { + r += ' version="' + this.version + '"'; + } + if (this.encoding != null) { + r += ' encoding="' + this.encoding + '"'; + } + if (this.standalone != null) { + r += ' standalone="' + this.standalone + '"'; + } + r += '?>'; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLDeclaration; + + })(XMLNode); + +}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDocType.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDocType.js b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDocType.js new file mode 100644 index 0000000..d360353 --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLDocType.js @@ -0,0 +1,183 @@ +// Generated by CoffeeScript 1.6.3 +(function() { + var XMLDocType, _; + + _ = require('lodash-node'); + + module.exports = XMLDocType = (function() { + function XMLDocType(parent, pubID, sysID) { + var _ref, _ref1; + this.documentObject = parent; + this.stringify = this.documentObject.stringify; + this.children = []; + if (_.isObject(pubID)) { + _ref = pubID, pubID = _ref.pubID, sysID = _ref.sysID; + } + if (sysID == null) { + _ref1 = [pubID, sysID], sysID = _ref1[0], pubID = _ref1[1]; + } + if (pubID != null) { + this.pubID = this.stringify.dtdPubID(pubID); + } + if (sysID != null) { + this.sysID = this.stringify.dtdSysID(sysID); + } + } + + XMLDocType.prototype.clone = function() { + return _.create(XMLDocType.prototype, this); + }; + + XMLDocType.prototype.element = function(name, value) { + var XMLDTDElement, child; + XMLDTDElement = require('./XMLDTDElement'); + child = new XMLDTDElement(this, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { + var XMLDTDAttList, child; + XMLDTDAttList = require('./XMLDTDAttList'); + child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.entity = function(name, value) { + var XMLDTDEntity, child; + XMLDTDEntity = require('./XMLDTDEntity'); + child = new XMLDTDEntity(this, false, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.pEntity = function(name, value) { + var XMLDTDEntity, child; + XMLDTDEntity = require('./XMLDTDEntity'); + child = new XMLDTDEntity(this, true, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.notation = function(name, value) { + var XMLDTDNotation, child; + XMLDTDNotation = require('./XMLDTDNotation'); + child = new XMLDTDNotation(this, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.cdata = function(value) { + var XMLCData, child; + XMLCData = require('./XMLCData'); + child = new XMLCData(this, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.comment = function(value) { + var XMLComment, child; + XMLComment = require('./XMLComment'); + child = new XMLComment(this, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.instruction = function(target, value) { + var XMLProcessingInstruction, child; + XMLProcessingInstruction = require('./XMLProcessingInstruction'); + child = new XMLProcessingInstruction(this, target, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.root = function() { + return this.documentObject.root(); + }; + + XMLDocType.prototype.document = function() { + return this.documentObject; + }; + + XMLDocType.prototype.toString = function(options, level) { + var child, indent, newline, pretty, r, space, _i, _len, _ref; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (options != null ? options.indent : void 0) || ' '; + newline = (options != null ? options.newline : void 0) || '\n'; + level || (level = 0); + space = new Array(level + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += '<!DOCTYPE ' + this.root().name; + if (this.pubID && this.sysID) { + r += ' PUBLIC "' + this.pubID + '" "' + this.sysID + '"'; + } else if (this.sysID) { + r += ' SYSTEM "' + this.sysID + '"'; + } + if (this.children.length > 0) { + r += ' ['; + if (pretty) { + r += newline; + } + _ref = this.children; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + child = _ref[_i]; + r += child.toString(options, level + 1); + } + r += ']'; + } + r += '>'; + if (pretty) { + r += newline; + } + return r; + }; + + XMLDocType.prototype.ele = function(name, value) { + return this.element(name, value); + }; + + XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { + return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue); + }; + + XMLDocType.prototype.ent = function(name, value) { + return this.entity(name, value); + }; + + XMLDocType.prototype.pent = function(name, value) { + return this.pEntity(name, value); + }; + + XMLDocType.prototype.not = function(name, value) { + return this.notation(name, value); + }; + + XMLDocType.prototype.dat = function(value) { + return this.cdata(value); + }; + + XMLDocType.prototype.com = function(value) { + return this.comment(value); + }; + + XMLDocType.prototype.ins = function(target, value) { + return this.instruction(target, value); + }; + + XMLDocType.prototype.up = function() { + return this.root(); + }; + + XMLDocType.prototype.doc = function() { + return this.document(); + }; + + return XMLDocType; + + })(); + +}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLElement.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLElement.js b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLElement.js new file mode 100644 index 0000000..28a5c81 --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLElement.js @@ -0,0 +1,190 @@ +// Generated by CoffeeScript 1.6.3 +(function() { + var XMLAttribute, XMLElement, XMLNode, XMLProcessingInstruction, _, + __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; + + _ = require('lodash-node'); + + XMLNode = require('./XMLNode'); + + XMLAttribute = require('./XMLAttribute'); + + XMLProcessingInstruction = require('./XMLProcessingInstruction'); + + module.exports = XMLElement = (function(_super) { + __extends(XMLElement, _super); + + function XMLElement(parent, name, attributes) { + XMLElement.__super__.constructor.call(this, parent); + if (name == null) { + throw new Error("Missing element name"); + } + this.name = this.stringify.eleName(name); + this.children = []; + this.instructions = []; + this.attributes = {}; + if (attributes != null) { + this.attribute(attributes); + } + } + + XMLElement.prototype.clone = function() { + var att, attName, clonedSelf, pi, _i, _len, _ref, _ref1; + clonedSelf = _.create(XMLElement.prototype, this); + clonedSelf.attributes = {}; + _ref = this.attributes; + for (attName in _ref) { + if (!__hasProp.call(_ref, attName)) continue; + att = _ref[attName]; + clonedSelf.attributes[attName] = att.clone(); + } + clonedSelf.instructions = []; + _ref1 = this.instructions; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + pi = _ref1[_i]; + clonedSelf.instructions.push(pi.clone()); + } + clonedSelf.children = []; + this.children.forEach(function(child) { + var clonedChild; + clonedChild = child.clone(); + clonedChild.parent = clonedSelf; + return clonedSelf.children.push(clonedChild); + }); + return clonedSelf; + }; + + XMLElement.prototype.attribute = function(name, value) { + var attName, attValue; + if (_.isObject(name)) { + for (attName in name) { + if (!__hasProp.call(name, attName)) continue; + attValue = name[attName]; + this.attribute(attName, attValue); + } + } else { + if (_.isFunction(value)) { + value = value.apply(); + } + if (!this.options.skipNullAttributes || (value != null)) { + this.attributes[name] = new XMLAttribute(this, name, value); + } + } + return this; + }; + + XMLElement.prototype.removeAttribute = function(name) { + var attName, _i, _len; + if (name == null) { + throw new Error("Missing attribute name"); + } + if (_.isArray(name)) { + for (_i = 0, _len = name.length; _i < _len; _i++) { + attName = name[_i]; + delete this.attributes[attName]; + } + } else { + delete this.attributes[name]; + } + return this; + }; + + XMLElement.prototype.instruction = function(target, value) { + var insTarget, insValue, instruction, _i, _len; + if (_.isArray(target)) { + for (_i = 0, _len = target.length; _i < _len; _i++) { + insTarget = target[_i]; + this.instruction(insTarget); + } + } else if (_.isObject(target)) { + for (insTarget in target) { + if (!__hasProp.call(target, insTarget)) continue; + insValue = target[insTarget]; + this.instruction(insTarget, insValue); + } + } else { + if (_.isFunction(value)) { + value = value.apply(); + } + instruction = new XMLProcessingInstruction(this, target, value); + this.instructions.push(instruction); + } + return this; + }; + + XMLElement.prototype.toString = function(options, level) { + var att, child, indent, instruction, name, newline, pretty, r, space, _i, _j, _len, _len1, _ref, _ref1, _ref2; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (options != null ? options.indent : void 0) || ' '; + newline = (options != null ? options.newline : void 0) || '\n'; + level || (level = 0); + space = new Array(level + 1).join(indent); + r = ''; + _ref = this.instructions; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + instruction = _ref[_i]; + r += instruction.toString(options, level + 1); + } + if (pretty) { + r += space; + } + r += '<' + this.name; + _ref1 = this.attributes; + for (name in _ref1) { + if (!__hasProp.call(_ref1, name)) continue; + att = _ref1[name]; + r += att.toString(options); + } + if (this.children.length === 0) { + r += '/>'; + if (pretty) { + r += newline; + } + } else if (pretty && this.children.length === 1 && (this.children[0].value != null)) { + r += '>'; + r += this.children[0].value; + r += '</' + this.name + '>'; + r += newline; + } else { + r += '>'; + if (pretty) { + r += newline; + } + _ref2 = this.children; + for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { + child = _ref2[_j]; + r += child.toString(options, level + 1); + } + if (pretty) { + r += space; + } + r += '</' + this.name + '>'; + if (pretty) { + r += newline; + } + } + return r; + }; + + XMLElement.prototype.att = function(name, value) { + return this.attribute(name, value); + }; + + XMLElement.prototype.ins = function(target, value) { + return this.instruction(target, value); + }; + + XMLElement.prototype.a = function(name, value) { + return this.attribute(name, value); + }; + + XMLElement.prototype.i = function(target, value) { + return this.instruction(target, value); + }; + + return XMLElement; + + })(XMLNode); + +}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLNode.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLNode.js b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLNode.js new file mode 100644 index 0000000..1551647 --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLNode.js @@ -0,0 +1,304 @@ +// Generated by CoffeeScript 1.6.3 +(function() { + var XMLNode, _, + __hasProp = {}.hasOwnProperty; + + _ = require('lodash-node'); + + module.exports = XMLNode = (function() { + function XMLNode(parent) { + this.parent = parent; + this.options = this.parent.options; + this.stringify = this.parent.stringify; + } + + XMLNode.prototype.clone = function() { + throw new Error("Cannot clone generic XMLNode"); + }; + + XMLNode.prototype.element = function(name, attributes, text) { + var item, key, lastChild, val, _i, _len, _ref; + lastChild = null; + if (attributes == null) { + attributes = {}; + } + if (!_.isObject(attributes)) { + _ref = [attributes, text], text = _ref[0], attributes = _ref[1]; + } + if (_.isArray(name)) { + for (_i = 0, _len = name.length; _i < _len; _i++) { + item = name[_i]; + lastChild = this.element(item); + } + } else if (_.isFunction(name)) { + lastChild = this.element(name.apply()); + } else if (_.isObject(name)) { + for (key in name) { + if (!__hasProp.call(name, key)) continue; + val = name[key]; + if (!(val != null)) { + continue; + } + if (_.isFunction(val)) { + val = val.apply(); + } + if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) { + lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val); + } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && key.indexOf(this.stringify.convertPIKey) === 0) { + lastChild = this.instruction(key.substr(this.stringify.convertPIKey.length), val); + } else if (_.isObject(val)) { + if (!this.options.ignoreDecorators && this.stringify.convertListKey && key.indexOf(this.stringify.convertListKey) === 0 && _.isArray(val)) { + lastChild = this.element(val); + } else { + lastChild = this.element(key); + lastChild.element(val); + } + } else { + lastChild = this.element(key, val); + } + } + } else { + if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) { + lastChild = this.text(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) { + lastChild = this.cdata(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) { + lastChild = this.comment(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) { + lastChild = this.raw(text); + } else { + lastChild = this.node(name, attributes, text); + } + } + if (lastChild == null) { + throw new Error("Could not create any elements with: " + name); + } + return lastChild; + }; + + XMLNode.prototype.insertBefore = function(name, attributes, text) { + var child, i, removed; + if (this.isRoot) { + throw new Error("Cannot insert elements at root level"); + } + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i); + child = this.parent.element(name, attributes, text); + Array.prototype.push.apply(this.parent.children, removed); + return child; + }; + + XMLNode.prototype.insertAfter = function(name, attributes, text) { + var child, i, removed; + if (this.isRoot) { + throw new Error("Cannot insert elements at root level"); + } + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i + 1); + child = this.parent.element(name, attributes, text); + Array.prototype.push.apply(this.parent.children, removed); + return child; + }; + + XMLNode.prototype.remove = function() { + var i, _ref; + if (this.isRoot) { + throw new Error("Cannot remove the root element"); + } + i = this.parent.children.indexOf(this); + [].splice.apply(this.parent.children, [i, i - i + 1].concat(_ref = [])), _ref; + return this.parent; + }; + + XMLNode.prototype.node = function(name, attributes, text) { + var XMLElement, child, _ref; + if (attributes == null) { + attributes = {}; + } + if (!_.isObject(attributes)) { + _ref = [attributes, text], text = _ref[0], attributes = _ref[1]; + } + XMLElement = require('./XMLElement'); + child = new XMLElement(this, name, attributes); + if (text != null) { + child.text(text); + } + this.children.push(child); + return child; + }; + + XMLNode.prototype.text = function(value) { + var XMLText, child; + XMLText = require('./XMLText'); + child = new XMLText(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.cdata = function(value) { + var XMLCData, child; + XMLCData = require('./XMLCData'); + child = new XMLCData(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.comment = function(value) { + var XMLComment, child; + XMLComment = require('./XMLComment'); + child = new XMLComment(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.raw = function(value) { + var XMLRaw, child; + XMLRaw = require('./XMLRaw'); + child = new XMLRaw(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.declaration = function(version, encoding, standalone) { + var XMLDeclaration, doc, xmldec; + doc = this.document(); + XMLDeclaration = require('./XMLDeclaration'); + xmldec = new XMLDeclaration(doc, version, encoding, standalone); + doc.xmldec = xmldec; + return doc.root(); + }; + + XMLNode.prototype.doctype = function(pubID, sysID) { + var XMLDocType, doc, doctype; + doc = this.document(); + XMLDocType = require('./XMLDocType'); + doctype = new XMLDocType(doc, pubID, sysID); + doc.doctype = doctype; + return doctype; + }; + + XMLNode.prototype.up = function() { + if (this.isRoot) { + throw new Error("The root node has no parent. Use doc() if you need to get the document object."); + } + return this.parent; + }; + + XMLNode.prototype.root = function() { + var child; + if (this.isRoot) { + return this; + } + child = this.parent; + while (!child.isRoot) { + child = child.parent; + } + return child; + }; + + XMLNode.prototype.document = function() { + return this.root().documentObject; + }; + + XMLNode.prototype.end = function(options) { + return this.document().toString(options); + }; + + XMLNode.prototype.prev = function() { + var i; + if (this.isRoot) { + throw new Error("Root node has no siblings"); + } + i = this.parent.children.indexOf(this); + if (i < 1) { + throw new Error("Already at the first node"); + } + return this.parent.children[i - 1]; + }; + + XMLNode.prototype.next = function() { + var i; + if (this.isRoot) { + throw new Error("Root node has no siblings"); + } + i = this.parent.children.indexOf(this); + if (i === -1 || i === this.parent.children.length - 1) { + throw new Error("Already at the last node"); + } + return this.parent.children[i + 1]; + }; + + XMLNode.prototype.importXMLBuilder = function(xmlbuilder) { + var clonedRoot; + clonedRoot = xmlbuilder.root().clone(); + clonedRoot.parent = this; + clonedRoot.isRoot = false; + this.children.push(clonedRoot); + return this; + }; + + XMLNode.prototype.ele = function(name, attributes, text) { + return this.element(name, attributes, text); + }; + + XMLNode.prototype.nod = function(name, attributes, text) { + return this.node(name, attributes, text); + }; + + XMLNode.prototype.txt = function(value) { + return this.text(value); + }; + + XMLNode.prototype.dat = function(value) { + return this.cdata(value); + }; + + XMLNode.prototype.com = function(value) { + return this.comment(value); + }; + + XMLNode.prototype.doc = function() { + return this.document(); + }; + + XMLNode.prototype.dec = function(version, encoding, standalone) { + return this.declaration(version, encoding, standalone); + }; + + XMLNode.prototype.dtd = function(pubID, sysID) { + return this.doctype(pubID, sysID); + }; + + XMLNode.prototype.e = function(name, attributes, text) { + return this.element(name, attributes, text); + }; + + XMLNode.prototype.n = function(name, attributes, text) { + return this.node(name, attributes, text); + }; + + XMLNode.prototype.t = function(value) { + return this.text(value); + }; + + XMLNode.prototype.d = function(value) { + return this.cdata(value); + }; + + XMLNode.prototype.c = function(value) { + return this.comment(value); + }; + + XMLNode.prototype.r = function(value) { + return this.raw(value); + }; + + XMLNode.prototype.u = function() { + return this.up(); + }; + + return XMLNode; + + })(); + +}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js new file mode 100644 index 0000000..bf85ed3 --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js @@ -0,0 +1,50 @@ +// Generated by CoffeeScript 1.6.3 +(function() { + var XMLProcessingInstruction, _; + + _ = require('lodash-node'); + + module.exports = XMLProcessingInstruction = (function() { + function XMLProcessingInstruction(parent, target, value) { + this.stringify = parent.stringify; + if (target == null) { + throw new Error("Missing instruction target"); + } + this.target = this.stringify.insTarget(target); + if (value) { + this.value = this.stringify.insValue(value); + } + } + + XMLProcessingInstruction.prototype.clone = function() { + return _.create(XMLProcessingInstruction.prototype, this); + }; + + XMLProcessingInstruction.prototype.toString = function(options, level) { + var indent, newline, pretty, r, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (options != null ? options.indent : void 0) || ' '; + newline = (options != null ? options.newline : void 0) || '\n'; + level || (level = 0); + space = new Array(level + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += '<?'; + r += this.target; + if (this.value) { + r += ' ' + this.value; + } + r += '?>'; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLProcessingInstruction; + + })(); + +}).call(this); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLRaw.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLRaw.js b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLRaw.js new file mode 100644 index 0000000..9761c42 --- /dev/null +++ b/bin/node_modules/plist/node_modules/xmlbuilder/lib/XMLRaw.js @@ -0,0 +1,48 @@ +// Generated by CoffeeScript 1.6.3 +(function() { + var XMLNode, XMLRaw, _, + __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; + + _ = require('lodash-node'); + + XMLNode = require('./XMLNode'); + + module.exports = XMLRaw = (function(_super) { + __extends(XMLRaw, _super); + + function XMLRaw(parent, text) { + XMLRaw.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing raw text"); + } + this.value = this.stringify.raw(text); + } + + XMLRaw.prototype.clone = function() { + return _.create(XMLRaw.prototype, this); + }; + + XMLRaw.prototype.toString = function(options, level) { + var indent, newline, pretty, r, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (options != null ? options.indent : void 0) || ' '; + newline = (options != null ? options.newline : void 0) || '\n'; + level || (level = 0); + space = new Array(level + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += this.value; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLRaw; + + })(XMLNode); + +}).call(this); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
